Skip to content
DocsTry Aspire
DocsTry

aspire terminal ps command

aspire terminal ps - List interactive terminal sessions in the connected AppHost.

Aspire CLI
aspire terminal ps [options]

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:

ColumnDescription
ResourceThe display name of the terminal-enabled resource.
ReplicaThe 0-based replica index (one row per replica).
StatusWhether the replica is alive, exited (<code>), or host unreachable.
SizeThe current terminal grid size (columnsxrows).
PeersThe number of peers currently attached to the replica.
RestartsThe number of times the replica’s terminal host has restarted.

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; json emits structured output for scripting. The JSON output is an array of terminal entries with resourceName, displayName, configuredColumns, configuredRows, isHostReachable, and a replicas array. Each replica includes replicaIndex, isAlive, exitCode, producerConnected, restartCount, currentColumns, currentRows, and attachedPeerCount. When --verbose is set, each replica also includes a peers array of { peerId, displayName }.

  • -v, --verbose

    Include per-peer details for every attached viewer (peer id and display name).

  • -?, -h, --help

    Prints 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-interactive

    Run the command in non-interactive mode, disabling all interactive prompts and spinners.

  • --nologo

    Suppress the startup banner and telemetry notice.

  • --banner

    Display the animated Aspire CLI welcome banner.

  • --wait-for-debugger

    Wait for a debugger to attach before running a command.

  • List terminal sessions in the running AppHost:

    Aspire CLI
    aspire terminal ps

    Example output:

    Output
    Resource Replica Status Size Peers Restarts
    agent 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 }'