Infra, Ops & WorkflowSûr100100/100
add cli command dotnet dotnet
Add or change a dotnet CLI command, subcommand, or option across the relevant CLI projects. USE FOR: adding or changing a dotnet CLI command/subcommand, adding a new Option<T> or Argument<T>, registering a subcommand in the command tree, changing an option's help description or a command's runtime message, wiring a command parser, or updating --help output.
ou envoie-le directement à ton agent.
Installer dans ton projet
$ npx arboris-cli install add-cli-command__dotnet-dotnet__src-sdk-github-skills-9ab38984b9ddContenu à copier
---
name: add-cli-command
description: >
Add or change a dotnet CLI command, subcommand, or option across the relevant CLI projects.
USE FOR: adding or changing a dotnet CLI command/subcommand, adding a new
Option<T> or Argument<T>, registering a subcommand in the command tree, changing
an option's help description or a command's runtime message, wiring a command
parser, or updating --help output.
license: MIT
metadata:
origin: .NET
---
# Add or change a dotnet CLI command or option
See [`references/file-map.md`](references/file-map.md) for the exact file map and the
two-resx reference table. Read it before editing.
## Add an option to an existing command
1. **Declare** the option in
`src/Cli/Microsoft.DotNet.Cli.Definitions/Commands/<Area>/<Name>CommandDefinition.cs`.
Prefer a `CommonOptions` factory (`Common/CommonOptions.cs`) when one exists:
```csharp
public readonly Option<bool> NoLogoOption = CommonOptions.CreateNoLogoOption();
// or, declared inline:
public readonly Option<string> OutputOption = new Option<string>("--output", "-o")
{
Description = CommandDefinitionStrings.BuildOutputOptionDescription
};
```
Add it to the command in the constructor: `Options.Add(OutputOption);`.
2. **Consume** it in the managed implementation under
`src/Cli/dotnet/Commands/<Area>/...` via `definition.OutputOption`; runtime
messages come from `CliCommandStrings.<Key>`.
3. **Strings**: add the help description to `CommandDefinitionStrings.resx` and any
runtime message to `CliCommandStrings.resx`, then regenerate the `.xlf` siblings.
4. **Test**: add parser/validation tests under
`test/dotnet.Tests/CommandTests/<Area>/` and update any Verify help snapshots.
## Add a new command
Everything above, plus:
1. Create `Commands/<Area>/<Name>CommandDefinition.cs` in the Definitions project.
2. Register it in the root tree
(`Commands/DotNetCommandDefinition.cs` constructor):
```csharp
Subcommands.Add(<Name>Command = new());
```
3. Create the managed implementation and a `<Name>CommandParser.cs` exposing
`ConfigureCommand(...)` under `src/Cli/dotnet/Commands/<Name>/`.
4. Wire the parser in `src/Cli/dotnet/Parser.cs` `ConfigureManagedActions`:
```csharp
<Name>CommandParser.ConfigureCommand(rootCommand.<Name>Command);
```
> **Native AOT:** a newly registered command already *runs* under Native AOT via the
> managed fallback (the `dotnet-aot` host runs `dotnet.dll` through hostfxr), and its
> parsing and `--help` reach the AOT CLI for free. Making the command execute
> **in-process** in the native binary is separate, deliberate work — follow the
> **add-dotnet-aot-command** skill when AOT support is required.
## Checklist
- [ ] Option/command declared in `Definitions`, registered in its parent's constructor.
- [ ] Managed behavior wired in `src/Cli/dotnet` and (for new commands) in `Parser.cs`.
- [ ] Help description in `CommandDefinitionStrings.resx`; runtime message in `CliCommandStrings.resx`.
- [ ] `.xlf` files regenerated via `/t:UpdateXlf` (not hand-edited), resx + xlf committed together.
- [ ] No heavy dependency leaked into `Definitions`.
- [ ] For in-process AOT execution, followed **add-dotnet-aot-command** (managed fallback applies otherwise).
- [ ] Tests added/updated; Verify `*.verified.txt` snapshots promoted if CLI output changed.Colle ce Markdown dans ton agent ou utilise les boutons ci-dessus pour l’écrire dans ton projet.
Ce que fait add cli command dotnet dotnet
[ ] Option/command declared in `Definitions`, registered in its parent's constructor.
[ ] Managed behavior wired in `src/Cli/dotnet` and (for new commands) in `Parser.cs`.
[ ] Help description in `CommandDefinitionStrings.resx`; runtime message in `CliCommandStrings.resx`.
[ ] `.xlf` files regenerated via `/t:UpdateXlf` (not hand-edited), resx + xlf committed together.
Comment utiliser add cli command dotnet dotnet
1
Copie le prompt
Un clic copie le prompt packagé (ou l'envoie à ton agent).
2
L'agent installe le skill
Il ajoute le SKILL.md et ses ressources à ton projet.
3
Activation automatique
Le skill s'active dès que le contexte correspond.
Déclencheurs pour add cli command dotnet dotnet
Dis simplement à ton agent quelque chose comme :
Applique le skill add-cli-command__dotnet-dotnet__src-sdk-github-skills-9ab38984b9dd à cette tâche
Utilise add-cli-command__dotnet-dotnet__src-sdk-github-skills-9ab38984b9dd pour améliorer cette implémentation
Passe en revue ce sujet avec add-cli-command__dotnet-dotnet__src-sdk-github-skills-9ab38984b9dd
Skills liés à add cli command dotnet dotnet
add cli command dotnet sdk
Add or change a dotnet CLI command, subcommand, or option across the relevant CLI projects. USE FOR: adding or changing a dotnet CLI command/subcommand, adding a new Option<T> or Argument<T>, registering a subcommand in the command tree, changing an option's help description or a command's runtime message, wiring a command parser, or updating --help output.add dotnet aot command dotnet dotnet
Add, enable, or review a dotnet CLI command or feature in the Native AOT CLI (src/Cli/dotnet-aot) and prove its compatibility. USE FOR: migrating a command or option to AOT, reviewing an AOT migration PR, defining conservative eligibility and managed fallback, changing AotSourceFiles.props or AotDependencies.props, validating AOT/managed parity, NativeAOT-publishing tests, checking binary-size impact, or using the dn harness and separated SDK layout. DO NOT USE FOR: resolving IL trim/AOT analyzer warnings alone (use dotnet-aot-compat), running dotnet.Tests incrementally (use incremental-test), or pure managed CLI work.add dotnet aot command dotnet sdk
Add, enable, or review a dotnet CLI command or feature in the Native AOT CLI (src/Cli/dotnet-aot) and prove its compatibility. USE FOR: migrating a command or option to AOT, reviewing an AOT migration PR, defining conservative eligibility and managed fallback, changing AotSourceFiles.props or AotDependencies.props, validating AOT/managed parity, NativeAOT-publishing tests, checking binary-size impact, or using the dn harness and separated SDK layout. DO NOT USE FOR: resolving IL trim/AOT analyzer warnings alone (use dotnet-aot-compat), running dotnet.Tests incrementally (use incremental-test), or pure managed CLI work.