Aspire
What
Status of your Aspire AppHost in the current repo and whether it is running.
By default, the segment detects apphost.cs, apphost.ts, or *.AppHost.csproj in the current directory
or its parents without launching the Aspire CLI for discovery.
Enable fetch_apphost to use aspire extension get-apphosts for CLI-selected or differently named projects,
with file detection as a fallback.
Running instances are checked with aspire ps --format json.
Set fetch_running to false to avoid launching the Aspire CLI altogether when using file-based detection.
Use the built-in segment cache with the folder strategy to avoid repeating CLI calls on every prompt.
The sample below refreshes the entire segment, including running status, every ten seconds.
Adjust cache.duration to trade freshness for fewer CLI calls, or set it to none to refresh on every prompt.
The segment cache stores visible segments, not unsuccessful AppHost lookups.
With fetch_apphost: true, CLI discovery can still run on every prompt in folders without an AppHost.
Leave it disabled unless you need CLI discovery; the default file-based detection avoids that delay.
Sample Configuration
- json
- yaml
- toml
Options
| Name | Type | Default | Description |
|---|---|---|---|
fetch_apphost | boolean | false | use the Aspire CLI for AppHost discovery, with file fallback |
fetch_running | boolean | true | query aspire ps for running status |
Template (info)
- json
- yaml
- toml
{
"template": " {{ .Name }}{{ if .Running }} {{ end }} "
}
template: " {{ .Name }}{{ if .Running }} {{ end }} "
template = " {{ .Name }}{{ if .Running }} {{ end }} "
Properties
| Name | Type | Description |
|---|---|---|
.AppHostPath | string | the resolved AppHost path reported by the Aspire CLI or file search |
.Name | string | the Aspire AppHost display name |
.Version | string | the Aspire Hosting version from Directory.Packages.props |
.Lang | string | the detected single-file AppHost language (cs or ts) |
.Running | boolean | whether the resolved AppHost currently appears in aspire ps |