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 also places the daemon and scheduler hooks and enables the systemd unit; --write-config-only skips cluster orchestration and only writes the config file.
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.
analyze works as a spelling alias.
expanse diagnose
Solution-oriented guidance for a failed execution.
<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.
When the evidence supports a concrete fix, diagnose produces a patch artefact. On an interactive terminal it offers to show and apply the patch; otherwise inspect and apply it explicitly: