CLI reference

Every ciresk ci command with its flags, its human output, its --json data and its exit code.

Every command is ciresk ci <command>; ciresk ci --help is the CLI's own help. Human output is a fixed layout per command; --json is the contract.

Global flags and environment

FlagMeaning
--jsonExactly one JSON document on stdout (see the envelope); progress still goes to stderr unless --quiet.
--region <eu|us>The region whose cell to call; the default comes from the token, then eu. Only eu is live today.
--api-url <url>The API origin; overrides the region, CIRESK_CI_API_URL and the config file. The default is https://ci.eu.ciresk.com.
--org <slug>The organization whose stored token to use; the default is org: in .ciresk/ci.yaml, then the only stored one.
--timeout <dur>Network timeout per request, default 30s.
--quietNo stderr progress.
-y, --yesSkip confirmations.
--color <when>auto (a tty without NO_COLOR), always or never; default auto.
--format <text|github>github makes a command that prints a job summary (run --wait, check, test, build, lint, wait, summary) report to a GitHub Actions step: failing-test annotations, the job summary and step outputs. See GitHub Actions. Not with --json.
--pass-tokenKeeps CIRESK_TOKEN and CIRESK_CI_TOKEN in the environment for CI and containers; without it the token comes from the OS keychain.
VariableMeaning
CIRESK_TOKEN, CIRESK_CI_TOKENA csk_ key or an exchanged cix_ token, for machines and sandboxes. The OS keychain (from auth login) is read first. Never printed. ciresk ci drops both from the environment unless --pass-token is given.
CIRESK_CI_API_URL, CIRESK_API_URLThe API origin, below --api-url and above ciresk ci config set server <url>.
CIRESK_JOBThe default for every [job] argument. run without --wait prints export CIRESK_JOB=job_... on stderr.
CIRESK_ACTOROverrides the detected actor (user, agent:claude-code, agent:codex, ...).
CIRESK_SESSIONAttributes a session to the job.
NO_COLORDisables color, as do a non-tty stdout and --json.

Commands

CommandSynopsisFlagsHuman output--json dataExit
runciresk ci run <kind> [targets...]-p <name>, --full, --wait, --follow, --max-wait <dur> (default 30m), --cancel-on-interrupt, --fail-fast, --no-fail-fast, --no-dedup, --actor <id>, --budget <units>, --label k=v, --idempotency-key <key>, --dry-run, --no-index, --no-watch, --no-warningsThe job: state, id, kind@branch, targets, trust, queue position; the summary when --waitJob; with --wait Summary; with --dry-run Plan0 queued (no --wait); otherwise mirrors the job
check, test, build, lintciresk ci check [targets...]Same as runAliases for run <kind> --waitSummaryMirrors the job
statusciresk ci status [job]--watchState, targets, trust, cost so far, task tableJob0 if the job exists, regardless of state
waitciresk ci wait [job]--max-wait <dur> (default 30m), --follow, --cancel-on-interrupt, --no-warningsSummary on completionSummaryMirrors the job; 7 when --max-wait elapses
logsciresk ci logs [job]--task <name>, --shard <k>, --all-shards, --all (failed tasks only by default), --tail <n> (default 200), --grep <re>, -C <n> (default 3), --range <off>:<len>, --from <line>, --lines <n>, --follow, --rawThe slice, then nextLogSlice0; 2 to 8 when the request fails
testsciresk ci tests [job]--all (failing only by default), --task <name>, --shard <k>, --limit <n> (default 50), --cursor <c>, --junit <path>One line per test: status, name, file:line, first message line{tests, total, failed_total, next_cursor}0
warningsciresk ci warnings [job]--task <name>, --kind <kind>, --limit <n> (default 50), --cursor <c>Counts by kind, then one line per warningWarnings0
artifactsciresk ci artifacts [job]--download <name>, --out <dir> (default .ciresk/<job>)Name, task, size, expiry{artifacts, downloaded}0
cancelciresk ci cancel [job]--reason <text>New state{id, state, cancelled}0 when cancelled or already terminal
approveciresk ci approve [job] --task <name>--reject, --comment <text>What was decided{job, decision, tasks, sod_exception}0 decided; 4 not a person, not an approver, signed in over 10 minutes ago, or the job's requester
approvalsciresk ci approvals--job <job>The gates waiting for a person, each with its approve line{approvals}0
summaryciresk ci summary [job]--tail <n> (default 50), --detailed, --no-warningsOne screen: verdict, failing tests, tail of the first failed task, nextSummaryMirrors the job
jobsciresk ci jobs--repo <id>, --ref <ref>, --state <state>, --actor <id>, --limit <n> (default 20), --cursor <c>One row per job: id, kind@branch, state, duration, cost, actorJobs0
budgetciresk ci budgetSession and day spend, limits, resets, policy flags{budget, policy, principal, actor}0
affectedciresk ci affected [--kind <kind>]--strategy <s>Not available yet: the cell answers 501 not_implementedAffected8
watchciresk ci watch--onceIndex and upload progress; with --once, one refresh then exitWatch0
initciresk ci init--force, --stack <name>Writes .ciresk/ci.yaml for the detected toolchainInit0; 2 when a manifest exists and neither --force nor --yes is given
doctorciresk ci doctor--rehashToken, API, tree, manifest, repository, index: one line each, with the fix when one failsDoctor0; otherwise the exit code of the first failing check
authciresk ci auth login|status|logoutlogin --token csk_..., login --no-browserNever prints tokensAuth (logged_in, region, org, ...)0 or 3
configciresk ci config set server <url>, config set region <eu|us>, config showThe stored settingConfig0
workers enrolciresk ci workers enrol--name <host>, --expires-in <dur>, --factory <id>The cwe_ secret (shown once) and the exact join line{factory_id, secret, expires_at, join}0; 4 without ci:workers.admin
workers addciresk ci workers add--name, --slots, --labels, --idle-stop, --secrets, --docker, --image, --waitInstalls, enrols and starts this Linux host as a worker; with --docker a docker run line and a compose snippetWorkersAdd0; 4 without ci:workers.admin
workers listciresk ci workers list--limit <n>, --cursor <c>State, version, free slots, last heartbeat per worker{workers, next_cursor}0
workers removeciresk ci workers remove <name|id>--no-drain, --wait <dur>, --keep-installDrains, deregisters and, on its own host, uninstalls a workerWorkersRemove0; 4 without ci:workers.admin
reposciresk ci repos list|get|deletedelete needs --yes off a terminalRepositories, one repository, or what a delete removedReposList, Repo, RepoDelete0; 4 without ci:repos.admin for delete
policyciresk ci policy get|set--repo <id|.>Every policy field with its value and sourcePolicy, PolicySet0; 2 for an unknown field or a wrong type
hookciresk ci hook pretooluseReads a Claude Code hook document on stdin and answers itHook output0
versionciresk ci versionThe CLI version, and the server's when a token is at hand{version, protocol_version, schema_version, server, api_url, compatible}0
updateciresk ci update--version <tag>, --checkUpdates the CI plugin through ciresk update when it can, otherwise downloads, verifies and swaps itself; old -> newUpdate0; 2 when the release is not published for the platform; 8 when the host cannot be reached or a verification fails

Examples:

Terminal
ciresk ci check                                  # the check task on the working tree, wait, summary
ciresk ci test -p platform-api --json | jq .data.failing_tests
ciresk ci run build --full --wait                # exit 4 unless policy allows and the token has ci:jobs.run_full
ciresk ci run test --actor agent:claude-code:$CLAUDE_CODE_SESSION_ID --budget 200
export CIRESK_JOB=$(ciresk ci run test --json | jq -r .data.id); ciresk ci wait; ciresk ci logs --grep 'panicked' -C 5
ciresk ci logs job_01a158... --task test --range 0:65536 --raw > test.log

The JSON envelope

Every --json output is {schema_version: 1, command: string, request_id: string|null, data: <type>, budget: Budget|null, next: string|null, truncated: bool}. Errors use the same envelope with error: Problem (the API's application/problem+json fields, see API errors) instead of data. schema_version increments only on an incompatible change; additive fields do not bump it, and clients must ignore unknown fields.

TypeFields
Jobid (job_), repo, repo_id (repo_), base_ref, base_digest (commit sha), diff_digest, kind, targets, full, trust, priority, state, deduplicated, principal, actor, client, session, created_at, started_at, finished_at, duration_ms, cost_units, exit_code, url, tasks
Taskname, shard (k/N), state, exit_code, started_at, finished_at, duration_ms, cost_units, worker_id, cache (hit, miss, write, none), log_bytes, has_junit, artifact_count
Summaryjob (without tasks), tasks, verdict (succeeded, failed, cancelled, timed_out, infra_error, running), failing_tests (max 20), failing_tests_total, first_failed_task, first_failure, warnings, tail, tail_task, critical_path, cache ({hits, misses, writes}), next
TestResultname, file, line, status (passed, failed, skipped, flaky), duration_ms, message (first 5 lines), stdout_tail (only with --detailed), task, shard
LogSlicejob_id, task, byte_offset, byte_length, total_bytes, next_byte_offset, truncated, failed_only, lines, text, hint
Artifactname, task, size_bytes, media_type, digest, url (presigned), expires_at
Budgetsession: Spend, day: Spend, concurrent: {used, limit}, resets_at, rate_table, month (when a monthly budget is set)
Spendspent_units, limit_units, remaining_units, jobs, jobs_limit
Policyallow_full_build, default_kind, max_concurrent_per_actor, trust, untrusted_refs
Principalkind (user, api_key, service), org_id, jurisdiction, credential (prefix only, csk_live_eu_abcd), scopes
Affectedbase_ref, diff_digest, kind, strategy, changed_files, targets, escalated, escalation_reason, estimated_cost_units

Ids are short and prefixed; human output shows kind@branch next to the id so a model does not carry UUIDs. All field names are snake_case; changes are additive only.

Size bounds

  • Human output of any command is at most 120 lines; summary aims at 2,000 tokens with a hard cap of 8,000, enforced by trimming failing_tests to 20, tail to its line limit and message to 5 lines, then halving tail until it fits.
  • logs returns at most 256 KiB per call; the default is the last 200 lines.
  • Every trimmed result says so in band: truncated: true in JSON and a final line [truncated: 118 of 640 lines; next: ciresk ci logs ... --range 65536:65536] in human output.
  • The next hint is the last line of human output and the next field in JSON: the exact command to run for the obvious drill-down.
  • --help is written for agents: examples first, then flags, then exit codes, under 60 lines per command.

Exit codes

Every exit code, what it is mapped from and what to do next is in Exit codes. A failed job never exits 0.