expanse CLI is the primary way to register compute, run workloads, and ask intelligence questions about them.
Installation
Auth
expanse login
Store your personal exp_user_* API key locally and mint a session. Pass the key with --api-key or set EXPANSE_API_KEY (the key is created from the Console settings page after you sign in through your organisation’s SSO).
expanse status
Show which identity the CLI is acting under.
expanse refresh
Mint and cache a fresh short-lived access token for the current session. The CLI does this automatically; use refresh to force one, or to switch organisation with --organisation-id.
Compute
expanse compute register
Register a new compute with your organisation. The command asks what kind of compute you’re registering (or pass --type) and prints a single-use install token plus the install command to run on the target.
expanse compute install
Run on the target machine. Exchanges the install token (set EXPANSE_INSTALL_TOKEN) for the compute’s stable credential and writes the daemon config. expanse compute register prints the exact command to run, including --control-plane and --data-plane.
--type slurm the installer downloads the daemon release named by --daemon-version, verifies its checksum and cosign signature against the pinned Expanse release signing key, places the daemon and scheduler hooks, and enables the systemd unit. --daemon-binary installs a pre-staged binary or release archive instead (the air-gapped path; archives are verified against the same key). --write-config-only skips cluster orchestration and only writes the config file.
--reinstall (alias --force) re-runs the install on a node that already holds a daemon config. With EXPANSE_INSTALL_TOKEN unset it reuses the existing credential and needs no token. With EXPANSE_INSTALL_TOKEN set to a token re-issued from the compute’s console page, it exchanges that token and replaces the credential for the same compute. Reinstall never prompts for a token.
Workloads
expanse executions
List recent workload executions for your organisation, newest first. The quickest way to find an execution ID for expanse diagnose or expanse metrics without opening the Console.
The submitting user comes from the scheduler and is best-effort: executions whose telemetry carried no user stay unattributed and are not matched by
--user or --mine.
expanse metrics
Export metric series for one execution as a summary table, CSV, or JSON.
gpu-util, gpu-memory-used, gpu-memory-total, gpu-power, gpu-temp, gpu-clock, cpu, memory. Any other name is passed through raw, so CUPTI PM sampling and DCGM counters keep their native names.
--csv and --json write data to stdout only; progress and warnings go to stderr, so piped output stays machine-clean. When a series hits --max-points the CLI warns on stderr and suggests a wider --interval.
Intelligence
expanse analyse
Recommend resources before a workload runs. Accepts a SLURM batch script, a source file, a Kubernetes workload manifest, or a Nomad jobspec.
RESOURCE RECOMMENDATION (walltime, CPU, host memory, GPU count and type, the measured GPU peak and utilisation of earlier runs, and completion_probability, the probability a run completes at the recommended resources computed from every recorded run of the same source), FAILURE RISK at the resources you requested, OPTIMISATION (the resource change proposed, as a class such as memory_lower+walltime_raise), followed by the executions on your compute that anchored the numbers. Units live in the row name (_s, _gb, _pct); the one confidence label is low, medium or high, with the fit score beside it when recorded runs anchor the result. Analyse proposes resource changes only, never code changes, unless you pass --code. When the recommendation changes your submission, analyse produces a patch artefact and, on an interactive terminal, asks Apply the resource recommendations automatically? [y/n]: y shows the diff and applies it, n leaves these commands for later:
analyze works as a spelling alias.
expanse diagnose
Root cause of a failed execution, with cited evidence and a prompt for your coding agent. The output opens with PIPELINE DIAGNOSE (what evidence each stage found), then the execution’s identity, RESOURCE SNAPSHOT (same names and units as expanse analyse, GPU memory per device) and, for a failed run, FAILURE DETECTION: the failure pattern, the confidence label, recurrence (the share of this workload’s earlier recorded runs that failed) and the root cause.
<execution-id> is the Expanse execution ID (find it with expanse executions). If you only have the scheduler-native ID, pass it with --source-type (slurm, kubernetes, nomad). The diagnosis cites the evidence it used: telemetry, logs, the captured source bundle, and similar executions on your compute.
Diagnose never proposes or applies a fix. A failed execution carries a prompt for your own coding agent, which owns the change. On an interactive terminal diagnose offers it (Suggested prompt for your agent? [y/n]); --prompt prints it bare for piping into a clipboard tool: