Skip to main content

CLI

Version
since 2.x, describes 2.52.14
Feature flag
none
For
Workspace user

cerebro is the command-line tool for workspace users. It gives login-node style access to a workspace from any machine: submit and watch scheduler jobs, start interactive sessions and get their URL, read a project's storage and quota, prepare a docker login for the container registry, and pull consumption reports. No SSH bastion is provisioned; the tool talks to the same API as the web app, authenticated with a workspace access token, and every permission decision is made by the API.

What it is for​

  • Working with the scheduler from your own machine or a cluster login node: jobs and sessions.
  • Reading a project's shared filesystem, block volumes and storage quota: storage.
  • Finding the registry host and your robot accounts to authenticate docker or podman: registry.
  • Pulling the workspace consumption report for a window as a table, JSON or CSV: reports.
  • Scripting: --json prints the API's own response on read commands, and every failure exits non-zero with one line on standard error.

The CLI follows the capabilities of the deployment it talks to. A command whose capability is switched off is answered by the API with 404 feature_disabled, which the CLI prints as "this feature is not enabled on this deployment - ask your administrator to enable it".

Installation​

The CLI is a single static binary for Linux on x86-64, with no runtime dependencies; no other build is published. It is licensed software, built and versioned with the platform, and there is no public download: it is provided with your deployment, on-demand by us and on-prem with the release your operators install. Copy it to a directory on your PATH.

cerebro --version
cerebro --help

Authentication and configuration​

The CLI authenticates with a workspace access token, created in the web app under Workspace settings, then Access tokens; see Access tokens. The token is sent as a bearer token on every request. The token is scoped to one workspace, which becomes the CLI's default workspace.

Log in​

cerebro auth login --endpoint https://<api endpoint> --token-file ./token
cerebro auth status
  • --endpoint is required on the first login and kept afterwards; a later auth login without it reuses the stored endpoint.
  • Give the token with --token-file <path> (recommended; the file content is trimmed), or paste it at the interactive prompt, which hides what you type. --token <value> is accepted but discouraged because the value lands in your shell history. --token and --token-file cannot be combined.
  • The token is checked locally for the shape of a workspace access token before anything is stored; a pasted fragment is rejected with "the token is not a valid workspace access token (not a JWT)".
  • Pass --workspace <id> to auth login to store a default workspace other than the token's own.
  • auth status prints the endpoint, workspace, user id, token id, permissions and expiry read from the token, then verifies the token against the server with one read. A token that is rejected by the server makes the command exit non-zero. The token itself is never printed; it is shown as <redacted>, also with --json.

Configuration file​

WhatValue
Location~/.config/cerebro/config.toml; if a user configuration directory is set for your session (the freedesktop convention), cerebro/config.toml inside it
Overridethe CEREBRO_CONFIG environment variable, holding the full path of the file (for tests or several profiles)
Contentendpoint, token, optional default_workspace
Permissions on Unixfile mode 0600, directory mode 0700. The file is written to a temporary sibling created with mode 0600, then renamed over the target, and the mode is checked after every save; a save that cannot guarantee 0600 fails
Other operating systemsthe file is written without permission guarantees and the hidden prompt is not available; use --token-file or --token

If the file is missing, every command answers no configuration at <path> - run cerebro auth login first.

Workspace resolution​

For every command the workspace is, in this order: the global --workspace <id> flag, then default_workspace from the configuration file, then the workspace the token was created for.

Commands​

Global flags​

FlagEffect
--workspace <id>Act on this workspace instead of the configured default. Accepted before or after the subcommand.
--jsonPrint the raw API JSON instead of tables, on read commands. On sessions start it prints the creation response and skips the readiness wait.
--version, --helpVersion of the binary; help for any command or subcommand.

cerebro auth​

CommandFlagsWhat it does
cerebro auth login--endpoint <url>, --token <value> or --token-file <path>, or an interactive hidden prompt; global --workspaceStores the endpoint and the token in the configuration file
cerebro auth status--jsonShows who the stored token authenticates as and verifies it against the server

cerebro jobs​

Batch scheduler jobs. Routes: GET and POST /api/v1/workspaces/{workspace_id}/scheduler/jobs, GET .../scheduler/jobs/{id}, POST .../scheduler/jobs/{id}/cancel.

CommandFlagsWhat it does
cerebro jobs submit--script <file> (required), --name <name> (default: the script's file name), --gpus <n> (default 0), --cpus <n> (default 0), --ram <GB> (default 0), --project <id>Submits the script as a batch job and prints its id, state and external id
cerebro jobs list--state <state> (for example pending, running, completed, failed, cancelled)Lists the workspace's jobs with ID, NAME, STATE, KIND, GPU, CPU, RAM_GB and SUBMITTED, plus the page position
cerebro jobs show <id>Shows one job; adds node, exit code, error, start and end when present
cerebro jobs cancel <id>Cancels a job and prints its new state
cerebro jobs logs <id>Always prints "job logs are not available via the API - they stay in the job's working directory on the cluster's shared filesystem" and exits non-zero

cerebro sessions​

Interactive (Jupyter) scheduler sessions. Routes: GET and POST /api/v1/workspaces/{workspace_id}/scheduler/sessions, POST .../scheduler/sessions/{id}/open, DELETE .../scheduler/sessions/{id}.

CommandFlagsWhat it does
cerebro sessions start--project <id>, --gpus <n> (default 0), --cpus <n> (default 0), --ram <GB> (default 0), --no-openStarts a session, then waits for it to become ready and prints its proxy URL. --no-open returns at once.
cerebro sessions listLists sessions with JOB_ID, NAME, STATE, NODE, PORT and EXPIRES
cerebro sessions open <id>Prints the proxy URL of a ready session
cerebro sessions stop <id>Requests the session to stop

cerebro storage​

Per-project storage. Route: GET /api/v1/workspaces/{workspace_id}/projects/{project_id}/storage.

CommandFlagsWhat it does
cerebro storage ls--project <id> (required)Lists the project's share and block volumes with ID, KIND, NAME, SIZE_GB, STATUS and ATTACHED_TO
cerebro storage quota--project <id> (required)Prints used and limit in GB at project and workspace level; a limit that is not set reads unlimited

cerebro registry​

Container registry access. Route: GET /api/v1/workspaces/{workspace_id}/registry.

CommandFlagsWhat it does
cerebro registry loginPrints the registry host, the workspace's registry project, the active robot accounts (NAME, ACCESS, CREATED) and the docker login template to use with a robot credential

cerebro reports​

Consumption reports. Route: GET /api/v1/workspaces/{workspace_id}/consumption; CSV is requested with the Accept: text/csv header.

CommandFlagsWhat it does
cerebro reports pull--from <date> (required), --to <date> (required), --csv <file>, --group-by project (default) or --group-by userPrints the report as a table with a TOTAL row (GROUP, GPU_S, CPU_S, JOB_RUNTIME_S, JOBS, INST_RUNTIME_S, INSTANCES, STORAGE_GB, REGISTRY_GB), as JSON with --json, or writes the CSV byte for byte to --csv

Token scopes​

CommandsScope needed on the access token
auth status, jobs list, jobs show, sessions list, storage ls, storage quota, registry login, reports pullnone beyond a valid workspace access token; these reads are open to every workspace member
jobs submit, jobs cancel, sessions start, sessions open, sessions stopmanage_scheduler_jobs: the Manage scheduler jobs checkbox when creating the token. The checkbox is shown only while the scheduler capability is switched on

A write without the scope is answered 403 no_permission, printed as "your access token does not carry the permission this action requires".

When a capability is switched off​

The CLI has no flags of its own; it follows the API. The scheduler commands need hpc_scheduler, storage needs project_storage, registry needs container_registry and reports needs consumption_reports. A command against a capability that is off gets 404 feature_disabled from the API and prints "this feature is not enabled on this deployment - ask your administrator to enable it". auth status treats that answer as proof that the token is valid, because an invalid token is rejected with 401 before any capability check, and reports "valid (scheduler feature disabled on this deployment)".

Documented behaviour​

  • jobs logs. The platform has no job-log route. The command prints a clear message and exits non-zero; logs stay in the job's working directory on the cluster's shared filesystem, for example slurm-<external id>.out. See Jobs and scheduling.
  • sessions start and sessions open. The proxy URL is minted by POST .../sessions/{id}/open, which records the proxy mapping on the server, so sessions list does not fetch URLs. sessions start polls the session state 10 times at 3-second intervals, about 30 seconds in total, and prints the URL as soon as the session is ready. If the session is still starting after the window, it prints "Still starting - run cerebro sessions open <id> once cerebro sessions list shows it ready to get the proxy URL." and exits normally; busy clusters can take minutes. If the session ends before becoming ready, it points you to cerebro jobs show <id>. --no-open skips the wait; --json prints the creation response without waiting.
  • registry login. Robot secrets are shown once, at creation, and can never be retrieved again. The CLI therefore neither creates nor prints credentials. It lists the active robot accounts, prints the registry host and the exact docker login <host> -u '<robot full name>' -p '<robot secret>' template, and tells you where to create a robot: the web app under Workspace settings, then Container registry, or POST /api/v1/workspaces/{workspace_id}/registry/robots. See Container registry.
  • reports pull dates. A date-only bound YYYY-MM-DD expands to a full inclusive day: --from becomes 00:00:00 and --to becomes 23:59:59. A full YYYY-MM-DD HH:MM:SS is passed through unchanged and validated by the server. CSV is fetched through content negotiation and written byte for byte. Window rules (UTC, maximum length) are on Reports and accounting.

Output and errors​

  • Read commands print fixed-width tables; --json prints the API body re-indented, with nothing added or removed.
  • A failure prints one line on standard error, prefixed error: , and exits with status 1. The API's reason codes are mapped to plain messages; a code the CLI does not know is printed as API error (<code>) so it can be looked up server-side.
API reason codeMessage
feature_disabledthis feature is not enabled on this deployment - ask your administrator to enable it
no_permissionyour access token does not carry the permission this action requires
authentication_failed_*, no_sessionauthentication failed - run cerebro auth login with a valid workspace access token
authentication_error_token_expiredyour access token has expired - create a new one in the web app and run cerebro auth login again
report_window_invalidinvalid report window - --from must not be after --to and the window may span at most one year
invalid_group_byinvalid --group-by - use project or user
expected_date_format*invalid date - use YYYY-MM-DD or "YYYY-MM-DD HH:MM:SS"
project_not_foundproject not found in this workspace
scheduler_cluster_unavailableno scheduler cluster is available - the platform has no active cluster configured
scheduler_session_not_foundsession not found in this workspace
scheduler_session_not_readythe session is not ready yet - wait for it to reach the ready state (cerebro sessions list)
session_proxy_unconfiguredthe platform has no session proxy configured - ask your administrator
registry_endpoint_unavailablethe container registry backend is unavailable - try again or ask your administrator
registry_project_missingthis workspace has no registry project yet - enable the registry in the web app first
quota_exceeded_*the request exceeds a resource quota, followed by the code
workspace_permission:*your workspace role is missing a permission, followed by the code
a transport failurecould not reach the API, followed by the transport error

Numbers​

WhatValue
Request timeout30 seconds per API request
sessions start readiness wait10 polls, 3 seconds apart, about 30 seconds
Default resources on jobs submit and sessions start0 GPUs, 0 CPUs, 0 GB RAM unless given
Configuration file permissions (Unix)0600 file, 0700 directory, checked after every save
Exit status on failure1

Limits and known behaviour​

  • The configuration security guarantees (0600 enforcement, hidden token prompt) are Unix-only in 2.48.6; the CLI targets cluster and login-node use. Other builds run, but write the file without permission guarantees and need --token-file or --token.
  • The token's claims are decoded locally without signature verification, for display and defaults only; every authorisation decision is made by the API on each request.
  • There is no instance management in the CLI (no create, reset or terminate of virtual machines or bare metal); use the web app or the API.
  • Job logs are not available through the CLI or the API.
  • sessions list shows node and port but no URL; use sessions open.
  • registry login does not log you in; it prints the command to run with a robot credential you already hold.
  • jobs list returns the first page of results; paging flags are not exposed, and the page position is printed under the table.
  • Unknown reason codes are printed verbatim rather than explained.
  • Planned: browser or device-flow login through the identity provider (OIDC with PKCE) instead of pasting a token. Not part of 2.48.6.