microsoft / microsoft/aspire

Show help test on invalid argument to CLI resource command

Open
#19,610 2 comments 0 reactions 0 assignees View on GitHub
area-cli triage:bot-seen
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 12h
Merged PRs (30d)
201

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

If you pass an invalid argument to a resource command, you get told what the wrong argument is, but there is no help in working out what the arguments should be.

```
> aspire resource apiservice jwt-user --asdf
❌ Unrecognized command option '--asdf'.
📄 See logs at C:\Users\alex\.aspire\logs\cli_20260823T121431_419fdd05.log
🔍 See AppHost logs at C:\Users\alex\.aspire\logs\cli_20260823T120957_29eb5cd7.log
```

### Describe the solution you'd like

Similar to what happens if you pass an invalid command to the aspire cli (e.g. `aspire FAKE`), the CLI should print the help output if an argument is wrong e.g.

```
> aspire resource apiservice jwt-user --asdf

❌ Unrecognized command option '--asdf'.

Generate a signed user JWT bearer token using the configured static signing key.

Usage:
aspire resource apiservice jwt-user [options] [[--] ...]

Command options:
--sub Value used for the sub claim. Default: dev-user.
--age User's age used for authorization checks. Default: 18.

Options:
--apphost The path to the Aspire AppHost project file or a directory to search
--include-hidden Include hidden resources in the output
-?, -h, /?, /h, --help Show help and usage information
-l, --log-level Set the minimum log level for console output (Trace, Debug, Information, Warning,
Error, Critical)
--non-interactive Run the command in non-interactive mode, disabling all interactive prompts and spinners
--nologo Suppress the startup banner and telemetry notice
--banner Display the animated Aspire CLI welcome banner
--wait-for-debugger Wait for a debugger to attach before executing the command
```

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the `aspire resource apiservice jwt-user --asdf` command and compare its output with the invalid-command behavior from `aspire FAKE`. Locate the CLI handling for invalid options and its existing help output, then verify that the resource command prints the command description, usage, and options after the error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.