Skip to main content

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.

note

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​

− ▢ ×  AppHost  _ ohmyposh.dev − ▢ ×  AppHost  _ ohmyposh.dev

Options​

NameTypeDefaultDescription
fetch_apphostbooleanfalseuse the Aspire CLI for AppHost discovery, with file fallback
fetch_runningbooleantruequery aspire ps for running status

Template (info)​

default template
{
"template": "  {{ .Name }}{{ if .Running }} {{ end }} "
}

Properties​

NameTypeDescription
.AppHostPathstringthe resolved AppHost path reported by the Aspire CLI or file search
.Namestringthe Aspire AppHost display name
.Versionstringthe Aspire Hosting version from Directory.Packages.props
.Langstringthe detected single-file AppHost language (cs or ts)
.Runningbooleanwhether the resolved AppHost currently appears in aspire ps