From be6993a64aa045c2ddd6bd16caf79f75e623ac4b Mon Sep 17 00:00:00 2001 From: Andy Carlson <2yinyang2@gmail.com> Date: Thu, 28 May 2026 21:07:38 -0700 Subject: [PATCH 1/2] add spec and generator for dotnet command --- command-signatures/json/dotnet.json | 2145 ++++++++++++++++++++-- command-signatures/src/generators/mod.rs | 2 + 2 files changed, 2019 insertions(+), 128 deletions(-) diff --git a/command-signatures/json/dotnet.json b/command-signatures/json/dotnet.json index 77d0d4d3..3465dfe5 100644 --- a/command-signatures/json/dotnet.json +++ b/command-signatures/json/dotnet.json @@ -1,215 +1,2104 @@ { "name": "dotnet", - "description": "The dotnet cli", - "icon": "https://upload.wikimedia.org/wikipedia/commons/a/a3/.NET_Logo.svg", + "description": "The .NET command-line interface", "args": { "name": "command", "isOptional": true, - "generators": { - "template": "filepaths", - "filterTemplateSuggestions": "_NuFrRa_(u=[])=>{let f=u.filter(({name:l=\"\",type:T})=>{if(o!==\"filter\"&&T===\"folder\")return o===\"always\";if(d.has(l)||i&&new RegExp(i.source,i.flags).test(l))return!0;let[,...h]=l.split(\".\");if(h.length>=1){let g=h.length-1,y=h[g];do{if(c.has(y))return!0;g-=1,y=[h[g],y].join(\".\")}while(g>=0)}return!1});return!a&&!r?f:f.map(l=>Object.assign(Object.assign({},l),(l.type===\"file\"?a:r)||{}))}" - } + "isVariadic": true, + "generatorName": "global_tools", + "template": "filepaths", + "filterTemplateName": "filter-dll-files" }, "options": [ { - "name": "--version", - "description": "Prints out the version of the .NET SDK used by dotnet commands. Includes the effects of any global.json" - }, - { - "name": "--info", - "description": "Prints out detailed information about a .NET installation and the machine environment, such as the current operating system, and commit SHA of the .NET version" - }, - { - "name": "--list-runtimes", - "description": "Prints out a list of the installed .NET runtimes. An x86 version of the SDK lists only x86 runtimes, and an x64 version of the SDK lists only x64 runtimes" - }, - { - "name": "--list-sdks", - "description": "Prints out a list of the installed .NET SDKs" - }, - { - "name": [ - "-?", - "-h", - "--help" - ], - "description": "Prints out a list of available commands" + "name": "--additional-deps", + "description": "Path to additional deps.json" }, { - "name": [ - "-d", - "--diagnostics" - ], - "description": "Enables diagnostic output" + "name": "--additionalprobingpath", + "description": "Path containing probing policy and assemblies to probe" }, { - "name": [ - "-v", - "--verbosity" - ], - "description": "Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. Not supported in every command. See specific command page to determine if this option is available", - "args": { - "name": "verbosity", - "suggestions": [ - "quiet", - "minimal", - "normal", - "detailed", - "diagnostic" - ] - } + "name": "--depsfile", + "description": "Path to deps.json" }, { - "name": "--additionalprobingpath", - "description": "Path containing probing policy and assemblies to probe", - "args": { - "name": "path", - "template": "folders" - } + "name": "--fx-version", + "description": "Version of the .NET runtime to use" }, { - "name": "--additional-deps", - "description": "Path to an additional .deps.json file. A deps.json file contains a list of dependencies, compilation dependencies, and version information used to address assembly conflicts. For more information, see Runtime Configuration Files on GitHub", - "args": { - "name": "deps", - "template": "filepaths" - } + "name": "--info", + "description": "Display .NET information" }, { - "name": "--depsfile", - "description": "Path to the deps.json file. A deps.json file is a configuration file that contains information about dependencies necessary to run the application. This file is generated by the .NET SDK", - "args": { - "name": "deps", - "template": "filepaths" - } + "name": "--list-runtimes", + "description": "Display the installed runtimes" }, { - "name": "--runtimeconfig", - "description": "Path to a runtimeconfig.json file. A runtimeconfig.json file is a configuration file that contains run-time settings", - "args": { - "name": "path", - "template": "filepaths" - } + "name": "--list-sdks", + "description": "Display the installed SDKs" }, { "name": "--roll-forward", - "description": "Controls how roll forward is applied to the app. The SETTING can be one of the following values. If not specified, Minor is the default", + "description": "Roll forward to framework version", "args": { - "name": "setting", + "name": "value", "suggestions": [ "LatestPatch", "Minor", - "Major", "LatestMinor", + "Major", "LatestMajor", "Disable" ] } }, { - "name": "--fx-version", - "description": "Version of the .NET runtime to use to run the application", - "args": { - "name": "version" - } - } - ], - "subcommands": [ - { - "name": "new", - "loadSpec": "dotnet/dotnet-new", - "icon": "https://upload.wikimedia.org/wikipedia/commons/a/a3/.NET_Logo.svg" + "name": "--runtimeconfig", + "description": "Path to runtimeconfig.json" }, { - "name": "add", - "loadSpec": "dotnet/dotnet-add", - "icon": "https://upload.wikimedia.org/wikipedia/commons/a/a3/.NET_Logo.svg" + "name": "--version", + "description": "Display .NET SDK version" }, { - "name": "list", - "loadSpec": "dotnet/dotnet-list", - "icon": "https://upload.wikimedia.org/wikipedia/commons/a/a3/.NET_Logo.svg" + "name": [ + "-d", + "--diagnostics" + ], + "description": "Enable diagnostic output" }, { - "name": "remove", - "loadSpec": "dotnet/dotnet-remove", - "icon": "https://upload.wikimedia.org/wikipedia/commons/a/a3/.NET_Logo.svg" + "name": [ + "-h", + "--help" + ], + "description": "Show help" + } + ], + "subcommands": [ + { + "name": "add", + "description": "Add a package/reference", + "subcommands": [ + { + "name": "package", + "description": "Add a NuGet package reference", + "options": [ + { + "name": "--interactive", + "description": "Allow interactive input/action" + }, + { + "name": "--package-directory", + "description": "Directory to restore packages" + }, + { + "name": "--prerelease", + "description": "Allow prerelease packages to be installed" + }, + { + "name": [ + "-f", + "--framework" + ], + "description": "Add the reference only when targeting a specific framework", + "args": { + "name": "value" + } + }, + { + "name": [ + "-n", + "--no-restore" + ], + "description": "Add the reference without performing restore preview and compatibility check" + }, + { + "name": [ + "-s", + "--source" + ], + "description": "NuGet package source to use during the restore" + }, + { + "name": [ + "-v", + "--version" + ], + "description": "Version of the package to add", + "args": { + "name": "value" + } + } + ] + }, + { + "name": "reference", + "description": "Add a P2P reference", + "options": [ + { + "name": "--interactive", + "description": "Allow interactive input/action" + }, + { + "name": [ + "-f", + "--framework" + ], + "description": "Add the reference only when targeting a specific framework", + "args": { + "name": "value" + } + } + ] + } + ] }, { "name": "build", - "loadSpec": "dotnet/dotnet-build", - "icon": "https://upload.wikimedia.org/wikipedia/commons/a/a3/.NET_Logo.svg" + "description": "Build a .NET project", + "options": [ + { + "name": "--force", + "description": "Force all dependencies to be resolved" + }, + { + "name": "--interactive", + "description": "Allow interactive input/action" + }, + { + "name": "--no-dependencies", + "description": "Don't build P2P references" + }, + { + "name": "--no-incremental", + "description": "Don't use incremental building" + }, + { + "name": "--no-restore", + "description": "Don't restore the project before building" + }, + { + "name": "--nologo", + "description": "Don't display the startup banner or the copyright message" + }, + { + "name": "--version-suffix", + "description": "Set the value of the \\$(VersionSuffix) property to use", + "args": { + "name": "value" + } + }, + { + "name": [ + "-c", + "--configuration" + ], + "description": "Configuration to use", + "args": { + "name": "value", + "suggestions": [ + "Debug", + "Release" + ] + } + }, + { + "name": [ + "-f", + "--framework" + ], + "description": "Target framework to build", + "args": { + "name": "value" + } + }, + { + "name": [ + "-o", + "--output" + ], + "description": "Output directory to place built artifacts" + }, + { + "name": [ + "-r", + "--runtime" + ], + "description": "Target runtime to build", + "args": { + "name": "value" + } + }, + { + "name": [ + "-v", + "--verbosity" + ], + "description": "Set the MSBuild verbosity level", + "args": { + "name": "value", + "suggestions": [ + "q", + "quiet", + "m", + "minimal", + "n", + "normal", + "d", + "detailed", + "diag", + "diagnostic" + ] + } + } + ] }, { "name": "build-server", - "loadSpec": "dotnet/dotnet-build-server", - "icon": "https://upload.wikimedia.org/wikipedia/commons/a/a3/.NET_Logo.svg" + "description": "Interact with build servers", + "subcommands": [ + { + "name": "shutdown", + "description": "Shutdown build servers", + "options": [ + { + "name": "--msbuild", + "description": "Shutdown the MSBuild build server" + }, + { + "name": "--razor", + "description": "Shutdown the Razor build server" + }, + { + "name": "--vbcscompiler", + "description": "Shutdown the VB/C# compiler build server" + } + ] + } + ] }, { "name": "clean", - "loadSpec": "dotnet/dotnet-clean", - "icon": "https://upload.wikimedia.org/wikipedia/commons/a/a3/.NET_Logo.svg" + "description": "Clean build outputs", + "options": [ + { + "name": "--interactive", + "description": "Allow interactive input/action" + }, + { + "name": "--nologo", + "description": "Don't display the startup banner or the copyright message" + }, + { + "name": [ + "-c", + "--configuration" + ], + "description": "Configuration to clean", + "args": { + "name": "value", + "suggestions": [ + "Debug", + "Release" + ] + } + }, + { + "name": [ + "-f", + "--framework" + ], + "description": "Target framework to clean", + "args": { + "name": "value" + } + }, + { + "name": [ + "-o", + "--output" + ], + "description": "Directory containing the build artifacts to clean" + }, + { + "name": [ + "-r", + "--runtime" + ], + "description": "Target runtime to clean", + "args": { + "name": "value" + } + }, + { + "name": [ + "-v", + "--verbosity" + ], + "description": "Set the MSBuild verbosity level", + "args": { + "name": "value", + "suggestions": [ + "q", + "quiet", + "m", + "minimal", + "n", + "normal", + "d", + "detailed", + "diag", + "diagnostic" + ] + } + } + ] }, { "name": "format", - "loadSpec": "dotnet/dotnet-format", - "icon": "https://upload.wikimedia.org/wikipedia/commons/a/a3/.NET_Logo.svg" + "description": "Format code to match editorconfig settings" + }, + { + "name": "help", + "description": "Show help" + }, + { + "name": "list", + "description": "List project references", + "subcommands": [ + { + "name": "package", + "description": "List all package references", + "options": [ + { + "name": "--config", + "description": "Path to the NuGet config file to use" + }, + { + "name": "--deprecated", + "description": "List packages that have been deprecated" + }, + { + "name": "--framework", + "description": "Choose a framework to show its packages", + "args": { + "name": "value" + } + }, + { + "name": "--highest-minor", + "description": "Consider only the packages with a matching major version number" + }, + { + "name": "--highest-patch", + "description": "Consider only the packages with a matching major and minor version numbers" + }, + { + "name": "--include-prerelease", + "description": "Consider packages with prerelease versions" + }, + { + "name": "--include-transitive", + "description": "List transitive and top-level packages" + }, + { + "name": "--interactive", + "description": "Allow interactive input/action" + }, + { + "name": "--outdated", + "description": "List packages that have newer versions" + }, + { + "name": "--source", + "description": "NuGet sources to use" + }, + { + "name": [ + "-v", + "--verbosity" + ], + "description": "Set the MSBuild verbosity level", + "args": { + "name": "value", + "suggestions": [ + "q", + "quiet", + "m", + "minimal", + "n", + "normal", + "d", + "detailed", + "diag", + "diagnostic" + ] + } + } + ] + }, + { + "name": "reference", + "description": "List all P2P references" + } + ] }, { "name": "migrate", - "loadSpec": "dotnet/dotnet-migrate", - "icon": "https://upload.wikimedia.org/wikipedia/commons/a/a3/.NET_Logo.svg" + "description": "Migrate a project.json project to an MSBuild project" }, { "name": "msbuild", - "loadSpec": "dotnet/dotnet-msbuild", - "icon": "https://upload.wikimedia.org/wikipedia/commons/a/a3/.NET_Logo.svg" + "description": "Run MSBuild commands" + }, + { + "name": "new", + "description": "Create a new .NET project", + "options": [ + { + "name": "--dry-run", + "description": "Dry run" + }, + { + "name": "--force", + "description": "Force content to be generated" + }, + { + "name": "--interactive", + "description": "Allow interactive input/action" + }, + { + "name": "--nuget-source", + "description": "Specify a NuGet source to use during install" + }, + { + "name": "--type", + "description": "Filter templates based on available types", + "args": { + "name": "value", + "suggestions": [ + "project", + "item" + ] + } + }, + { + "name": "--update-apply", + "description": "Check the currently installed template packs for updates and installs them" + }, + { + "name": "--update-check", + "description": "Check the currently installed template packs for updates" + }, + { + "name": [ + "-i", + "--install" + ], + "description": "Install a template pack" + }, + { + "name": [ + "-l", + "--list" + ], + "description": "List templates containing the specified name" + }, + { + "name": [ + "-lang", + "--language" + ], + "description": "Language of the template to create", + "args": { + "name": "value", + "suggestions": [ + "C#", + "F#", + "VB" + ] + } + }, + { + "name": [ + "-n", + "--name" + ], + "description": "Name for the output being created" + }, + { + "name": [ + "-o", + "--output" + ], + "description": "Location to place the generated output" + }, + { + "name": [ + "-u", + "--uninstall" + ], + "description": "Uninstall a template pack" + } + ] }, { "name": "nuget", - "loadSpec": "dotnet/dotnet-nuget", - "icon": "https://upload.wikimedia.org/wikipedia/commons/a/a3/.NET_Logo.svg" + "description": "Run additional NuGet commands", + "subcommands": [ + { + "name": "add", + "description": "Add a NuGet source", + "subcommands": [ + { + "name": "client-cert", + "description": "Add a client certificate configuration", + "options": [ + { + "name": "--configfile", + "description": "NuGet configuration file" + }, + { + "name": "--find-by", + "description": "Search method to find certificate in certificate store" + }, + { + "name": "--find-value", + "description": "Search the certificate store for the supplied value" + }, + { + "name": "--password", + "description": "Password for the certificate", + "args": { + "name": "value" + } + }, + { + "name": "--path", + "description": "Path to certificate file" + }, + { + "name": "--store-location", + "description": "Certificate store location" + }, + { + "name": "--store-name", + "description": "Certificate store name" + }, + { + "name": "--store-password-in-clear-text", + "description": "Enable storing password for the certificate" + }, + { + "name": [ + "-f", + "--force" + ], + "description": "Skip certificate validation" + }, + { + "name": [ + "-s", + "--package-source" + ], + "description": "Package source name" + } + ] + }, + { + "name": "source", + "description": "Add a NuGet source", + "options": [ + { + "name": "--configfile", + "description": "NuGet configuration file" + }, + { + "name": "--store-password-in-clear-text", + "description": "Enable storing portable package source credentials" + }, + { + "name": "--valid-authentication-types", + "description": "Comma-separated list of valid authentication types" + }, + { + "name": [ + "-n", + "--name" + ], + "description": "Name of the source" + }, + { + "name": [ + "-p", + "--password" + ], + "description": "Password to be used", + "args": { + "name": "value" + } + }, + { + "name": [ + "-u", + "--username" + ], + "description": "Username to be used", + "args": { + "name": "value" + } + } + ] + } + ] + }, + { + "name": "delete", + "description": "Delete a package from the server", + "options": [ + { + "name": "--force-english-output", + "description": "Run the application with locale set to English" + }, + { + "name": "--interactive", + "description": "Allow interactive input/action" + }, + { + "name": "--no-service-endpoint", + "description": "Doesn't append \"api/v2/package\" to the source URL" + }, + { + "name": "--non-interactive", + "description": "Don't prompt for user input or confirmations" + }, + { + "name": [ + "-k", + "--api-key" + ], + "description": "API key for the server", + "args": { + "name": "value" + } + }, + { + "name": [ + "-s", + "--source" + ], + "description": "Package source to use" + } + ] + }, + { + "name": "disable", + "description": "Disable a NuGet source", + "subcommands": [ + { + "name": "source", + "description": "Disable a NuGet source", + "options": [ + { + "name": "--configfile", + "description": "NuGet configuration file" + } + ] + } + ] + }, + { + "name": "enable", + "description": "Enable a NuGet source", + "subcommands": [ + { + "name": "source", + "description": "Enable a NuGet source", + "options": [ + { + "name": "--configfile", + "description": "NuGet configuration file" + } + ] + } + ] + }, + { + "name": "list", + "description": "List configured NuGet sources", + "subcommands": [ + { + "name": "client-cert", + "description": "List all the client certificates in the configuration", + "options": [ + { + "name": "--configfile", + "description": "NuGet configuration file" + } + ] + }, + { + "name": "source", + "description": "List all configured NuGet sources", + "options": [ + { + "name": "--configfile", + "description": "NuGet configuration file" + }, + { + "name": "--format", + "description": "Format of the list command output", + "args": { + "name": "value" + } + } + ] + } + ] + }, + { + "name": "locals", + "description": "Clear/List local NuGet resources", + "options": [ + { + "name": "--force-english-output", + "description": "Run the application with locale set to English" + }, + { + "name": [ + "-c", + "--clear" + ], + "description": "Clear the selected local resources or cache location" + }, + { + "name": [ + "-l", + "--list" + ], + "description": "List the selected local resources or cache location" + } + ] + }, + { + "name": "push", + "description": "Push a package to the server", + "options": [ + { + "name": "--force-english-output", + "description": "Run the application with locale set to English" + }, + { + "name": "--interactive", + "description": "Allow interactive input/action" + }, + { + "name": "--no-service-endpoint", + "description": "Doesn't append \"api/v2/package\" to the source URL" + }, + { + "name": "--skip-duplicate", + "description": "Treat any 409 Conflict response as a warning" + }, + { + "name": [ + "-d", + "--disable-buffering" + ], + "description": "Disable buffering when pushing to an HTTP server" + }, + { + "name": [ + "-k", + "--api-key" + ], + "description": "API key for the server", + "args": { + "name": "value" + } + }, + { + "name": [ + "-n", + "--no-symbols" + ], + "description": "Doesn't push symbols" + }, + { + "name": [ + "-s", + "--source" + ], + "description": "Package source to use" + }, + { + "name": [ + "-sk", + "--symbol-api-key" + ], + "description": "API key for the symbol server", + "args": { + "name": "value" + } + }, + { + "name": [ + "-ss", + "--symbol-source" + ], + "description": "Symbol server URL to use" + }, + { + "name": [ + "-t", + "--timeout" + ], + "description": "Timeout for pushing to a server", + "args": { + "name": "value" + } + } + ] + }, + { + "name": "remove", + "description": "Remove a NuGet source", + "subcommands": [ + { + "name": "client-cert", + "description": "Remove the client certificate configuration", + "options": [ + { + "name": "--configfile", + "description": "NuGet configuration file" + }, + { + "name": [ + "-s", + "--package-source" + ], + "description": "Package source name" + } + ] + }, + { + "name": "source", + "description": "Remove a NuGet source", + "options": [ + { + "name": "--configfile", + "description": "NuGet configuration file" + } + ] + } + ] + }, + { + "name": "update", + "description": "Update a NuGet source", + "subcommands": [ + { + "name": "client-cert", + "description": "Update the client certificate configuration", + "options": [ + { + "name": "--configfile", + "description": "NuGet configuration file" + }, + { + "name": "--find-by", + "description": "Search method to find certificate in certificate store" + }, + { + "name": "--find-value", + "description": "Search the certificate store for the supplied value" + }, + { + "name": "--password", + "description": "Password for the certificate", + "args": { + "name": "value" + } + }, + { + "name": "--path", + "description": "Path to certificate file" + }, + { + "name": "--store-location", + "description": "Certificate store location" + }, + { + "name": "--store-name", + "description": "Certificate store name" + }, + { + "name": "--store-password-in-clear-text", + "description": "Enable storing password for the certificate" + }, + { + "name": [ + "-f", + "--force" + ], + "description": "Skip certificate validation" + }, + { + "name": [ + "-s", + "--package-source" + ], + "description": "Package source name" + } + ] + }, + { + "name": "source", + "description": "Update a NuGet source", + "options": [ + { + "name": "--configfile", + "description": "NuGet configuration file" + }, + { + "name": "--store-password-in-clear-text", + "description": "Enable storing portable package source credentials" + }, + { + "name": "--valid-authentication-types", + "description": "Comma-separated list of valid authentication types" + }, + { + "name": [ + "-p", + "--password" + ], + "description": "Password to be used", + "args": { + "name": "value" + } + }, + { + "name": [ + "-s", + "--source" + ], + "description": "Path to the package source" + }, + { + "name": [ + "-u", + "--username" + ], + "description": "Username to be used", + "args": { + "name": "value" + } + } + ] + } + ] + }, + { + "name": "verify", + "description": "Verify a signed NuGet package", + "options": [ + { + "name": "--all", + "description": "Specify that all verifications possible should be performed" + }, + { + "name": "--certificate-fingerprint", + "description": "Verify that the certificate matches with the fingerprints", + "args": { + "name": "value" + } + }, + { + "name": [ + "-v", + "--verbosity" + ], + "description": "Set the verbosity level", + "args": { + "name": "value", + "suggestions": [ + "q", + "quiet", + "m", + "minimal", + "n", + "normal", + "d", + "detailed", + "diag", + "diagnostic" + ] + } + } + ] + } + ], + "options": [ + { + "name": "--version", + "description": "Show version" + } + ] }, { "name": "pack", - "loadSpec": "dotnet/dotnet-pack", - "icon": "https://upload.wikimedia.org/wikipedia/commons/a/a3/.NET_Logo.svg" + "description": "Create a NuGet package", + "options": [ + { + "name": "--force", + "description": "Force all dependencies to be resolved" + }, + { + "name": "--include-source", + "description": "Include PDBs and source files" + }, + { + "name": "--include-symbols", + "description": "Include packages with symbols in output directory" + }, + { + "name": "--interactive", + "description": "Allow interactive input/action" + }, + { + "name": "--no-build", + "description": "Don't build the project before packing" + }, + { + "name": "--no-dependencies", + "description": "Don't build P2P references" + }, + { + "name": "--no-restore", + "description": "Don't restore the project before building" + }, + { + "name": "--nologo", + "description": "Don't display the startup banner or the copyright message" + }, + { + "name": "--runtime", + "description": "Target runtime to restore packages", + "args": { + "name": "value" + } + }, + { + "name": "--version-suffix", + "description": "Set the value of the \\$(VersionSuffix) property to use", + "args": { + "name": "value" + } + }, + { + "name": [ + "-c", + "--configuration" + ], + "description": "Configuration to use", + "args": { + "name": "value", + "suggestions": [ + "Debug", + "Release" + ] + } + }, + { + "name": [ + "-o", + "--output" + ], + "description": "Output directory to place built packages" + }, + { + "name": [ + "-s", + "--serviceable" + ], + "description": "Set the serviceable flag in the package" + }, + { + "name": [ + "-v", + "--verbosity" + ], + "description": "Set the MSBuild verbosity level", + "args": { + "name": "value", + "suggestions": [ + "q", + "quiet", + "m", + "minimal", + "n", + "normal", + "d", + "detailed", + "diag", + "diagnostic" + ] + } + } + ] }, { "name": "publish", - "loadSpec": "dotnet/dotnet-publish", - "icon": "https://upload.wikimedia.org/wikipedia/commons/a/a3/.NET_Logo.svg" + "description": "Publish a .NET project for deployment", + "options": [ + { + "name": "--force", + "description": "Force all dependencies to be resolved" + }, + { + "name": "--interactive", + "description": "Allow interactive input/action" + }, + { + "name": "--manifest", + "description": "Path to a target manifest file" + }, + { + "name": "--no-build", + "description": "Don't build the project before publishing" + }, + { + "name": "--no-dependencies", + "description": "Don't restore P2P references" + }, + { + "name": "--no-restore", + "description": "Don't restore the project before building" + }, + { + "name": "--no-self-contained", + "description": "Publish your application as a framework dependent application" + }, + { + "name": "--nologo", + "description": "Don't display the startup banner or the copyright message" + }, + { + "name": "--self-contained", + "description": "Publish the .NET runtime with your application", + "args": { + "name": "value" + } + }, + { + "name": "--version-suffix", + "description": "Set the value of the \\$(VersionSuffix) property to use", + "args": { + "name": "value" + } + }, + { + "name": [ + "-c", + "--configuration" + ], + "description": "Configuration to publish", + "args": { + "name": "value", + "suggestions": [ + "Debug", + "Release" + ] + } + }, + { + "name": [ + "-f", + "--framework" + ], + "description": "Target framework to publish", + "args": { + "name": "value" + } + }, + { + "name": [ + "-o", + "--output" + ], + "description": "Output directory to place the published artifacts" + }, + { + "name": [ + "-r", + "--runtime" + ], + "description": "Target runtime to publish", + "args": { + "name": "value" + } + }, + { + "name": [ + "-v", + "--verbosity" + ], + "description": "Set the MSBuild verbosity level", + "args": { + "name": "value", + "suggestions": [ + "q", + "quiet", + "m", + "minimal", + "n", + "normal", + "d", + "detailed", + "diag", + "diagnostic" + ] + } + } + ] + }, + { + "name": "remove", + "description": "Remove a package/reference", + "subcommands": [ + { + "name": "package", + "description": "Remove a NuGet package reference", + "options": [ + { + "name": "--interactive", + "description": "Allow interactive input/action" + } + ] + }, + { + "name": "reference", + "description": "Remove a P2P reference", + "options": [ + { + "name": [ + "-f", + "--framework" + ], + "description": "Remove the reference only when targeting a specific framework", + "args": { + "name": "value" + } + } + ] + } + ] }, { "name": "restore", - "loadSpec": "dotnet/dotnet-restore", - "icon": "https://upload.wikimedia.org/wikipedia/commons/a/a3/.NET_Logo.svg" + "description": "Restore dependencies", + "options": [ + { + "name": "--configfile", + "description": "NuGet configuration file to use" + }, + { + "name": "--disable-parallel", + "description": "Prevent restoring multiple projects in parallel" + }, + { + "name": "--force-evaluate", + "description": "Force restore to reevaluate all dependencies" + }, + { + "name": "--ignore-failed-sources", + "description": "Treat package source failures as warnings" + }, + { + "name": "--interactive", + "description": "Allow interactive input/action" + }, + { + "name": "--lock-file-path", + "description": "Output location where project lock file is written" + }, + { + "name": "--locked-mode", + "description": "Don't allow updating project lock file" + }, + { + "name": "--no-cache", + "description": "Don't cache packages and HTTP requests" + }, + { + "name": "--no-dependencies", + "description": "Don't restore P2P references" + }, + { + "name": "--packages", + "description": "Directory to restore packages" + }, + { + "name": "--use-lock-file", + "description": "Enable project lock file to be generated" + }, + { + "name": [ + "-f", + "--force" + ], + "description": "Force all dependencies to be resolved" + }, + { + "name": [ + "-r", + "--runtime" + ], + "description": "Target runtime to restore packages", + "args": { + "name": "value" + } + }, + { + "name": [ + "-s", + "--source" + ], + "description": "NuGet package source to use for the restore" + }, + { + "name": [ + "-v", + "--verbosity" + ], + "description": "Set the MSBuild verbosity level", + "args": { + "name": "value", + "suggestions": [ + "q", + "quiet", + "m", + "minimal", + "n", + "normal", + "d", + "detailed", + "diag", + "diagnostic" + ] + } + } + ] }, { "name": "run", - "loadSpec": "dotnet/dotnet-run", - "icon": "https://upload.wikimedia.org/wikipedia/commons/a/a3/.NET_Logo.svg" + "description": "Run the application from source", + "options": [ + { + "name": "--force", + "description": "Force all dependencies to be resolved" + }, + { + "name": "--interactive", + "description": "Allow interactive input/action" + }, + { + "name": "--launch-profile", + "description": "Name of the launch profile to use", + "args": { + "name": "value" + } + }, + { + "name": "--no-build", + "description": "Don't build the project before running" + }, + { + "name": "--no-dependencies", + "description": "Don't restore P2P references" + }, + { + "name": "--no-launch-profile", + "description": "Don't attempt to use launchSettings.json" + }, + { + "name": "--no-restore", + "description": "Don't restore the project before building" + }, + { + "name": [ + "-c", + "--configuration" + ], + "description": "Configuration to run", + "args": { + "name": "value", + "suggestions": [ + "Debug", + "Release" + ] + } + }, + { + "name": [ + "-f", + "--framework" + ], + "description": "Target framework to run", + "args": { + "name": "value" + } + }, + { + "name": [ + "-p", + "--project" + ], + "description": "Path to the project file to run" + }, + { + "name": [ + "-r", + "--runtime" + ], + "description": "Target runtime to run", + "args": { + "name": "value" + } + }, + { + "name": [ + "-v", + "--verbosity" + ], + "description": "Set the MSBuild verbosity level", + "args": { + "name": "value", + "suggestions": [ + "q", + "quiet", + "m", + "minimal", + "n", + "normal", + "d", + "detailed", + "diag", + "diagnostic" + ] + } + } + ] }, { "name": "sln", - "loadSpec": "dotnet/dotnet-sln", - "icon": "https://upload.wikimedia.org/wikipedia/commons/a/a3/.NET_Logo.svg" + "description": "Modify Visual Studio solution files", + "subcommands": [ + { + "name": "add", + "description": "Add one/more projects to a solution file", + "options": [ + { + "name": "--in-root", + "description": "Place project in root of the solution" + }, + { + "name": [ + "-s", + "--solution-folder" + ], + "description": "Destination solution folder path to add the projects" + } + ] + }, + { + "name": "list", + "description": "List all projects in a solution file" + }, + { + "name": "remove", + "description": "Remove one/more projects from a solution file" + } + ] }, { "name": "store", - "loadSpec": "dotnet/dotnet-store", - "icon": "https://upload.wikimedia.org/wikipedia/commons/a/a3/.NET_Logo.svg" + "description": "Store assemblies", + "options": [ + { + "name": "--framework-version", + "description": "Specify the .NET SDK version", + "args": { + "name": "value" + } + }, + { + "name": "--skip-optimization", + "description": "Skip the optimization phase" + }, + { + "name": "--skip-symbols", + "description": "Skip creating symbol files" + }, + { + "name": [ + "-f", + "--framework" + ], + "description": "Target framework to store packages", + "args": { + "name": "value" + } + }, + { + "name": [ + "-m", + "--manifest" + ], + "description": "XML file that contains the list of packages to be stored" + }, + { + "name": [ + "-o", + "--output" + ], + "description": "Output directory to store the given assemblies" + }, + { + "name": [ + "-r", + "--runtime" + ], + "description": "Target runtime to store packages", + "args": { + "name": "value" + } + }, + { + "name": [ + "-v", + "--verbosity" + ], + "description": "Set the MSBuild verbosity level", + "args": { + "name": "value", + "suggestions": [ + "q", + "quiet", + "m", + "minimal", + "n", + "normal", + "d", + "detailed", + "diag", + "diagnostic" + ] + } + }, + { + "name": [ + "-w", + "--working-dir" + ], + "description": "Working directory used by the command" + } + ] }, { "name": "test", - "loadSpec": "dotnet/dotnet-test", - "icon": "https://upload.wikimedia.org/wikipedia/commons/a/a3/.NET_Logo.svg" + "description": "Run unit tests", + "options": [ + { + "name": "--blame", + "description": "Run the tests in blame mode" + }, + { + "name": "--blame-crash", + "description": "Run the tests in blame mode and enables collecting crash dump" + }, + { + "name": "--blame-crash-collect-always", + "description": "Enable collecting crash dump on expected" + }, + { + "name": "--blame-crash-dump-type", + "description": "Type of crash dump to be collected", + "args": { + "name": "value" + } + }, + { + "name": "--blame-hang", + "description": "Run the tests in blame mode and enables collecting hang dump" + }, + { + "name": "--blame-hang-dump-type", + "description": "Type of crash dump to be collected", + "args": { + "name": "value" + } + }, + { + "name": "--blame-hang-timeout", + "description": "Per-test timeout", + "args": { + "name": "value" + } + }, + { + "name": "--collect", + "description": "Enable data collector for the test run", + "args": { + "name": "value" + } + }, + { + "name": "--filter", + "description": "Run tests that match the given expression", + "args": { + "name": "value" + } + }, + { + "name": "--interactive", + "description": "Allow interactive input/action" + }, + { + "name": "--no-build", + "description": "Don't build the project before testing" + }, + { + "name": "--no-restore", + "description": "Don't restore the project before building" + }, + { + "name": "--nologo", + "description": "Run tests without displaying the Microsoft TestPlatform banner" + }, + { + "name": "--runtime", + "description": "Target runtime to test", + "args": { + "name": "value" + } + }, + { + "name": [ + "-a", + "--test-adapter-path" + ], + "description": "Path to the custom adapters to use" + }, + { + "name": [ + "-c", + "--configuration" + ], + "description": "Configuration to use", + "args": { + "name": "value", + "suggestions": [ + "Debug", + "Release" + ] + } + }, + { + "name": [ + "-d", + "--diag" + ], + "description": "Enable verbose logging to the specified file" + }, + { + "name": [ + "-f", + "--framework" + ], + "description": "Target framework to run tests", + "args": { + "name": "value" + } + }, + { + "name": [ + "-l", + "--logger" + ], + "description": "Logger to use for test results", + "args": { + "name": "value" + } + }, + { + "name": [ + "-o", + "--output" + ], + "description": "Output directory to place built artifacts" + }, + { + "name": [ + "-r", + "--results-directory" + ], + "description": "Directory where the test results will be placed" + }, + { + "name": [ + "-s", + "--settings" + ], + "description": "Settings file to use" + }, + { + "name": [ + "-t", + "--list-tests" + ], + "description": "List the discovered tests" + }, + { + "name": [ + "-v", + "--verbosity" + ], + "description": "Set the MSBuild verbosity level", + "args": { + "name": "value", + "suggestions": [ + "q", + "quiet", + "m", + "minimal", + "n", + "normal", + "d", + "detailed", + "diag", + "diagnostic" + ] + } + } + ] }, { "name": "tool", - "loadSpec": "dotnet/dotnet-tool", - "icon": "https://upload.wikimedia.org/wikipedia/commons/a/a3/.NET_Logo.svg" + "description": "Manage .NET tools", + "subcommands": [ + { + "name": "install", + "description": "Install global/local tool", + "options": [ + { + "name": "--add-source", + "description": "Add an additional NuGet package source to use during installation" + }, + { + "name": "--configfile", + "description": "NuGet configuration file to use" + }, + { + "name": "--disable-parallel", + "description": "Prevent restoring multiple projects in parallel" + }, + { + "name": "--framework", + "description": "Target framework to install the tool", + "args": { + "name": "value" + } + }, + { + "name": "--ignore-failed-sources", + "description": "Treat package source failures as warnings" + }, + { + "name": "--interactive", + "description": "Allow interactive input/action" + }, + { + "name": "--local", + "description": "Specify a local tool installation" + }, + { + "name": "--no-cache", + "description": "Don't cache packages and HTTP requests" + }, + { + "name": "--tool-manifest", + "description": "Path to the manifest file" + }, + { + "name": "--tool-path", + "description": "Directory where the tool will be installed" + }, + { + "name": "--version", + "description": "Version of the tool to install", + "args": { + "name": "value" + } + }, + { + "name": [ + "-g", + "--global" + ], + "description": "Specify that the installation is user-wide" + }, + { + "name": [ + "-v", + "--verbosity" + ], + "description": "Set the MSBuild verbosity level", + "args": { + "name": "value", + "suggestions": [ + "q", + "quiet", + "m", + "minimal", + "n", + "normal", + "d", + "detailed", + "diag", + "diagnostic" + ] + } + } + ] + }, + { + "name": "list", + "description": "List tools installed globally/locally", + "options": [ + { + "name": "--local", + "description": "List local tools" + }, + { + "name": "--tool-path", + "description": "Directory containing the tools to list" + }, + { + "name": [ + "-g", + "--global" + ], + "description": "List user-wide global tools" + } + ] + }, + { + "name": "restore", + "description": "Restore tools defined in the local tool manifest", + "options": [ + { + "name": "--add-source", + "description": "Add an additional NuGet package source to use during installation" + }, + { + "name": "--configfile", + "description": "NuGet configuration file to use" + }, + { + "name": "--disable-parallel", + "description": "Prevent restoring multiple projects in parallel" + }, + { + "name": "--ignore-failed-sources", + "description": "Treat package source failures as warnings" + }, + { + "name": "--interactive", + "description": "Allow interactive input/action" + }, + { + "name": "--no-cache", + "description": "Don't cache packages and HTTP requests" + }, + { + "name": "--tool-manifest", + "description": "Path to the manifest file" + }, + { + "name": [ + "-v", + "--verbosity" + ], + "description": "Set the MSBuild verbosity level", + "args": { + "name": "value", + "suggestions": [ + "q", + "quiet", + "m", + "minimal", + "n", + "normal", + "d", + "detailed", + "diag", + "diagnostic" + ] + } + } + ] + }, + { + "name": "run", + "description": "Run local tool" + }, + { + "name": "search", + "description": "Search .NET tools in NuGet.org", + "options": [ + { + "name": "--detail", + "description": "Show detail result of the query" + }, + { + "name": "--prerelease", + "description": "Include pre-release packages" + }, + { + "name": "--skip", + "description": "Specify the number of query results to skip", + "args": { + "name": "value" + } + }, + { + "name": "--take", + "description": "Specify the number of query results to show", + "args": { + "name": "value" + } + } + ] + }, + { + "name": "uninstall", + "description": "Uninstall a global/local tool", + "options": [ + { + "name": "--local", + "description": "Specify that the tool to be removed is a local tool" + }, + { + "name": "--tool-manifest", + "description": "Path to the manifest file" + }, + { + "name": "--tool-path", + "description": "Directory containing the tool to uninstall" + }, + { + "name": [ + "-g", + "--global" + ], + "description": "Specify that the tool to be removed is from a user-wide installation" + } + ] + }, + { + "name": "update", + "description": "Update a global tool", + "options": [ + { + "name": "--add-source", + "description": "Add an additional NuGet package source to use during the update" + }, + { + "name": "--configfile", + "description": "NuGet configuration file to use" + }, + { + "name": "--disable-parallel", + "description": "Prevent restoring multiple projects in parallel" + }, + { + "name": "--framework", + "description": "Target framework to update the tool", + "args": { + "name": "value" + } + }, + { + "name": "--ignore-failed-sources", + "description": "Treat package source failures as warnings" + }, + { + "name": "--interactive", + "description": "Allow interactive input/action" + }, + { + "name": "--local", + "description": "Specify that the tool to be updated is a local tool" + }, + { + "name": "--no-cache", + "description": "Don't cache packages and HTTP requests" + }, + { + "name": "--tool-manifest", + "description": "Path to the manifest file" + }, + { + "name": "--tool-path", + "description": "Directory containing the tool to update" + }, + { + "name": "--version", + "description": "Version range of the tool package to update", + "args": { + "name": "value" + } + }, + { + "name": [ + "-g", + "--global" + ], + "description": "Specify that the update is for a user-wide tool" + }, + { + "name": [ + "-v", + "--verbosity" + ], + "description": "Set the MSBuild verbosity level", + "args": { + "name": "value", + "suggestions": [ + "q", + "quiet", + "m", + "minimal", + "n", + "normal", + "d", + "detailed", + "diag", + "diagnostic" + ] + } + } + ] + } + ] + }, + { + "name": "vstest", + "description": "Run VSTest commands" } - ], - "generateSpec": "_NuFrRa_generateSpec(e,t){return O(this,null,function*(){let n=/(([a-zA-Z \\.\\[\\]#,/][^ ]{1,})+)/g,i=[],a=(yield t(\"dotnet tool list --global\")).split(`\n`).slice(2);for(let r of a){let[c,d,u]=r.match(n).map(l=>l.trim()),f=u.split(\",\").map(l=>({name:l.replace(\"dotnet-\",\"\"),description:l,args:{name:\"args\",isOptional:!0}}));i.push(...f)}return{name:\"dotnet\",subcommands:i}})}" + ] } diff --git a/command-signatures/src/generators/mod.rs b/command-signatures/src/generators/mod.rs index c4874e0b..d197411b 100644 --- a/command-signatures/src/generators/mod.rs +++ b/command-signatures/src/generators/mod.rs @@ -23,6 +23,7 @@ mod defaults; mod dnf; mod docker; mod docker_compose; +mod dotnet; mod firebase; mod flutter; mod gh; @@ -86,6 +87,7 @@ pub fn dynamic_command_signature_data() -> HashMap Date: Thu, 28 May 2026 21:07:49 -0700 Subject: [PATCH 2/2] forgot to add the rust file --- command-signatures/src/generators/dotnet.rs | 42 +++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 command-signatures/src/generators/dotnet.rs diff --git a/command-signatures/src/generators/dotnet.rs b/command-signatures/src/generators/dotnet.rs new file mode 100644 index 00000000..99f32918 --- /dev/null +++ b/command-signatures/src/generators/dotnet.rs @@ -0,0 +1,42 @@ +use warp_completion_metadata::{ + CommandBuilder, CommandSignatureGenerators, Generator, GeneratorResultsCollector, Suggestion, + TemplateFilter, +}; + +pub fn generator() -> CommandSignatureGenerators { + CommandSignatureGenerators::new("dotnet") + .add_generator( + "global_tools", + Generator::script( + CommandBuilder::single_command_and_ignore_stderr("dotnet tool list --global"), + |output| { + output + .lines() + .skip(2) + .flat_map(|line| { + let columns = line.split_whitespace().collect::>(); + columns + .get(2..) + .unwrap_or_default() + .join(" ") + .split(',') + .map(str::trim) + .filter(|command| !command.is_empty()) + .map(|command| { + let name = command.strip_prefix("dotnet-").unwrap_or(command); + Suggestion::with_description(name, command) + }) + .collect::>() + }) + .collect_unordered_results() + }, + ), + ) + .add_filter( + "filter-dll-files", + TemplateFilter(|suggestion, path_type| { + (path_type.is_folder() || suggestion.exact_string.ends_with(".dll")) + .then_some(suggestion) + }), + ) +}