dotnet root command and dotnet watch#52583
Merged
tmat merged 6 commits intodotnet:release/10.0.3xxfrom Jan 28, 2026
Merged
Conversation
This was referenced Jan 23, 2026
Member
Author
|
@MiYanni ptal |
Member
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This was referenced Jan 23, 2026
MiYanni
approved these changes
Jan 24, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the .NET CLI's command-line parsing infrastructure to improve consistency and reduce dependencies. It introduces a new DotNetCommandDefinition class that serves as the root command definition, migrates all subcommand parsers from a GetCommand() pattern to a ConfigureCommand() pattern, creates new command definitions for nuget and completions commands, and removes the dotnet-watch tool's dependency on the main dotnet project. This significantly reduces the size of dotnet-watch from 390 files (43MB) to 206 files (26MB).
Changes:
- Introduced
DotNetCommandDefinitionas a centralized root command definition containing all subcommands - Refactored all command parsers from a static
GetCommand()pattern to instance-basedConfigureCommand()methods - Created new command definition classes for
nugetandcompletionscommands with proper structure
Reviewed changes
Copilot reviewed 92 out of 92 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Cli/Microsoft.DotNet.Cli.Definitions/Commands/DotNetCommandDefinition.cs | New root command definition containing all dotnet subcommands |
| src/Cli/Microsoft.DotNet.Cli.Definitions/Commands/NuGet/NuGetCommandDefinition.cs | New structured definition for nuget command and all subcommands |
| src/System.CommandLine.StaticCompletions/CompletionsCommandDefinition.cs | New completions command definition |
| src/System.CommandLine.StaticCompletions/CompletionsCommandParser.cs | Parser for completions with shell provider dictionary |
| src/System.CommandLine.StaticCompletions/ShellName.cs | Constants for shell names (bash, pwsh, fish, zsh, nushell) |
| src/Cli/dotnet/Parser.cs | Refactored to use new command definition pattern |
| src/Cli/dotnet/Commands/*CommandParser.cs | All parsers changed from GetCommand() to ConfigureCommand() |
| src/System.CommandLine.StaticCompletions/shells/*ShellProvider.cs | Updated to use ShellNames constants; PowershellShellProvider renamed to PowerShellShellProvider |
| src/BuiltInTools/dotnet-watch/dotnet-watch.csproj | Removed dependency on dotnet project, added dependency on Cli.Definitions |
| src/BuiltInTools/dotnet-watch/CommandLine/CommandLineOptions.cs | Updated to instantiate DotNetCommandDefinition directly |
| test/dotnet.Tests/CompletionTests/snapshots/* | Updated completion snapshots reflecting option ordering changes |
| src/Cli/dotnet/xlf/*.xlf | Removed SDKSchemaCommandDefinition translations (moved to Definitions) |
| src/Cli/Microsoft.DotNet.Cli.Definitions/xlf/*.xlf | Added SDKSchemaCommandDefinition translations |
| src/Cli/dotnet/CliStrings.resx | Removed SDKSchemaCommandDefinition resource |
| src/Cli/Microsoft.DotNet.Cli.Definitions/CommandDefinitionStrings.resx | Added SDKSchemaCommandDefinition resource |
Member
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/ba-g SSL |
This was referenced Feb 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
DotnetCommandDefinition.Refactor
nugetandcompletionscommands to follow the established command definition pattern.Remove dependency on
dotnetfromdotnet-watch. Decreases the number of files in dotnet-watch redist dir from 390 down to 206 and size from 43MB to 26MB.