-
Notifications
You must be signed in to change notification settings - Fork 74
[docs] Add aspire ls command reference documentation #1134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aspire-repo-bot
wants to merge
2
commits into
release/13.4
Choose a base branch
from
docs/aspire-ls-bugs-13-4-3c4d7d382e6698c9
base: release/13.4
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+145
−0
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
139 changes: 139 additions & 0 deletions
139
src/frontend/src/content/docs/reference/cli/commands/aspire-ls.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,139 @@ | ||
| --- | ||
| title: aspire ls command | ||
| description: Learn about the aspire ls command which discovers and lists AppHost project candidates in the current directory and its subdirectories. | ||
| --- | ||
|
|
||
| import Include from '@components/Include.astro'; | ||
|
|
||
| ## Name | ||
|
|
||
| `aspire ls` - List AppHost project candidates. | ||
|
|
||
| ## Synopsis | ||
|
|
||
| ```bash title="Aspire CLI" | ||
| aspire ls [options] | ||
| ``` | ||
|
|
||
| ## Description | ||
|
|
||
| The `aspire ls` command discovers and lists AppHost project candidates in the current working directory and its subdirectories. It performs parallel discovery and reports results along with each candidate's programming language and build status. | ||
|
|
||
| The default output is a human-readable table with the following columns: | ||
|
|
||
| | Column | Description | | ||
| | ---------- | ------------------------------------------------ | | ||
| | `PATH` | The file path to the AppHost project | | ||
| | `LANGUAGE` | The programming language of the AppHost | | ||
| | `STATUS` | Build status of the AppHost candidate | | ||
|
|
||
| ### Discovery and configuration | ||
|
|
||
| If a configuration file (for example `aspire.config.json` with `appHost.path` or a legacy `aspireSettings.json` with `appHostPath`) points to an AppHost project, that path is included as a candidate. When the configured file path is absent, contains invalid characters, or is not a JSON string, a warning is displayed. | ||
|
IEvangelist marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### Output ordering | ||
|
|
||
| **Non-streaming mode** (`--format json` without `--stream`): results are sorted by path before output. | ||
|
|
||
| **Streaming mode** (`--format json --stream`): results are emitted in arrival order from parallel discovery and are **not sorted**. If you need a deterministic order for streamed output, pipe through a sort step. For example: | ||
|
|
||
| ```bash title="Aspire CLI" | ||
| aspire ls --format json --stream | jq -s 'sort_by(.path)' | ||
| ``` | ||
|
|
||
| ## Options | ||
|
|
||
| The following options are available: | ||
|
|
||
| - **`--format <Json|Table>`** | ||
|
|
||
| Output result format. Use `Json` for machine-readable output suitable for scripting and automation. Defaults to `Table`. | ||
|
|
||
| - **`--stream`** | ||
|
|
||
| Output discovered AppHosts as newline-delimited JSON (NDJSON), emitting each candidate as soon as it is discovered. Requires `--format json`. | ||
|
|
||
| - **`--all`** | ||
|
|
||
| Include all candidate AppHosts, ignoring `.gitignore` and built-in directory filters. | ||
|
|
||
| - <Include relativePath="reference/cli/includes/option-help.md" /> | ||
|
|
||
| - <Include relativePath="reference/cli/includes/option-log-level.md" /> | ||
|
|
||
| - <Include relativePath="reference/cli/includes/option-non-interactive.md" /> | ||
|
|
||
| - <Include relativePath="reference/cli/includes/option-nologo.md" /> | ||
|
|
||
| - <Include relativePath="reference/cli/includes/option-banner.md" /> | ||
|
|
||
| - <Include relativePath="reference/cli/includes/option-wait.md" /> | ||
|
|
||
| ## Examples | ||
|
|
||
| - List all discovered AppHost candidates in table format: | ||
|
|
||
| ```bash title="Aspire CLI" | ||
| aspire ls | ||
| ``` | ||
|
|
||
| Example output: | ||
|
|
||
| ```text title="Output" | ||
| PATH LANGUAGE STATUS | ||
| ./src/MyApp.AppHost/MyApp.AppHost.csproj C# buildable | ||
| ./src/OtherApp.AppHost/OtherApp.AppHost.csproj C# buildable | ||
| ``` | ||
|
|
||
| - Output discovered AppHosts as JSON for scripting: | ||
|
|
||
| ```bash title="Aspire CLI" | ||
| aspire ls --format json | ||
| ``` | ||
|
|
||
| Example output: | ||
|
|
||
| ```json title="Output" | ||
| [ | ||
| { | ||
| "path": "./src/MyApp.AppHost/MyApp.AppHost.csproj", | ||
| "language": "C#", | ||
|
IEvangelist marked this conversation as resolved.
Outdated
|
||
| "status": "buildable" | ||
| }, | ||
| { | ||
| "path": "./src/OtherApp.AppHost/OtherApp.AppHost.csproj", | ||
| "language": "C#", | ||
| "status": "buildable" | ||
| } | ||
| ] | ||
| ``` | ||
|
|
||
| - Stream discovered AppHosts as newline-delimited JSON: | ||
|
|
||
| ```bash title="Aspire CLI" | ||
| aspire ls --format json --stream | ||
| ``` | ||
|
|
||
| Example output (each line is a JSON object emitted as candidates are discovered): | ||
|
|
||
| ```text title="Output" | ||
| {"path":"./src/OtherApp.AppHost/OtherApp.AppHost.csproj","language":"C#","status":"buildable"} | ||
|
IEvangelist marked this conversation as resolved.
Outdated
|
||
| {"path":"./src/MyApp.AppHost/MyApp.AppHost.csproj","language":"C#","status":"buildable"} | ||
| ``` | ||
|
|
||
| Note: lines are emitted in discovery arrival order and are not sorted. To sort streamed output by path: | ||
|
|
||
| ```bash title="Aspire CLI" | ||
| aspire ls --format json --stream | jq -s 'sort_by(.path)' | ||
| ``` | ||
|
|
||
| - Include all AppHost candidates, ignoring `.gitignore` and directory filters: | ||
|
|
||
| ```bash title="Aspire CLI" | ||
| aspire ls --all | ||
| ``` | ||
|
|
||
| ## See also | ||
|
|
||
| - [aspire run](/reference/cli/commands/aspire-run/) | ||
| - [aspire ps](/reference/cli/commands/aspire-ps/) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.