aspire terminal ps command
aspire terminal ps - List interactive terminal sessions in the connected AppHost.
Synopsis
Section titled “Synopsis”aspire terminal ps [options]Description
Section titled “Description”The aspire terminal ps command lists every resource in the connected AppHost that was registered using WithTerminal(). For each terminal it reports the current grid size, the number of attached peers, and per-replica health so you can see what’s available before running aspire terminal attach.
Resources whose terminal host isn’t reachable are still listed with a status that indicates they’re unavailable, rather than being silently dropped.
Because WithTerminal is experimental, this command is hidden behind a feature flag. Enable it with aspire config set features.terminalCommandsEnabled true. The connected AppHost must advertise the terminals.v1 capability (Aspire.Hosting 13.4 or later).
The default output is a human-readable table with the following columns:
| Column | Description |
|---|---|
Resource | The display name of the terminal-enabled resource. |
Replica | The 0-based replica index (one row per replica). |
Status | Whether the replica is alive, exited (<code>), or host unreachable. |
Size | The current terminal grid size (columnsxrows). |
Peers | The number of peers currently attached to the replica. |
Restarts | The number of times the replica’s terminal host has restarted. |
Options
Section titled “Options”The following options are available:
-
--apphost <apphost>The path to the Aspire AppHost file or project file, such as
apphost.mts,apphost.cs, or an AppHost.csproj. -
--format <json|text>Output format.
text(default) renders a table;jsonemits structured output for scripting. The JSON output is an array of terminal entries withresourceName,displayName,configuredColumns,configuredRows,isHostReachable, and areplicasarray. Each replica includesreplicaIndex,isAlive,exitCode,producerConnected,restartCount,currentColumns,currentRows, andattachedPeerCount. When--verboseis set, each replica also includes apeersarray of{ peerId, displayName }. -
-v, --verboseInclude per-peer details for every attached viewer (peer id and display name).
-
-?, -h, --helpPrints help and usage documentation for the available commands and options.
-
-l, --log-level <Critical|Debug|Error|Information|None|Trace|Warning>Set the minimum log level for console output. Use this option to increase diagnostics while troubleshooting or reduce output in scripted runs.
-
--non-interactiveRun the command in non-interactive mode, disabling all interactive prompts and spinners.
-
--nologoSuppress the startup banner and telemetry notice.
-
--bannerDisplay the animated Aspire CLI welcome banner.
-
--wait-for-debuggerWait for a debugger to attach before running a command.
Examples
Section titled “Examples”-
List terminal sessions in the running AppHost:
Aspire CLI aspire terminal psExample output:
Output Resource Replica Status Size Peers Restartsagent 0 alive 120x30 1 0 -
Include per-peer details:
Aspire CLI aspire terminal ps --verbose -
Emit JSON for scripting and pipe to
jq:Aspire CLI aspire terminal ps --format json | jq -c '.[] | { resourceName, isHostReachable }'