Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,27 @@ selected resource at runtime. This is why the CLI reference documents
`aspire resource start`.
</Aside>

### Discovering available resource commands

Running `aspire resource <resource> --help` with a specific resource name queries the running AppHost and appends an **Available resource commands** section to the help output. This lets you discover what commands a resource supports without opening the dashboard.

```text title="Example output"
Available resource commands:
restart Restart the resource.
start Start the resource.
stop Stop the resource.
```

If no single in-scope AppHost can be determined without an explicit `--apphost`, the resource-scoped help is shown without the commands section rather than prompting for AppHost selection.

To pass `--help` as an argument to the resource command itself (rather than as a CLI help flag), separate it with `--`:

```bash title="Aspire CLI"
aspire resource myresource mycommand -- --help
```

### AppHost selection

When executed without the `--apphost` option, the command:

<Steps>
Expand Down Expand Up @@ -59,6 +80,10 @@ The following options are available:

- <Include relativePath="reference/cli/includes/option-help.md" />

- **`--include-hidden`**

Includes resource commands that are marked as hidden. By default, hidden commands are not shown in help output or executed. Use this option to expose and run commands that are intentionally hidden from the default command listing.

- <Include relativePath="reference/cli/includes/option-log-level.md" />

- <Include relativePath="reference/cli/includes/option-non-interactive.md" />
Expand All @@ -83,10 +108,34 @@ The following options are available:
aspire resource worker stop
```

- Target a specific AppHost project:
- Target a specific AppHost file:

```bash title="Aspire CLI"
aspire resource api restart --apphost './src/MyApp.AppHost/MyApp.AppHost.csproj'
# C# AppHost
aspire resource api restart --apphost './apphost.cs'

# TypeScript AppHost
aspire resource api restart --apphost './apphost.ts'
```

- List available commands for a specific resource:

```bash title="Aspire CLI"
# C# AppHost
aspire resource myapi --help --apphost './apphost.cs'

# TypeScript AppHost
aspire resource myapi --help --apphost './apphost.ts'
```

- Include hidden commands when listing available commands:

```bash title="Aspire CLI"
# C# AppHost
aspire resource myapi --help --include-hidden --apphost './apphost.cs'

# TypeScript AppHost
aspire resource myapi --help --include-hidden --apphost './apphost.ts'
```

## See also
Expand Down
Loading