Skip to content

Commit 4472d05

Browse files
Add aspire docs api command reference pages
Documents the new aspire docs api list|search|get sub-commands introduced in microsoft/aspire#15814. - Add aspire-docs-api.mdx (group command overview) - Add aspire-docs-api-list.mdx - Add aspire-docs-api-search.mdx - Add aspire-docs-api-get.mdx - Update aspire-docs.mdx to include the api sub-command in the table - Update sidebar reference.topics.ts with the new entries Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 40551ce commit 4472d05

File tree

6 files changed

+372
-5
lines changed

6 files changed

+372
-5
lines changed

src/frontend/config/sidebar/reference.topics.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,28 @@ export const referenceTopics: StarlightSidebarTopicsUserConfig[number] = {
373373
label: 'aspire docs search',
374374
slug: 'reference/cli/commands/aspire-docs-search',
375375
},
376+
{
377+
label: 'aspire docs api',
378+
collapsed: true,
379+
items: [
380+
{
381+
label: 'aspire docs api',
382+
slug: 'reference/cli/commands/aspire-docs-api',
383+
},
384+
{
385+
label: 'aspire docs api get',
386+
slug: 'reference/cli/commands/aspire-docs-api-get',
387+
},
388+
{
389+
label: 'aspire docs api list',
390+
slug: 'reference/cli/commands/aspire-docs-api-list',
391+
},
392+
{
393+
label: 'aspire docs api search',
394+
slug: 'reference/cli/commands/aspire-docs-api-search',
395+
},
396+
],
397+
},
376398
],
377399
},
378400
{
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
title: aspire docs api get command
3+
description: Learn about the aspire docs api get command and its usage. This command retrieves the full content of an Aspire API reference entry from aspire.dev.
4+
---
5+
6+
import Include from '@components/Include.astro';
7+
8+
## Name
9+
10+
`aspire docs api get` - Get the full content of an API reference entry by identifier.
11+
12+
## Synopsis
13+
14+
```bash title="Aspire CLI"
15+
aspire docs api get <id> [options]
16+
```
17+
18+
## Description
19+
20+
The `aspire docs api get` command retrieves and displays the full API reference content for a specific entry from [aspire.dev](https://aspire.dev). The content is rendered as Markdown in the terminal.
21+
22+
Use the [`aspire docs api list`](../aspire-docs-api-list/) command to browse available scopes and discover identifiers, or use the [`aspire docs api search`](../aspire-docs-api-search/) command to find identifiers by keyword.
23+
24+
## Arguments
25+
26+
- **`<id>`**
27+
28+
The identifier of the API reference entry to retrieve. Identifiers are path-based strings derived from the API route structure on `aspire.dev`, for example `csharp/aspire.hosting/iresourcebuilder` or `typescript/aspire.hosting/addredis`.
29+
30+
Use [`aspire docs api list`](../aspire-docs-api-list/) or [`aspire docs api search`](../aspire-docs-api-search/) to discover valid identifiers.
31+
32+
## Options
33+
34+
The following options are available:
35+
36+
- **`--format <Table|Json>`**
37+
38+
Output format. Choose `Table` for a human-readable table or `Json` for machine-readable JSON output. Defaults to `Table`.
39+
40+
- <Include relativePath="reference/cli/includes/option-help.md" />
41+
42+
- <Include relativePath="reference/cli/includes/option-log-level.md" />
43+
44+
- <Include relativePath="reference/cli/includes/option-non-interactive.md" />
45+
46+
- <Include relativePath="reference/cli/includes/option-nologo.md" />
47+
48+
- <Include relativePath="reference/cli/includes/option-banner.md" />
49+
50+
- <Include relativePath="reference/cli/includes/option-wait.md" />
51+
52+
## Examples
53+
54+
- Get the API reference for a C# package:
55+
56+
```bash title="Aspire CLI"
57+
aspire docs api get csharp/aspire.hosting
58+
```
59+
60+
- Get the API reference for a specific C# type:
61+
62+
```bash title="Aspire CLI"
63+
aspire docs api get csharp/aspire.hosting/iresourcebuilder
64+
```
65+
66+
- Get the API reference for a TypeScript module symbol:
67+
68+
```bash title="Aspire CLI"
69+
aspire docs api get typescript/aspire.hosting/addredis
70+
```
71+
72+
- Get API content in JSON format:
73+
74+
```bash title="Aspire CLI"
75+
aspire docs api get csharp/aspire.hosting/iresourcebuilder --format Json
76+
```
77+
78+
## See also
79+
80+
- [aspire docs api command](../aspire-docs-api/)
81+
- [aspire docs api list command](../aspire-docs-api-list/)
82+
- [aspire docs api search command](../aspire-docs-api-search/)
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
title: aspire docs api list command
3+
description: Learn about the aspire docs api list command and its usage. This command browses the Aspire API reference catalog under a given scope on aspire.dev.
4+
---
5+
6+
import Include from '@components/Include.astro';
7+
8+
## Name
9+
10+
`aspire docs api list` - Browse API reference entries under a given scope.
11+
12+
## Synopsis
13+
14+
```bash title="Aspire CLI"
15+
aspire docs api list <scope> [options]
16+
```
17+
18+
## Description
19+
20+
The `aspire docs api list` command lets you navigate the Aspire API reference catalog from [aspire.dev](https://aspire.dev) in a scoped, hierarchical way. Rather than returning the entire catalog at once, `list` returns only the direct children of the provided scope.
21+
22+
Start with a language root (`csharp` or `typescript`) to see the top-level packages or modules, then progressively narrow the scope to explore types, member groups, and individual members.
23+
24+
## Arguments
25+
26+
- **`<scope>`**
27+
28+
The scope to browse. Use a language root or a path-based identifier to navigate the API hierarchy.
29+
30+
**C# scopes:**
31+
32+
| Scope | Returns |
33+
| --- | --- |
34+
| `csharp` | Top-level C# packages |
35+
| `csharp/<package>` | Types in the package |
36+
| `csharp/<package>/<type>` | Member-group pages (for example, `methods`, `properties`, `constructors`) |
37+
38+
**TypeScript scopes:**
39+
40+
| Scope | Returns |
41+
| --- | --- |
42+
| `typescript` | Top-level TypeScript modules |
43+
| `typescript/<module>` | Direct symbols in the module |
44+
| `typescript/<module>/<symbol>` | Members under the symbol |
45+
46+
If a scope has no children, `list` returns no results.
47+
48+
## Options
49+
50+
The following options are available:
51+
52+
- **`--format <Table|Json>`**
53+
54+
Output format. Choose `Table` for a human-readable table or `Json` for machine-readable JSON output. Defaults to `Table`.
55+
56+
- <Include relativePath="reference/cli/includes/option-help.md" />
57+
58+
- <Include relativePath="reference/cli/includes/option-log-level.md" />
59+
60+
- <Include relativePath="reference/cli/includes/option-non-interactive.md" />
61+
62+
- <Include relativePath="reference/cli/includes/option-nologo.md" />
63+
64+
- <Include relativePath="reference/cli/includes/option-banner.md" />
65+
66+
- <Include relativePath="reference/cli/includes/option-wait.md" />
67+
68+
## Examples
69+
70+
- List all top-level C# packages:
71+
72+
```bash title="Aspire CLI"
73+
aspire docs api list csharp
74+
```
75+
76+
- List all types in a specific C# package:
77+
78+
```bash title="Aspire CLI"
79+
aspire docs api list csharp/aspire.hosting
80+
```
81+
82+
- List member groups for a specific C# type:
83+
84+
```bash title="Aspire CLI"
85+
aspire docs api list csharp/aspire.hosting/idistributedapplicationbuilder
86+
```
87+
88+
- List all top-level TypeScript modules:
89+
90+
```bash title="Aspire CLI"
91+
aspire docs api list typescript
92+
```
93+
94+
- List symbols in a specific TypeScript module:
95+
96+
```bash title="Aspire CLI"
97+
aspire docs api list typescript/aspire.hosting
98+
```
99+
100+
- List results in JSON format:
101+
102+
```bash title="Aspire CLI"
103+
aspire docs api list csharp --format Json
104+
```
105+
106+
## See also
107+
108+
- [aspire docs api command](../aspire-docs-api/)
109+
- [aspire docs api search command](../aspire-docs-api-search/)
110+
- [aspire docs api get command](../aspire-docs-api-get/)
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
title: aspire docs api search command
3+
description: Learn about the aspire docs api search command and its usage. This command searches Aspire API reference documentation by keyword on aspire.dev.
4+
---
5+
6+
import Include from '@components/Include.astro';
7+
8+
## Name
9+
10+
`aspire docs api search` - Search Aspire API reference documentation by keyword.
11+
12+
## Synopsis
13+
14+
```bash title="Aspire CLI"
15+
aspire docs api search <query> [options]
16+
```
17+
18+
## Description
19+
20+
The `aspire docs api search` command performs a keyword-based search across the Aspire API reference index from [aspire.dev](https://aspire.dev). Use it to find types, methods, extension methods, or other API members by name or concept, without needing to know the exact package hierarchy.
21+
22+
Results are ranked by relevance and include the identifier and display name for each match. Use the identifier returned in search results with the [`aspire docs api get`](../aspire-docs-api-get/) command to retrieve the full content of an API reference entry.
23+
24+
Optionally filter results to a specific language using the `--language` option.
25+
26+
## Arguments
27+
28+
- **`<query>`**
29+
30+
The search query. Use type names, method names, or keywords to describe the API you are looking for. For example, `AddRedis`, `IResourceBuilder`, or `WithReference`.
31+
32+
## Options
33+
34+
The following options are available:
35+
36+
- **`--language <language>`**
37+
38+
Filter results to a specific language. Supported values are `csharp` and `typescript`. When omitted, results from all supported languages are returned.
39+
40+
- **`--format <Table|Json>`**
41+
42+
Output format. Choose `Table` for a human-readable table or `Json` for machine-readable JSON output. Defaults to `Table`.
43+
44+
- **`-n, --limit <limit>`**
45+
46+
Maximum number of search results to return. Defaults to `5`.
47+
48+
- <Include relativePath="reference/cli/includes/option-help.md" />
49+
50+
- <Include relativePath="reference/cli/includes/option-log-level.md" />
51+
52+
- <Include relativePath="reference/cli/includes/option-non-interactive.md" />
53+
54+
- <Include relativePath="reference/cli/includes/option-nologo.md" />
55+
56+
- <Include relativePath="reference/cli/includes/option-banner.md" />
57+
58+
- <Include relativePath="reference/cli/includes/option-wait.md" />
59+
60+
## Examples
61+
62+
- Search for API entries related to Redis:
63+
64+
```bash title="Aspire CLI"
65+
aspire docs api search "AddRedis"
66+
```
67+
68+
- Search in C# only:
69+
70+
```bash title="Aspire CLI"
71+
aspire docs api search "IResourceBuilder" --language csharp
72+
```
73+
74+
- Search in TypeScript only:
75+
76+
```bash title="Aspire CLI"
77+
aspire docs api search "withReference" --language typescript
78+
```
79+
80+
- Search with a custom result limit:
81+
82+
```bash title="Aspire CLI"
83+
aspire docs api search "WithCommand" --language csharp --limit 10
84+
```
85+
86+
- Search and output results in JSON format:
87+
88+
```bash title="Aspire CLI"
89+
aspire docs api search "service defaults" --format Json
90+
```
91+
92+
## See also
93+
94+
- [aspire docs api command](../aspire-docs-api/)
95+
- [aspire docs api list command](../aspire-docs-api-list/)
96+
- [aspire docs api get command](../aspire-docs-api-get/)
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
title: aspire docs api command
3+
description: Learn about the aspire docs api command and its usage. This command group is used to browse, search, and retrieve Aspire API reference material from aspire.dev.
4+
---
5+
6+
import Include from '@components/Include.astro';
7+
8+
## Name
9+
10+
`aspire docs api` - Browse, search, and retrieve Aspire API reference documentation from aspire.dev.
11+
12+
## Synopsis
13+
14+
```bash title="Aspire CLI"
15+
aspire docs api [command] [options]
16+
```
17+
18+
## Description
19+
20+
The `aspire docs api` command group provides access to the Aspire API reference documentation published on [aspire.dev](https://aspire.dev). Unlike the [`aspire docs`](../aspire-docs/) commands that work with prose documentation pages, the `aspire docs api` commands are backed by the API reference index built from `aspire.dev`'s sitemap.
21+
22+
You can browse the API catalog by scope, search for specific types or members by keyword, or retrieve the full reference content for a specific API entry. Both C# and TypeScript API hierarchies are supported.
23+
24+
## Options
25+
26+
The following options are available:
27+
28+
- <Include relativePath="reference/cli/includes/option-help.md" />
29+
30+
- <Include relativePath="reference/cli/includes/option-log-level.md" />
31+
32+
- <Include relativePath="reference/cli/includes/option-non-interactive.md" />
33+
34+
- <Include relativePath="reference/cli/includes/option-nologo.md" />
35+
36+
- <Include relativePath="reference/cli/includes/option-banner.md" />
37+
38+
- <Include relativePath="reference/cli/includes/option-wait.md" />
39+
40+
## Commands
41+
42+
The following commands are available:
43+
44+
| Command | Status | Function |
45+
| -------------------------------------------------------------- | ------ | ------------------------------------------------------------- |
46+
| [`aspire docs api list <scope>`](../aspire-docs-api-list/) | Stable | Browse API reference entries under a given scope. |
47+
| [`aspire docs api search <query>`](../aspire-docs-api-search/) | Stable | Search Aspire API reference by keyword. |
48+
| [`aspire docs api get <id>`](../aspire-docs-api-get/) | Stable | Get the full content of an API reference entry by identifier. |
49+
50+
## See also
51+
52+
- [aspire docs command](../aspire-docs/)
53+
- [aspire docs api list command](../aspire-docs-api-list/)
54+
- [aspire docs api search command](../aspire-docs-api-search/)
55+
- [aspire docs api get command](../aspire-docs-api-get/)

src/frontend/src/content/docs/reference/cli/commands/aspire-docs.mdx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,17 @@ The following options are available:
4545

4646
The following commands are available:
4747

48-
| Command | Status | Function |
49-
| ------------------------------------------------------ | ------ | ----------------------------------------------------- |
50-
| [`aspire docs list`](../aspire-docs-list/) | Stable | List all available Aspire documentation pages. |
51-
| [`aspire docs search <query>`](../aspire-docs-search/) | Stable | Search Aspire documentation by keywords. |
52-
| [`aspire docs get <slug>`](../aspire-docs-get/) | Stable | Get the full content of a documentation page by slug. |
48+
| Command | Status | Function |
49+
| -------------------------------------------------------------- | ------ | ------------------------------------------------------------- |
50+
| [`aspire docs list`](../aspire-docs-list/) | Stable | List all available Aspire documentation pages. |
51+
| [`aspire docs search <query>`](../aspire-docs-search/) | Stable | Search Aspire documentation by keywords. |
52+
| [`aspire docs get <slug>`](../aspire-docs-get/) | Stable | Get the full content of a documentation page by slug. |
53+
| [`aspire docs api`](../aspire-docs-api/) | Stable | Browse, search, and retrieve Aspire API reference material. |
5354

5455
## See also
5556

5657
- [aspire docs list command](../aspire-docs-list/)
5758
- [aspire docs search command](../aspire-docs-search/)
5859
- [aspire docs get command](../aspire-docs-get/)
60+
- [aspire docs api command](../aspire-docs-api/)
5961
- [Aspire documentation](https://aspire.dev)

0 commit comments

Comments
 (0)