Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 14, 2025

Summary

Documents the new native shell completion scripts introduced in .NET 10 Preview 3, which provide significantly faster tab completion than the previous dynamic completion method.

Fixes #45549

Changes

  • Added native completion section documenting dotnet completions generate [SHELL] command with shell-specific configuration examples for PowerShell, Bash, Zsh, Fish, and Nushell
  • Added capability matrix showing completion types (hybrid vs dynamic) and description support per shell
  • Reorganized existing content moving dynamic completion methods to separate section for backward compatibility with pre-.NET 10 versions
  • Updated metadata with current date and AI-usage tag

Native vs Dynamic Completions

Native completions generate shell-specific scripts that handle static CLI grammar directly in the shell, falling back to dotnet complete only for dynamic content (package IDs, etc.). Dynamic completions route all requests through dotnet complete, which is slower.

Example for PowerShell:

# Add to $PROFILE for native completions (.NET 10+)
dotnet completions generate pwsh | Out-String | Invoke-Expression
Original prompt

This section details on the original issue you should resolve

<issue_title>Add information on using the native shell completions in .NET 10+</issue_title>
<issue_description>### Type of issue

Typo

Description

This page needs content about the new built-in tab completion scripts for shells: https://github.com/dotnet/core/blob/main/release-notes/10.0/preview/preview3/sdk.md#native-shell-completion-scripts

We should lean into these over the older, dynamic completions as they are much faster.

> dotnet completions generate [SHELL]
... lots of shell-specific script emitted here...

The shell argument is one of the following shell names:

  • bash
  • fish
  • nushell
  • pwsh
  • zsh

If no shell is specified, we will try to infer the correct shell from the current execution environment -

  • if Windows, default to pwsh
  • otherwise, see if the file name of the SHELL environment variable matches any of the shells above

Capabilities

The primary reason to do this is speed. Native shell completions are much faster than dynamic, dotnet-provided completions.

We have differing levels of support/capabilities for each shell in this release:

hybrid means that we generate shell-specific shims that are fast for the 'static' parts of the CLI grammar, but for dynamic parts of the grammar (NuGet Package Ids, etc) we ask the dotnet CLI for dynamic completions

dynamic means that all completions go through the full dotnet CLI, so completions may be slower

shell completion type support for descriptions in tab completions
bash hybrid no
fish dynamic no
nushell dynamic no
powershell hybrid yes
zsh hybrid yes

We'll want to document shell-specific examples of including these generation+registration scripts in each shell's equivalent of the $PROFILE.

For example, for powershell this might look something like adding this to your $PROFILE:

dotnet completions script pwsh | out-String | Invoke-Expression -ErrorAction SilentlyContinue

Page URL

https://learn.microsoft.com/en-us/dotnet/core/tools/enable-tab-autocomplete

Content source URL

https://github.com/dotnet/docs/blob/main/docs/core/tools/enable-tab-autocomplete.md

Document Version Independent Id

f30f63dc-0d90-7dba-ef39-b0148c637c1a

Platform Id

d808fba8-f906-9fc9-f8fd-8fe8bca5bdf8

Article author

@adegeo

Metadata

  • ID: 341f0255-aa31-8e76-9b17-1232b7a910a9
  • PlatformId: d808fba8-f906-9fc9-f8fd-8fe8bca5bdf8
  • Service: dotnet-fundamentals

Related Issues


Associated WorkItem - 498950</issue_description>

Comments on the Issue (you are @copilot in this section)

@adegeo @baronfel Thank you for the heads up. I'll prioritize this closer to Oct. @baronfel @adegeo np at all, and of course I'm happy to help with the content and examples. I'm just trying to make sure I've got issues logged for all the wonderful new SDK features coming in 10 :) @baronfel @adegeo this one is a dupe of https://github.com//issues/45549 (Because I'm bad at searching). The other one has more ready-to-go detail. Should we close this one and you pick up the other instead? @adegeo Migrated the details to this one.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.


Internal previews

📄 File 🔗 Preview link
docs/core/tools/enable-tab-autocomplete.md How to enable tab completion for the .NET CLI

Copilot AI changed the title [WIP] Add information on using the native shell completions in .NET 10+ Add .NET 10+ native shell completion documentation Nov 14, 2025
Copilot AI requested a review from meaghanlewis November 14, 2025 20:22
Copilot finished work on behalf of meaghanlewis November 14, 2025 20:22
@meaghanlewis meaghanlewis marked this pull request as ready for review November 14, 2025 23:53
@meaghanlewis meaghanlewis requested a review from a team as a code owner November 14, 2025 23:53
Copilot AI review requested due to automatic review settings November 14, 2025 23:53
Copilot finished reviewing on behalf of meaghanlewis November 14, 2025 23:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive documentation for .NET 10's new native shell completion scripts, which provide significantly faster tab completion compared to the previous dynamic completion method.

Key Changes

  • Documents the new dotnet completions generate [SHELL] command with shell-specific configuration examples for PowerShell, Bash, Zsh, Fish, and Nushell.
  • Adds a capability matrix showing completion types (hybrid vs dynamic) and description support per shell.
  • Reorganizes existing dynamic completion content into a separate section for backward compatibility with pre-.NET 10 versions.

@meaghanlewis meaghanlewis merged commit b3f2830 into main Nov 15, 2025
11 checks passed
@meaghanlewis meaghanlewis deleted the copilot/add-shell-completion-info branch November 15, 2025 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants