Skip to main content

CLI Reference

Auto-generated — do not edit. Run go run ./cmd/genschema to regenerate.

Global Flags

FlagTypeDefaultDescription
--citystringpath to the city directory (default: walk up from cwd)
--city-namestringremote city name for --city-url (does not overload --city)
--city-urlstringoperate a REMOTE city at this base URL (https; requires --city-name)
--contextstringoperate the REMOTE city named by this context (~/.gc/contexts.toml)
--json-schemastringemit JSON Schema for this command; optional value: result or failure
--rigstringrig name or path (default: discover from cwd)

gc

Gas City CLI — orchestration-builder for multi-agent workflows

gc [flags]
SubcommandDescription
gc agentManage agent configuration
gc agent-scriptRun a deterministic YAML agent script
gc analyzeRead-only analysis over events and beads
gc bdRun bd in the correct rig directory
gc beadsManage the beads provider
gc build-imageBuild a prebaked agent container image
gc citiesList registered cities
gc completionGenerate the autocompletion script for the specified shell
gc configInspect and validate city configuration
gc contextManage named remote cities (~/.gc/contexts.toml)
gc convergeManage convergence loops (bounded iterative refinement)
gc convoyManage convoys — graphs of related work
gc costsShow per-run usage and estimated cost for this city
gc dashboardOpen the web dashboard in your browser
gc doctorCheck workspace health
gc dolt-cleanupFind and remove orphaned Dolt databases (Go-side core)
gc eventEvent operations
gc eventsShow events from the GC API
gc extmsgManage external-conversation bindings
gc formulaManage and inspect formulas
gc githubGitHub integration commands
gc graphShow dependency graph for beads
gc handoffSend handoff mail and restart controller-managed sessions
gc helpHelp about any command
gc hookFind routed work for an agent
gc importManage pack imports
gc initInitialize a new city
gc lintValidate a pack before merge
gc loginLog in to a hosted Gas City service
gc logoutLog out of a hosted Gas City service (revoke the session and forget the token)
gc mailSend and receive messages between agents and humans
gc maintenanceDolt store maintenance (gc + snapshot)
gc mcpInspect projected MCP config
gc metricsInspect or control Gas City command usage metrics
gc nudgeInspect and deliver deferred nudges
gc orderManage orders (scheduled and event-driven dispatch)
gc packManage remote pack sources
gc primeOutput the behavioral prompt for an agent
gc promptAuthor and inspect agent prompt templates
gc readyList ready (claimable) work across every store in the city
gc registerRegister a city with the machine-wide supervisor
gc reloadReload the current city's config without restarting the city/controller
gc restartRestart all agent sessions in the city
gc resumeResume a suspended city
gc rigManage rigs (projects)
gc runtimeProcess-intrinsic runtime operations
gc serviceInspect workspace services
gc sessionManage interactive chat sessions
gc shellManage the Gas City shell integration hook
gc skillList visible skills
gc slingRoute work to a session config or agent
gc startStart the city under the machine-wide supervisor
gc statusShow city-wide status overview
gc stopStop all agent sessions in the city
gc storageInspect and migrate this city's storage-class layout
gc supervisorManage the machine-wide supervisor
gc suspendSuspend the city (all agents effectively suspended)
gc traceInspect and control session reconciler tracing
gc unregisterRemove a city from the machine-wide supervisor
gc versionPrint gc version
gc waitInspect and manage durable session waits
gc whoamiShow the authenticated hosted Gas City account
gc worktreeEnsure or verify agent workspace worktrees

gc agent

Manage agent configuration in city.toml.

Runtime operations (attach, list, peek, nudge, kill, start, stop, destroy) have moved to "gc session" and "gc runtime".

gc agent
SubcommandDescription
gc agent addAdd an agent scaffold
gc agent listList configured agents
gc agent resumeResume a suspended agent
gc agent suspendSuspend an agent (reconciler will skip it)

gc agent add

Add a new agent scaffold under agents/<name>/.

Creates agents/<name>/prompt.template.md and, when needed, agents/<name>/agent.toml. These files live in the city directory and do not append [[agent]] blocks to city.toml.

Use --prompt-template to copy prompt content from an existing file into the canonical prompt.template.md location. Schema-2 convention agents are city-scoped; define rig-scoped agents in pack config or [[patches.agent]]. Use --suspended to scaffold the agent in a suspended state.

gc agent add --name <name> [flags]

Example:

gc agent add --name mayor
gc agent add --name polecat
gc agent add --name worker --prompt-template ./worker.md --suspended
FlagTypeDefaultDescription
--dirstringLegacy working directory for schema-1 agents; schema-2 convention agents are city-scoped
--jsonboolOutput in JSONL format
--namestringName of the agent
--prompt-templatestringPath to prompt template file (relative to city root)
--suspendedboolRegister the agent in suspended state

gc agent list

List configured agents from the resolved city configuration.

Use --json to inspect agent routing fields, including effective work_query and sling_query values.

gc agent list [flags]
FlagTypeDefaultDescription
--jsonboolOutput in JSON format

gc agent resume

Resume a suspended agent by clearing suspended in its durable config.

The reconciler will start the agent on its next tick. Supports bare names (resolved via rig context) and qualified names (e.g. "myrig/worker").

gc agent resume <name> [flags]
FlagTypeDefaultDescription
--jsonboolOutput in JSONL format

gc agent suspend

Suspend an agent by setting suspended=true in its durable config.

Suspended agents are skipped by the reconciler — their sessions are not started or restarted. Existing sessions continue running but won't be replaced if they exit. Use "gc agent resume" to restore.

gc agent suspend <name> [flags]
FlagTypeDefaultDescription
--jsonboolOutput in JSONL format

gc agent-script

Run a deterministic YAML agent script for examples and demos.

The runner probes gc hook once, selects the matching turn, and executes the configured actions. It is intentionally small and generic: role behavior stays in the YAML script.

Status: experimental. Gas City owns this runner so repository examples can be tested without external helper binaries; the YAML action surface may change until a stable SDK boundary exists.

For k8s-backed agent-script agents, set lifecycle = "one_shot" in the agent config so the runtime treats a clean script exit as expected work completion instead of startup death.

gc agent-script --script <path> [flags]
FlagTypeDefaultDescription
--scriptstringagent script YAML file

gc analyze

Analyze produces correlated reports over the events log and bead state. All subcommands are read-only and safe to run alongside a live controller.

gc analyze
SubcommandDescription
gc analyze reliabilityCorrelate session-lifecycle events with model/version/rig

gc analyze reliability

Reliability reports per-(model, prompt_version, rig) counts of the tracked session-lifecycle events:

session.crashed session.quarantined (reserved; current production paths do not emit it) session.idle_killed session.draining

Worker.operation events from #1252 supply the (model, prompt_version, agent_name) tuple per session. Lifecycle events get attributed via the session id or producer aliases from worker.operation payloads. Sessions with worker.operation events but no lifecycle events count toward the per-group total — they're the denominator side of crash-rate calculations. Model and prompt_version are best-effort dimensions; the report warns when the source event stream is missing them.

Read-only: this command never writes events or beads.

gc analyze reliability [flags]
FlagTypeDefaultDescription
--citystringcity directory (default: discover from cwd)
--eventsstringexplicit events.jsonl path (overrides city discovery)
--jsonboolemit JSON instead of a table
--modelstringfilter to a specific model
--rigstringfilter to a specific rig
--sincestring7dstart of the analysis window — duration (1h, 7d) or RFC3339 timestamp
--untilstringend of the analysis window — duration (0s = now, 30m = 30 minutes ago) or RFC3339 timestamp

gc bd

Run a bd command routed to the correct rig directory.

When beads belong to a rig (not the city root), bd must run from the rig directory to find the correct .beads database. This command resolves the rig automatically from the --rig flag or by detecting the bead prefix in the arguments.

Use --rig <name> to pin a specific rig store, or --city <path> to pin the city (HQ) store. An explicit --city is a true scope override: it forces the city store and disables rig auto-detection (GC_RIG, cwd, bead prefix), so a deliberate city-scoped query is never silently downgraded to a rig store.

On a city that serves a coordination class from its own [storage] binding, a by-id read or write of a bead that binding owns is answered in process from the binding, not by bd against a work store that does not hold it. --rig is refused for those beads rather than ignored or honored: it names a work scope, and a relocated class is not partitioned by rig, so there is nothing to narrow within. Drop --rig for a class-owned id. Auto-detected scope (GC_RIG, -C, cwd) is unaffected, and --city still selects which city's binding answers.

"gc bd ready" is refused outright on such a city, whatever arguments it is given, and so is "gc bd list --ready", which bd documents as the same semantics: both compute a frontier over one ledger and take no selector that could reach another, so the answer is the work-class subset of the city's ready set with no way to tell. Use "gc ready", which federates every store the city spreads work across. It is flag-compatible with the "bd ready" invocation the generated work query builds, not with all of "bd ready" — "gc ready --help" lists what it takes. A city that relocates no class is unaffected.

All arguments after "gc bd" are forwarded to bd unchanged. "heartbeat <issue-id>" forwards to bd's native heartbeat, which refreshes the claim's lease and fails loudly when the caller no longer owns it. gc adds one subcommand of its own: "release-if-current <issue-id> <assignee>", which conditionally resets an in-progress assignment only when the bead still has that assignee.

gc bd forces BD_EXPORT_AUTO=false to prevent bd's git auto-export hook from wedging the wrapper after printing command output. If you need auto-export behavior, invoke bd directly.

gc bd [bd-args...]

Example:

gc bd --rig my-project list
gc bd --rig my-project create "New task"
gc bd show my-project-abc          # auto-detects rig from bead prefix
gc bd list --rig my-project -s open
gc bd --city /path/to/city list    # pins the city (HQ) store, no rig auto-detect
gc bd heartbeat my-project-abc     # refresh the claim lease you hold
gc bd release-if-current my-project-abc worker-1

gc beads

Manage the beads provider (backing store for issue tracking).

Subcommands for topology operations, health checking, diagnostics, exact-store metadata compare-and-set, and read-only list/show routed through the supervisor API with transparent fallback to direct bd reads.

gc beads
SubcommandDescription
gc beads cityManage canonical city endpoint topology
gc beads healthCheck beads provider health
gc beads listList beads (API-routed with bd fallback)
gc beads metadata-casAtomically compare and set one metadata key in an exact local store
gc beads showShow a single bead (API-routed with bd fallback)

gc beads city

Manage the canonical city endpoint topology for bd-backed beads stores.

Use use-managed to make the city GC-managed again. Use use-external to pin the city to an external Dolt endpoint and rewrite inherited rig mirrors.

gc beads city
SubcommandDescription
gc beads city use-externalSet the city endpoint to an external Dolt server
gc beads city use-managedSet the city endpoint to GC-managed

gc beads city use-external

Set the city endpoint to an external Dolt server

gc beads city use-external [flags]
FlagTypeDefaultDescription
--adopt-unverifiedboolrecord the endpoint without live validation
--dry-runboolshow the canonical changes without writing files
--hoststringexternal Dolt host
--portstringexternal Dolt port
--userstringexternal Dolt user

gc beads city use-managed

Set the city endpoint to GC-managed

gc beads city use-managed [flags]
FlagTypeDefaultDescription
--dry-runboolshow the canonical changes without writing files

gc beads health

Check beads provider health and attempt recovery on failure.

Delegates to the provider's lifecycle health operation. For exec providers (including bd/dolt), the script handles multi-tier checking and recovery internally. For the file provider, always succeeds (no-op).

Also used by the beads-health system order for periodic monitoring.

gc beads health [flags]

Example:

gc beads health
gc beads health --quiet
gc beads health --json
FlagTypeDefaultDescription
--jsonboolemit JSON result
--quietboolsilent on success, stderr on failure

gc beads list

List beads across all rigs, routed through the supervisor API when the controller is alive and falling back to a direct multi-store read otherwise.

Supports --label, --status, --all, and --format. --format=json emits JSON (API-path JSON includes _cache_age_s; fallback-path JSON omits it). The bare --json flag is reserved by the CLI's JSON-contract layer and is not wired for this command; use --format=json.

gc beads list [flags]

Example:

gc beads list
gc beads list --label ready-to-build
gc beads list --status open --format=json
FlagTypeDefaultDescription
--allboolinclude closed beads (default: all nonclosed statuses)
--formatstringtextoutput format: text or json
--labelstringfilter to beads carrying this label
--statusstringfilter to beads in this status

gc beads metadata-cas

Atomically compare and set one metadata key in one exact local bead store.

The store must be selected explicitly with --store-ref=city:<name> or --store-ref=rig:<name>. This command never scans other stores, follows a cross-store fallback, or operates on a remote city. A conflict is an ordinary zero-exit outcome; capability, transport, readback, and validation failures are non-zero.

Legacy file-provider cities created before scope-local file stores may map city and rig references to the same shared city file. That provider-layout alias is preserved for compatibility; it is not a search or cross-store fallback.

Use --json for the canonical machine-output contract. --format=json remains accepted for compatibility. Combining --json with an explicit --format=text is a usage error.

gc beads metadata-cas <bead-id> [flags]

Example:

gc beads metadata-cas tr-123 \
  --store-ref=rig:tributary \
  --key=semantic_review_sha \
  --expected=old-sha \
  --next=new-sha \
  --json
FlagTypeDefaultDescription
--expectedstringexpected current value (explicit empty is allowed)
--formatstringtextoutput format: text or json
--jsonboolemit the canonical JSON result
--keystringmetadata key to compare and set
--nextstringreplacement value (explicit empty is allowed)
--store-refstringexact local store: city:<name> or rig:<name>

gc beads show

Show one bead by ID, routed through the supervisor API when the controller is alive and falling back to a direct multi-store lookup otherwise.

Supports --format. --format=json emits JSON (API-path JSON includes _cache_age_s; fallback-path JSON omits it). The bare --json flag is reserved by the CLI's JSON-contract layer and is not wired for this command; use --format=json.

gc beads show <bead-id> [flags]

Example:

gc beads show ga-abc
gc beads show ga-abc --format=json
FlagTypeDefaultDescription
--formatstringtextoutput format: text or json

gc build-image

Assemble a Docker build context from city config, prompts, formulas, and rig content, then build a container image with everything pre-staged.

Pods using the prebaked image skip init containers and file staging, reducing startup from 30-60s to seconds. Configure with prebaked = true in [session.k8s].

Secrets (Claude credentials) are never baked — they stay as K8s Secret volume mounts at runtime.

gc build-image [city-path] [flags]

Example:

# Build context only (no docker build)
gc build-image ~/bright-lights --context-only

# Build and tag image
gc build-image ~/bright-lights --tag my-city:latest

# Build with rig content baked in
gc build-image ~/bright-lights --tag my-city:latest --rig-path demo:/path/to/demo

# Build and push to registry
gc build-image ~/bright-lights --tag registry.io/my-city:latest --push
FlagTypeDefaultDescription
--base-imagestringgc-agent:latestbase Docker image
--context-onlyboolwrite build context without running docker build
--jsonboolemit JSON summary
--pushboolpush image after building
--rig-pathstringSlicerig name:path pairs (repeatable)
--tagstringimage tag (required unless --context-only)

gc cities

List all cities registered with the machine-wide supervisor.

gc cities [flags]
FlagTypeDefaultDescription
--jsonboolOutput one JSONL result record
SubcommandDescription
gc cities listList registered cities

gc cities list

List registered cities

gc cities list [flags]
FlagTypeDefaultDescription
--jsonboolOutput one JSONL result record

gc completion

Generate the autocompletion script for gc for the specified shell. See each sub-command's help for details on how to use the generated script.

gc completion
SubcommandDescription
gc completion bashGenerate the autocompletion script for bash
gc completion fishGenerate the autocompletion script for fish
gc completion powershellGenerate the autocompletion script for powershell
gc completion zshGenerate the autocompletion script for zsh

gc completion bash

Generate the autocompletion script for the bash shell.

This script depends on the 'bash-completion' package. If it is not installed already, you can install it via your OS's package manager.

To load completions in your current shell session:

source <(gc completion bash)

To load completions for every new session, execute once:

Linux:

gc completion bash > /etc/bash_completion.d/gc

macOS:

gc completion bash > $(brew --prefix)/etc/bash_completion.d/gc

You will need to start a new shell for this setup to take effect.

gc completion bash
FlagTypeDefaultDescription
--no-descriptionsbooldisable completion descriptions

gc completion fish

Generate the autocompletion script for the fish shell.

To load completions in your current shell session:

gc completion fish | source

To load completions for every new session, execute once:

gc completion fish > ~/.config/fish/completions/gc.fish

You will need to start a new shell for this setup to take effect.

gc completion fish [flags]
FlagTypeDefaultDescription
--no-descriptionsbooldisable completion descriptions

gc completion powershell

Generate the autocompletion script for powershell.

To load completions in your current shell session:

gc completion powershell | Out-String | Invoke-Expression

To load completions for every new session, add the output of the above command to your powershell profile.

gc completion powershell [flags]
FlagTypeDefaultDescription
--no-descriptionsbooldisable completion descriptions

gc completion zsh

Generate the autocompletion script for the zsh shell.

If shell completion is not already enabled in your environment you will need to enable it. You can execute the following once:

echo "autoload -U compinit; compinit" >> ~/.zshrc

To load completions in your current shell session:

source <(gc completion zsh)

To load completions for every new session, execute once:

Linux:

gc completion zsh > "${fpath[1]}/_gc"

macOS:

gc completion zsh > $(brew --prefix)/share/zsh/site-functions/_gc

You will need to start a new shell for this setup to take effect.

gc completion zsh [flags]
FlagTypeDefaultDescription
--no-descriptionsbooldisable completion descriptions

gc config

Inspect, validate, and debug the resolved city configuration.

The config system supports multi-file composition with includes, packs, patches, and overrides. Use "show" to dump the resolved config and "explain" to see where each value originated.

gc config
SubcommandDescription
gc config explainShow resolved config with provenance annotations
gc config showDump the resolved city configuration as TOML

gc config explain

Show the resolved configuration with provenance.

For agents (default): displays every resolved field with an annotation showing which config file provided the value. Use --rig and --agent to filter.

For providers (--provider): displays the resolved ProviderSpec along with per-field and per-map-key attribution — which chain layer (builtin:X or providers.Y) contributed each value. Useful for debugging base-chain inheritance.

Use --json to emit machine-readable output (providers only).

gc config explain [flags]

Example:

gc config explain
gc config explain --agent mayor
gc config explain --rig my-project
gc config explain --provider codex-max
gc config explain --provider codex-max --json
gc config explain -f overlay.toml --agent polecat
FlagTypeDefaultDescription
--agentstringfilter to a specific agent name
-f, --filestringArrayadditional config files to layer (can be repeated)
--jsonboolemit JSON (requires --provider)
--providerstringexplain a provider's resolved chain instead of agents
--rigstringfilter to agents in this rig

gc config show

Dump the fully resolved city configuration as TOML.

Loads city.toml with all includes, packs, patches, and overrides, then outputs the merged result. Use --validate to check for errors without printing. Use --provenance to see which file contributed each config element. Use -f to layer additional config files.

gc config show [flags]

Example:

gc config show
gc config show --validate
gc config show --provenance
gc config show --json
gc config show -f overlay.toml
FlagTypeDefaultDescription
-f, --filestringArrayadditional config files to layer (can be repeated)
--jsonboolemit JSON
--provenanceboolshow where each config element originated
--validateboolvalidate config and exit (0 = valid, 1 = errors)

gc context

Manage the client-side registry of named remote cities.

A context names a remote city the gc CLI can operate over the HTTP+SSE control plane: its URL, the remote city name, and an optional credential command. Select a context per-invocation with --context <name>, or set a sticky default with 'gc context use <name>' (a discoverable local city always wins over the default).

gc context
SubcommandDescription
gc context addAdd a named remote city
gc context currentShow which city the current flags/env/cwd would target
gc context listList named remote cities
gc context removeRemove a named remote city
gc context showShow a named remote city
gc context useSet the sticky default context

gc context add

Add a named remote city to ~/.gc/contexts.toml.

--url is required and must be https for a non-loopback host. --city sets the remote city name (defaults to <name>). At most one credential technique applies: --grant-command mints an X-GC-City-Write grant for a direct hardened self-host; --credential-command mints a transport bearer consumed by an edge/proxy.

gc context add <name> [flags]
FlagTypeDefaultDescription
--ca-filestringPEM CA bundle to verify the server certificate
--citystringremote city name (default: <name>)
--credential-audiencestringcredential provider audience (provider mode)
--credential-commandstringcommand that mints a transport bearer (edge/proxy fronted)
--credential-orgstringoptional credential provider organization (provider mode)
--credential-required-scopesstringJSON array of required credential scopes (provider mode)
--grant-commandstringcommand that mints an X-GC-City-Write grant (direct hardened self-host)
--insecure-skip-verifyboolskip TLS verification (dev only)
--timeoutstringREST request timeout, e.g. 120s (never applied to SSE streams)
--tls-server-namestringoverride the TLS SNI / certificate name
--urlstringremote city base URL (https required for non-loopback)

gc context current

Dry-run the target resolver and report the winning tier.

Applies the same precedence as every command — explicit flag > explicit env > local city discovery > sticky default — and prints the target it would use, noting what was shadowed. Makes no network call.

gc context current

gc context list

List named remote cities

gc context list [flags]
FlagTypeDefaultDescription
--jsonboolemit one JSONL record per context

gc context remove

Remove a named remote city

gc context remove <name>

gc context show

Show a named remote city

gc context show <name> [flags]
FlagTypeDefaultDescription
--jsonboolemit a JSONL record

gc context use

Set the sticky default remote city.

The default is used only when no local city is discoverable from the current directory — a local city always wins (git-like). Clear it with 'gc context use' with no arguments is not supported; remove the default by removing the context.

gc context use <name>

gc converge

Convergence loops are bounded multi-step refinement cycles.

A root bead + formula + gate = repeat until the gate passes or max iterations are reached. The controller processes wisp_closed events and drives the loop automatically.

gc converge
SubcommandDescription
gc converge approveApprove and close a convergence loop (manual gate)
gc converge createCreate a convergence loop
gc converge iterateForce next iteration (manual gate)
gc converge listList convergence loops
gc converge retryRetry a terminated convergence loop
gc converge statusShow convergence loop status
gc converge stopStop a convergence loop
gc converge test-gateDry-run the gate condition (no state changes)
gc converge test-triggerDry-run the trigger condition (no state changes)

gc converge approve

Approve and close a convergence loop (manual gate)

gc converge approve <bead-id> [flags]
FlagTypeDefaultDescription
--jsonboolOutput JSONL summary

gc converge create

Create a convergence loop

gc converge create [flags]
FlagTypeDefaultDescription
--evaluate-promptstringCustom evaluate prompt (overrides formula default)
--formulastringFormula to use (required)
--gatestringmanualGate mode: manual, condition, hybrid
--gate-conditionstringPath to gate condition script
--gate-timeoutstring5m0sGate execution timeout
--gate-timeout-actionstringiterateAction on gate timeout: iterate, retry, manual, terminate
--jsonboolOutput JSONL summary
--max-iterationsint5Maximum iterations
--targetstringTarget agent (required)
--titlestringConvergence loop title
--triggerstringIteration trigger mode: event (gate each iteration on --trigger-condition). Empty disables.
--trigger-conditionstringPath to trigger condition script (required when --trigger=event)
--varstringArrayTemplate variable (key=value, repeatable)

gc converge iterate

Force next iteration (manual gate)

gc converge iterate <bead-id> [flags]
FlagTypeDefaultDescription
--jsonboolOutput JSONL summary

gc converge list

List convergence loops

gc converge list [flags]
FlagTypeDefaultDescription
--allboolInclude closed/terminated loops
--all-rigsboolList loops from city/HQ and every bound rig
--jsonboolOutput as JSON
--statestringFilter by state (active, waiting_manual, terminated)

gc converge retry

Retry a terminated convergence loop

gc converge retry <bead-id> [flags]
FlagTypeDefaultDescription
--jsonboolOutput JSONL summary
--max-iterationsintOverride max iterations (default: inherit from source)

gc converge status

Show convergence loop status

gc converge status <bead-id> [flags]
FlagTypeDefaultDescription
--jsonboolOutput as JSON

gc converge stop

Stop a convergence loop

gc converge stop <bead-id> [flags]
FlagTypeDefaultDescription
--jsonboolOutput JSONL summary

gc converge test-gate

Dry-run the gate condition (no state changes)

gc converge test-gate <bead-id> [flags]
FlagTypeDefaultDescription
--jsonboolOutput JSONL summary

gc converge test-trigger

Dry-run the trigger condition (no state changes)

gc converge test-trigger <bead-id> [flags]
FlagTypeDefaultDescription
--jsonboolOutput JSONL summary

gc convoy

Manage convoys — graphs of related work beads.

A convoy is a named graph of beads with dependencies. Convoys group related issues via tracks dependencies.

Convoys are distinct from workflows — the DAGs compiled from v2 formulas and managed by the dispatch subsystem. The convoy lifecycle subcommands (create, list, status, target, add, close, check, stranded, land) do not operate on workflow roots; the dispatch subcommands (control, delete, delete-source, reopen-source) manage workflow trees and their control beads.

gc convoy
SubcommandDescription
gc convoy addAdd an issue to a convoy
gc convoy checkAuto-close convoys where all issues are closed
gc convoy closeClose a convoy
gc convoy controlExecute control beads or run the control-dispatcher loop
gc convoy createCreate a convoy and optionally track issues
gc convoy deleteClose or delete a convoy and all its beads
gc convoy delete-sourceClose workflows sourced from a bead
gc convoy landLand an owned convoy (terminate + cleanup)
gc convoy listList open convoys with progress
gc convoy reopen-sourceReopen a source bead after workflow cleanup
gc convoy statusShow detailed convoy status
gc convoy strandedFind convoys with ready work but no workers
gc convoy targetSet the target branch on a convoy

gc convoy add

Link an existing issue bead to a convoy.

Adds a tracks dependency from the convoy to the issue, making it appear in the convoy's progress tracking without changing the issue parent.

gc convoy add <convoy-id> <issue-id> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL result

gc convoy check

Scan open convoys and auto-close any where all child issues are resolved.

Evaluates each open convoy's children. If all children have status "closed", the convoy is automatically closed and an event is recorded.

gc convoy check [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL result

gc convoy close

Close a convoy bead manually.

Marks the convoy as closed regardless of child issue status. Use "gc convoy check" to auto-close convoys where all issues are resolved.

gc convoy close <id> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL result

gc convoy control

Process a single control bead, or run the control-dispatcher loop with --serve to continuously process ready control beads. Use --follow <agent> to filter the serve loop to a specific agent template.

gc convoy control [bead-id] [flags]
FlagTypeDefaultDescription
--followstringRun serve loop filtered to a specific agent template
--serveboolRun the control-dispatcher loop (continuous)

gc convoy create

Create a convoy and optionally link existing issues to it.

Creates a convoy bead and tracks any provided issue IDs. Issues can also be added later with "gc convoy add".

gc convoy create <name> [issue-ids...] [flags]

Example:

gc convoy create sprint-42
gc convoy create sprint-42 issue-1 issue-2 issue-3
gc convoy create deploy --owner mayor --notify mayor --merge mr
gc convoy create auth-rewrite --owned --target integration/auth-rewrite
FlagTypeDefaultDescription
--jsonboolemit JSONL result
--mergestringmerge strategy: direct, mr, local
--notifystringnotification target on completion
--ownedboolmark convoy as owned (manual lifecycle, no auto-close)
--ownerstringconvoy owner (who manages it)
--targetstringtarget branch inherited by child work beads

gc convoy delete

Close all open beads in a convoy, or delete them.

Searches all stores (city + rigs) for the convoy root and all beads with matching gc.root_bead_id. Without --force, shows a preview.

By default, beads are closed with gc.outcome=skipped. Use --delete to remove them from the store via bd delete --cascade --force.

gc convoy delete <convoy-id> [flags]
FlagTypeDefaultDescription
--deleteboolDelete beads from the store instead of closing
-f, --forceboolActually close/delete (without this, shows preview)

gc convoy delete-source

Find every live workflow root sourced from the given bead and close its subtree. By default this is a preview. Use --apply to mutate. Use --delete with --apply to also delete closed beads.

gc convoy delete-source <source-bead-id> [flags]
FlagTypeDefaultDescription
--applyboolActually close/delete matched workflows
--deleteboolAlso delete beads from the store after closing
--rigstringSelect the rig store for the source bead
--store-refstringSelect the source bead store (city:<name> or rig:<name>)

gc convoy land

Land an owned convoy, verifying all children are closed.

Landing is the natural lifecycle termination for owned convoys created via "gc sling --owned". It verifies all children are closed (or uses --force), closes the convoy bead, and records a ConvoyClosed event.

gc convoy land <convoy-id> [flags]

Example:

gc convoy land gc-42
gc convoy land gc-42 --force
gc convoy land gc-42 --dry-run
FlagTypeDefaultDescription
--dry-runboolpreview what would happen
--forceboolland even with open children
--jsonboolemit JSONL result

gc convoy list

List all open convoys with completion progress.

Shows each convoy's ID, title, and the number of closed vs total child issues.

gc convoy list [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL result

gc convoy reopen-source

Reopen a source bead after workflow cleanup

gc convoy reopen-source <source-bead-id> [flags]
FlagTypeDefaultDescription
--rigstringSelect the rig store for the source bead
--store-refstringSelect the source bead store (city:<name> or rig:<name>)

gc convoy status

Show detailed status of a convoy and all its child issues.

Displays the convoy's ID, title, status, completion progress, and a table of all child issues with their status and assignee.

gc convoy status <id> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL result

gc convoy stranded

Find open issues in convoys that have no assignee.

Lists issues that are ready for work but not claimed by any agent. Useful for identifying bottlenecks in convoy processing.

gc convoy stranded [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL result

gc convoy target

Set the target branch metadata on a convoy.

Child work beads can inherit this target branch when slung with feature-branch formulas such as mol-polecat-work.

gc convoy target <convoy-id> <branch> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL result

gc costs

Aggregate recorded usage facts (model tokens and compute wall-seconds) by run for local cost insight.

Reads .gc/usage.jsonl (the local usage sink) and groups facts by run id. This reflects facts only under the default "local" usage provider; with an "exec:" or "discard" provider the facts are forwarded out of process or dropped, so gc costs shows nothing local.

Cost is a list-price estimate for decision support, not an authoritative charge; invocations with no pricing are flagged "unpriced" and excluded from the cost total.

gc costs

Example:

gc costs

gc dashboard

Open the GC dashboard in your browser.

The dashboard SPA is embedded in the gc binary and served same-origin by the supervisor; it is no longer a separate static server. This command resolves the supervisor URL, opens it in your default browser, and prints it too (or tells you how to start the supervisor). Use --no-open to print the URL without launching a browser.

gc dashboard [flags]
FlagTypeDefaultDescription
--apistringGC API server URL override (auto-discovered by default)
--no-openboolprint the dashboard URL instead of opening a browser
SubcommandDescription
gc dashboard servePrint where the web dashboard is served

gc dashboard serve

Report the URL where the GC dashboard is served.

The dashboard SPA is embedded in the gc binary and served same-origin by the supervisor; "gc dashboard serve" no longer starts a static server. It resolves and prints the supervisor URL (or tells you how to start the supervisor).

gc dashboard serve [flags]
FlagTypeDefaultDescription
--apistringGC API server URL override (auto-discovered by default)
--no-openboolprint the dashboard URL instead of opening a browser

gc doctor

Run diagnostic health checks on the city workspace.

Checks city structure, config validity, binary dependencies (tmux, git, bd, dolt), controller status, agent sessions, zombie/orphan sessions, bead stores, Dolt server health, event log integrity, formula compiler requirements (deprecated contract = "graph.v2" opt-ins, missing [requires] formula_compiler = ">=2.0.0" declarations, and requirements the host's [daemon] formula_v2 setting cannot satisfy), v2 config deprecations such as legacy [formulas].dir, and per-rig health. Use --fix for the canonical remediation path, including any safe mechanical legacy-to-current pack rewrites that are available on this branch.

gc doctor [flags]

Example:

gc doctor
gc doctor --fix
gc doctor --verbose
gc doctor --json
FlagTypeDefaultDescription
--check-timeoutduration1m0sper-check time budget; a check or its --fix remediation exceeding it is abandoned and reported as timed out (0 disables)
--fixboolattempt automatic repairs and safe mechanical migrations
--jsonboolemit structured JSON instead of human-readable output
-v, --verboseboolshow extra diagnostic details

gc dolt-cleanup

gc dolt-cleanup is the Go-side implementation of the operational Dolt cleanup tool. It resolves the Dolt server port via the AD-04 chain (--port > city dolt.port > <rigRoot>/.beads/dolt-server.port > 3307), drops stale test/agent databases, calls DOLT_PURGE_DROPPED_DATABASES to reclaim disk, and reaps orphaned dolt sql-server processes left over from leaked test harnesses. Invalid explicit ports and unreadable or invalid city/rig port settings fail closed before cleanup stages run; only absent rig port files can reach the legacy default. The legacy default is a connection fallback only; it does not protect port 3307 from orphan-process reaping.

Dry-run by default. Pass --force to actually drop, purge, and kill. Pass --max-orphan-dbs with --force to refuse all destructive cleanup stages if the live apply-time stale database count exceeds the scan-time threshold. The default 0 disables this guard; negative values are rejected before any city lookup or cleanup stage runs. Protection is conservative and checked first: active rig dolt servers (matched by listening port), registered rig databases, and active test temp roots are always protected, and any process whose state cannot be determined degrades to protected. A dolt sql-server is reaped only when its scope is provably gone — its working directory is an unlinked inode (the kernel "(deleted)" cwd marker), or its --config path is on the test-config-path allowlist (/tmp/Test*, os.TempDir()/Test*, known Gas City test prefixes, ~/.gotmp/Test*). A server whose --config has merely vanished while its working directory is still live is protected, not reaped, until an operator confirms; a lone missing-config observation is not proof of scope deletion. See the PROTECTED section of the report. Destructive drops are limited to known stale test database name shapes and conservative SQL identifier characters; skipped stale matches are reported in dropped.skipped. Rig dolt_database names used for purge must use the same identifier shape: ASCII letters, digits, underscores, and non-leading hyphens. Missing or silent rig metadata disables forced drop/purge because the live database name cannot be proven safe.

JSON envelope schema is stable: gc.dolt.cleanup.v1. Automation that uses --json must inspect summary.errors_total and errors, and must also refuse to invoke --force when dry-run force_blockers is non-empty. force_blockers reports conditions that would block forced cleanup without incrementing errors_total. The rig-protection blocker is intentionally global: missing or silent rig metadata prevents forced drop/purge because the command cannot prove all registered rig databases are protected. Cleanup stage errors are reported in the envelope even when the command can still return successfully after emitting the report.

gc dolt-cleanup [flags]
FlagTypeDefaultDescription
--forceboolactually drop, purge, and kill orphaned resources (default: dry-run)
--jsonboolemit JSON envelope (gc.dolt.cleanup.v1)
--max-orphan-dbsintwith --force, refuse cleanup when live stale database count exceeds this limit
--portstringoverride the resolved Dolt port
--probeboolTCP-probe the resolved port; fail if unreachable

gc event

Event operations

gc event
SubcommandDescription
gc event emitEmit an event to the city event log

gc event emit

Record a custom event to the city event log.

Best-effort: always exits 0 so bead hooks never fail. Supports attaching arbitrary JSON payloads. JSON summaries report whether submission to the configured provider was attempted; the event bus does not acknowledge durable persistence.

gc event emit <type> [flags]
FlagTypeDefaultDescription
--actorstringActor name (default: $GC_ALIAS, else $GC_AGENT, else $GC_SESSION_ID, else "human")
--bead-payloadstringBest-effort bead ID fallback for hook payloads
--jsonboolemit JSON summary
--messagestringEvent message
--payloadstringJSON payload to attach to the event
--subjectstringEvent subject (e.g. bead ID)

gc events

Show events from the GC API with optional filtering.

The API is the source of truth for both city-scoped and supervisor-scoped events. In a city directory (or with --city), this command reflects the city's /v0/city/{cityName}/events and /stream endpoints. Without a city in scope, it reflects the supervisor's /v0/events and /stream endpoints.

List, watch, and follow output are always JSON Lines. Each line is one API DTO or SSE envelope.

gc events [flags]

Example:

gc events
gc events --type bead.created --since 1h
gc events --watch --type convoy.closed --timeout 5m
gc events --follow
gc events --seq
gc events --follow --after-cursor city-a:12,city-b:9
FlagTypeDefaultDescription
--afteruint64Resume from this city event sequence number (city scope only)
--after-cursorstringResume from this supervisor event cursor (supervisor scope only)
--apistringGC API server URL override (auto-discovered by default)
--followboolContinuously stream events as they arrive
--payload-matchstringArrayFilter by payload field (key=value or key.subkey=value, repeatable)
--seqboolPrint the current head cursor and exit
--sincestringShow events since duration ago (e.g. 1h, 30m)
--timeoutstring30sMax wait duration for --watch (e.g. 30s, 5m)
--typestringFilter by event type (e.g. bead.created)
--watchboolBlock until matching events arrive (exits after first match or buffered replay)
SubcommandDescription
gc events reemit-executionProject one graph execution run into event facts
gc events rotateForce rotate the city event log

gc events reemit-execution

Project exactly one stopped local graph.v2 execution run into execution facts.

The default is a dry run. Pass --apply to append the projected snapshot to the default city event log.

gc events reemit-execution --city <city> --run <run> [--apply] [flags]
FlagTypeDefaultDescription
--applyboolappend projected facts to the default file event log
--runstringgraph.v2 workflow root ID to project

gc events rotate

Force rotate the city event log through the running supervisor.

Output is one JSON line. Empty active logs are successful no-ops.

gc events rotate [flags]

Example:

gc events rotate
gc events rotate --wait
gc --city /path/to/city events rotate --api http://127.0.0.1:8080
FlagTypeDefaultDescription
--apistringGC API server URL override (auto-discovered by default)
--waitboolWait for archive compression to complete before returning

gc extmsg

Manage bindings between external conversations (telegram, discord, ...) and gc sessions or configured agents.

A conversation bound to an agent name survives session restarts: inbound messages resolve a live session for the agent at delivery time, cold-waking one when none is live. "handoff" rebinds a conversation to another agent — the front-desk pattern: a default-routed agent inspects the conversation and hands it to the right specialist.

These commands require the city API server; they have no local fallback.

gc extmsg
SubcommandDescription
gc extmsg bindBind a conversation to a session or configured agent
gc extmsg handoffRebind a conversation to another configured agent
gc extmsg unbindRemove active conversation bindings

gc extmsg bind

Bind an external conversation to a concrete session (--session) or to a configured agent (--agent). Agent bindings survive session restarts: delivery resolves a live session for the agent each time, cold-waking one when none is live. Binding an actively-bound conversation conflicts; use "gc extmsg handoff" to rebind.

gc extmsg bind [flags]
FlagTypeDefaultDescription
--account-idstringdefaultAdapter account ID
--agentstringConfigured agent identity to bind (mutually exclusive with --session)
--conversation-idstringProvider conversation ID (required)
--jsonboolOutput the binding record as JSON
--kindstringdmConversation kind: dm, room, or thread
--parent-conversation-idstringParent conversation ID for thread conversations
--providerstringExternal messaging provider (required)
--scope-idstringConversation scope (default: the city name)
--sessionstringSession ID to bind (mutually exclusive with --agent)

gc extmsg handoff

Rebind an external conversation to another configured agent, replacing the active binding. Run from inside an agent session to hand a conversation to the right specialist — the routing judgment lives in the agent's prompt, this verb is pure transport.

gc extmsg handoff [flags]
FlagTypeDefaultDescription
--account-idstringdefaultAdapter account ID
--conversation-idstringProvider conversation ID (required)
--jsonboolOutput the binding record as JSON
--kindstringdmConversation kind: dm, room, or thread
--parent-conversation-idstringParent conversation ID for thread conversations
--providerstringExternal messaging provider (required)
--scope-idstringConversation scope (default: the city name)
--tostringConfigured agent identity to hand the conversation to (required)

gc extmsg unbind

Remove active external-conversation bindings. Filter by conversation (--provider/--conversation-id), by --agent, by --session, or a combination. At least one filter is required.

gc extmsg unbind [flags]
FlagTypeDefaultDescription
--account-idstringdefaultAdapter account ID
--agentstringUnbind conversations bound to this configured agent
--conversation-idstringProvider conversation ID (required)
--jsonboolOutput the removed binding records as JSON
--kindstringdmConversation kind: dm, room, or thread
--parent-conversation-idstringParent conversation ID for thread conversations
--providerstringExternal messaging provider (required)
--scope-idstringConversation scope (default: the city name)
--sessionstringUnbind conversations bound to this session ID

gc formula

Manage and inspect formulas.

A formula is a reusable TOML method for how multi-step work should be done (a bead is the work itself). See docs/reference/specs/formula-spec-v2.md for the file format, the formulas v2 contract, and the [requires] formula_compiler opt-in.

gc formula
SubcommandDescription
gc formula cookInstantiate a formula into the current bead store
gc formula listList available formulas
gc formula showShow a compiled formula recipe
gc formula version-checkCheck if a bead's formula matches the current on-disk version

gc formula cook

Compile and instantiate a formula as real beads in the current store.

This is a low-level workflow construction tool. It creates the formula root and all compiled step beads without routing any work.

With --attach=<bead-id>, the given bead gains a blocking dependency on the sub-DAG root, so it won't close until the sub-DAG completes. This is a "blocks" dependency only, not a parent-child relationship — the sub-DAG root does not become a child of the attached bead (gc bd list --parent will not find it), and convoy auto-close, which watches parent-child children and "tracks" members rather than blocks dependents, is not triggered by the sub-DAG completing. This is the core primitive for late-bound DAG expansion — any agent, script, or workflow step can call it to expand a bead into a sub-workflow at runtime.

With --attach on a v2 formula — one declaring [requires] formula_compiler = ">=2.0.0" — the invocation runs under a per-source workflow lock and is idempotent: a repeat cook for the same source bead reuses the live workflow instead of duplicating it, and a conflicting live workflow from the same source is an error.

On a city that serves the graph class from its own [storage] binding, most of --attach in CITY scope is NOT SUPPORTED YET and refuses rather than serving. A graft is graph class whatever the formula's version — every bead it creates carries gc.root_bead_id — so the sub-DAG belongs in the binding while the blocking dependency belongs beside the attach bead, and a split city cannot have both:

  • attach bead in the city's WORK ledger — refused. Writing the sub-DAG beside it strands graph-class beads in the work store, which gc storage status reports and exits non-zero on; writing it into the binding leaves the work store holding a blocks row naming an id it cannot resolve, which never clears. Representing that block across the store boundary needs a cross-class membership edge: ga-2orlf.
  • attach bead in the BINDING, v2 (graph.v2) formula — refused. It normalizes its target into a synthetic input convoy, which is a work bead that can live in neither store; its membership edge to the target would be cross-class. Same remedy: ga-2orlf.
  • attach bead in the BINDING, v1 formula — served. The sub-DAG and its blocking dependency are both written to the binding.
  • RIG scope (--rig, GC_RIG, or a cwd inside a rig) — served, unchanged. A relocation moves city-level stores only, so a rig's ledger holds both ends of the graft and nothing it writes can be stranded.

Single-store cities are unaffected: --attach behaves exactly as it always has. If an earlier cook already stranded beads in a split city's work store, copy them into the binding with gc storage recover-stranded --from-work --fleet-stopped.

gc formula cook <formula-name> [flags]
FlagTypeDefaultDescription
--attachstringattach sub-DAG to existing bead (bead gains blocking dep on sub-DAG root)
--jsonbooloutput JSONL summary
--metastringArrayset root bead metadata after cook (key=value, repeatable)
-t, --titlestringoverride root bead title
--varstringArrayvariable substitution for formula (key=value, repeatable)

gc formula list

List all formulas available in the city's formula search paths.

Formulas are discovered from the well-known formulas/ directories of city and rig pack layers, the city's own formulas/ directory, and the rig-local formulas_dir directory. Later layers win for same-named formulas.

gc formula list [flags]
FlagTypeDefaultDescription
--jsonboolemit JSON

gc formula show

Compile and display a formula recipe.

By default, shows the recipe with {{variable}} placeholders intact. Use --var to substitute variables and preview the resolved output.

When --rig is set (or cwd is inside a rig), rig-scoped formula_vars from city.toml are shown as "(rig default=...)" alongside each applicable var. An explicit --city pins city scope, which has no rig-scoped formula_vars.

Examples: gc formula show mol-feature gc formula show mol-feature --var title="Auth system" --var branch=main gc formula show mol-polecat-work --rig mo

gc formula show <formula-name> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSON
--varstringArrayvariable substitution for preview (key=value)

gc formula version-check

Compare the formula content hash stored on a molecule/workflow bead against the current on-disk formula file. Exits 0 if they match, 1 if they diverge.

The bead must have gc.formula_hash metadata (set during instantiation). The formula is located via the bead's Ref field and the current formula search paths.

Use this to detect whether a running session's formula has been updated since it was spawned.

gc formula version-check <bead-id> [flags]
FlagTypeDefaultDescription
--jsonbooloutput result as JSON

gc github

GitHub integration commands

gc github
SubcommandDescription
gc github prGitHub pull-request monitor commands

gc github pr

GitHub pull-request monitor commands

gc github pr
SubcommandDescription
gc github pr backfillQuery configured GitHub PR readiness monitors

gc github pr backfill

Query configured GitHub PR readiness monitors.

The command reads [[github.pr_monitor]] entries from the resolved city configuration, queries open pull requests from GitHub, and reports PRs that need repair: failed checks, merge conflicts, blocked mergeability, or branches behind their base. By default clean and pending-only PRs are omitted; pass --all to include every observed PR.

gc github pr backfill [monitor-name] [flags]
FlagTypeDefaultDescription
--allboolinclude clean and pending-only PRs
--create-repair-beadsboolcreate deduped repair beads for actionable PRs
--jsonboolemit JSON
--timeoutduration45sGitHub query timeout

gc graph

Show the dependency graph for a set of beads or a convoy.

Resolves dependencies via the bead store and prints each bead with its status and what blocks it. Convoys are expanded to their children automatically. Readiness is computed within the displayed set.

By default prints a table. Use --tree for a Unicode tree view or --mermaid for a Mermaid.js flowchart you can paste into Markdown.

gc graph <bead-ids|convoy-id...> [flags]

Example:

gc graph gc-42               # expand convoy children
gc graph gc-1 gc-2 gc-3     # arbitrary beads
gc graph gc-42 --tree        # dependency tree
gc graph gc-42 --mermaid     # Mermaid.js diagram
FlagTypeDefaultDescription
--jsonbooloutput JSONL summary
--mermaidbooloutput Mermaid.js flowchart
--treebooloutput Unicode dependency tree

gc handoff

Convenience command for context handoff.

Self-handoff (default): sends mail to self. If the current session is controller-restartable, requests a restart and blocks until the controller stops the session. For on-demand configured named sessions, sends mail and returns without requesting restart: handoff intentionally leaves the user-attended session running instead of restarting it out from under the user. The controller can restart such a session via gc runtime request-restart; handoff deliberately does not.

For controller-restartable sessions, equivalent to:

gc mail send $GC_ALIAS <subject> [message] gc runtime request-restart

Under normal operation the controller stops controller-restartable self-handoff sessions before this command returns. If the controller does not act within a bounded timeout, gc handoff exits 1 with a diagnostic instead of blocking indefinitely. If interrupted, the restart request remains set for the controller to process on its next reconcile tick.

Auto handoff (--auto): sends mail to self and returns without requesting a restart. This is for PreCompact hooks, where the provider is already managing the context compaction lifecycle.

Remote handoff (--target): sends mail to a target session. If the target is controller-restartable, kills it so the reconciler restarts it with the handoff mail waiting. For on-demand configured named targets, sends mail and returns without killing the session.

For controller-restartable targets, equivalent to:

gc mail send <target> <subject> [message] gc session kill <target>

Self-handoff requires session context (GC_ALIAS or GC_SESSION_ID, plus GC_SESSION_NAME and city context env). Remote handoff accepts a session alias or ID. Subject is required unless --auto is set.

gc handoff [subject] [message] [flags]
FlagTypeDefaultDescription
--autoboolSend handoff mail without requesting restart (for PreCompact hooks)
--hook-formatstringformat hook output for a provider
--jsonboolemit JSON summary
--targetstringRemote session alias or ID to handoff (kills only controller-restartable sessions)

gc help

Help provides help for any command in the application. Simply type gc help [path to command] for full details.

gc help [command]

gc hook

Finds routed work using the agent's work_query config.

Without --inject: prints normalized ready-only output, exits 0 if work exists, 1 if empty. With --inject: silent legacy Stop-hook compatibility; skips the work query and always exits 0. With --claim: runs the standard startup claim protocol for one work item.

The agent is determined from $GC_AGENT or a positional argument.

gc hook [agent] [flags]
FlagTypeDefaultDescription
--claimboolatomically claim one routed work item for the current session
--drain-ackboolwith --claim, acknowledge runtime drain when no work is available
--injectboolsilent legacy Stop-hook compatibility; skip work query and exit 0
--jsonboolemit a JSON protocol result (always with --claim; on the discovery door only for a drain refusal)
SubcommandDescription
gc hook currentPrint the work bead this session most recently claimed
gc hook runRun a managed hook command with a hard timeout

gc hook current

Prints the work bead this session most recently claimed with gc hook --claim.

The claim protocol stamps the claimed bead id onto the calling session's own bead, because the environment alone cannot reliably name it: $GC_BEAD_ID exists only in the controller's dispatch condition environment, never in a session shell, and $GC_TRIGGER_BEAD_ID — exported to demand-spawned pool seats as a pool-level spawn marker — is absent on other seats (e.g. a warm seat bound after start) and never decides what a session claims; the pool is pull. It appears in the chain below only as a name fallback for work already claimed: for a vapor wisp the trigger IS the work bead. A formula step that must close the bead it is running reads the stamp back here:

BEAD_ID="${GC_BEAD_ID:-${GC_TRIGGER_BEAD_ID:-$(gc hook current --id-only)}}"

The calling session is taken from $GC_SESSION_ID. Exits 1 when there is no session identity and when the session has claimed nothing, so a caller that cannot name its bead fails loudly instead of skipping its own work.

gc hook current [flags]
FlagTypeDefaultDescription
--id-onlyboolprint only the bead id, with no surrounding context

gc hook run

Runs a managed gc hook command in a child process with a hard timeout.

This protects provider hook callbacks from wedged data-plane commands. The child process is the current gc executable, and <gc args...> are passed to it verbatim.

gc hook run -- <gc args...> [flags]
FlagTypeDefaultDescription
--timeoutduration15shard timeout for the managed hook command
--timeout-exit-codeint124exit code to return when the managed hook command times out

gc import

Manage pack imports

gc import
SubcommandDescription
gc import addAdd a pack import
gc import checkValidate installed pack import state
gc import credentialManage pack-source git credentials
gc import installInstall imports from pack.toml and packs.lock
gc import listList imported packs
gc import pruneRemove unreferenced clones from the global pack cache
gc import removeRemove a pack import
gc import statusReport declared imports and packs.lock pins
gc import upgradeUpgrade imported packs within their constraints
gc import whyExplain why an import is present

gc import add

Add a pack import.

The source argument is resolved once and written as a durable [imports.<name>] entry using source plus optional version. Supported sources are:

  • local paths outside git worktrees: stored as plain paths, with no lock entry
  • local paths inside git worktrees at HEAD: promoted to a file:// repo source with the pack subpath and locked to the current commit
  • remote git repositories: cloned and locked; --version accepts a semver constraint or sha:<commit>
  • remote GitHub repository subpaths: use dereferenceable tree URLs such as https://github.com/org/repo/tree/main/packs/foo

Registry catalog handles are lookup shortcuts in this wave, not durable [imports.*] field values. After lookup, authored TOML stores the resolved source and optional version.

The [imports.<name>] table key is the local binding name. Imported package names are display/advisory metadata and never become registry identity.

gc import add <source> [flags]

Example:

gc import add ./packs/review
gc import add https://github.com/org/repo/tree/main/packs/review --version '^1.2.0'

# For uncommitted packs inside a git worktree, edit TOML directly:
# [imports.review]
# source = "/Users/you/shared-packs/packs/review"
FlagTypeDefaultDescription
--namestringLocal binding name override
--versionstringVersion constraint for git-backed imports

gc import check

Validate installed pack import state

gc import check

gc import credential

Manage pack-source git credentials

gc import credential
SubcommandDescription
gc import credential addRegister a pack-source credential
gc import credential listList registered pack-source credentials
gc import credential removeRemove a registered pack-source credential

gc import credential add

Register a pack-source credential

gc import credential add <match> (--helper CMD | --token-file PATH | --token-env NAME | --ssh-key-file PATH) [--username NAME] [--global] [flags]
FlagTypeDefaultDescription
--globalboolWrite $GC_HOME/credentials.toml instead of the city file
--helperstringCommand whose stdout is the token (executed per fetch)
--ssh-key-filestringPath to an SSH private key for git@/ssh:// sources
--token-envstringName of an environment variable holding the token
--token-filestringPath to a file containing the token
--usernamestringUsername sent to the remote (default x-access-token)

gc import credential list

List registered pack-source credentials

gc import credential list

gc import credential remove

Remove a registered pack-source credential

gc import credential remove <match> [flags]
FlagTypeDefaultDescription
--globalboolRemove from $GC_HOME/credentials.toml instead of the city file

gc import install

Install imports from pack.toml and packs.lock

gc import install

gc import list

List imported packs

gc import list [flags]
FlagTypeDefaultDescription
--treeboolShow the import dependency tree

gc import prune

Remove unreferenced clones from the machine-wide pack cache.

The pack cache (~/.gc/cache/repos) is shared by every city on the machine and is keyed by (source, commit), so commit churn accumulates stale clones over time. A clone is "referenced" when some city's packs.lock still pins it; prune keeps every referenced clone and removes only the rest.

By default prune considers every city in the supervisor registry plus the city resolved from the current directory; pass --all-cities to reference the full registry set and ignore the current directory. Prune is a dry run unless --apply is given. The --keep-days guard never removes an unreferenced clone whose directory was modified more recently than N days ago, protecting in-flight installs from a race.

gc import prune [flags]
FlagTypeDefaultDescription
--all-citiesboolReference every city in the supervisor registry, ignoring the current directory
--applyboolDelete unreferenced clones (default: dry run)
--keep-daysint7Never prune unreferenced clones modified within this many days

gc import remove

Remove a pack import

gc import remove <name>

gc import status

Report declared imports and packs.lock pins.

Covers every import scope (root pack [imports.], [defaults.rig.imports.], and rig-scoped [rigs.imports.*]) plus the full packs.lock closure and the lockfile content hash. With --json the output is a stable machine-readable document for drift checkers.

gc import status [flags]
FlagTypeDefaultDescription
--jsonboolemit JSON result

gc import upgrade

Upgrade imported packs within their constraints

gc import upgrade [name]

gc import why

Explain why an import is present

gc import why <name-or-source>

gc init

Create a new Gas City workspace in the given directory. With no path, the current directory is used only when stdin is an interactive terminal; otherwise pass an explicit path ("." for the current directory).

Runs an interactive wizard to choose a config template and coding agent provider. Creates the .gc/ runtime directory plus pack.toml, city.toml, the standard top-level directories, and .template.md prompt templates, and pins the builtin pack imports (resolved from the user-global pack cache). Use --template with --default-provider and an explicit path to create a city non-interactively, or --file to initialize from an existing TOML config file.

Pass --preserve-existing to keep any pre-authored pack.toml, city.toml, or agent prompt files in the target directory (useful when bootstrapping a committed workspace — e.g. from a bootstrap.sh shipped in the repo).

gc init [path] [flags]

Example:

gc init
gc init ~/my-city
gc init --default-provider codex ~/my-city
gc init --template gastown --default-provider codex ~/my-city
gc init --providers claude,codex --default-provider codex ~/my-city
gc init --default-provider codex --bootstrap-profile k8s-cell /city
gc init --name my-city
gc init --from ~/elan --name elan /city
gc init --file ./my-city.toml ~/bright-lights
gc init --file city.toml --preserve-existing .
gc init --template gascity --default-provider claude \
  --dolt-host db.example.com --dolt-port 4406 \
  --dolt-database bd_prj_x --dolt-project-id prj_x --no-start /city
FlagTypeDefaultDescription
--bootstrap-profilestringbootstrap profile to apply for hosted/container defaults
--default-providerstringdefault readiness-aware provider to select from --providers
--dolt-databasestringhosted beads project database, e.g. bd_prj_… (or GC_DOLT_DATABASE); required with --dolt-host
--dolt-hoststringexternal/hosted Dolt host for the city beads ledger (or GC_DOLT_HOST); pins the city to an external endpoint instead of bootstrapping a managed-local Dolt
--dolt-portstringexternal/hosted Dolt port (or GC_DOLT_PORT); required with --dolt-host
--dolt-project-idstringauthoritative beads project_id for the identity handshake (or GC_BEADS_PROJECT_ID); derived from a bd_<id> --dolt-database when omitted
--dolt-userstringexternal/hosted Dolt user (or GC_DOLT_USER); optional
--filestringpath to a TOML file to use as city.toml
--fromstringpath to an example city directory to copy
--jsonboolemit JSON summary
--namestringworkspace name (default: target directory basename)
--no-startboolinitialize files and imports without registering or starting the city
--preserve-existingboolkeep any pre-authored pack.toml, city.toml, or agent prompt files instead of overwriting them
--providersstringArrayreadiness-aware providers to write to city.toml (repeatable or comma-separated)
--skip-provider-readinessboolskip provider login/readiness checks during init and continue startup
--templatestringnon-interactive template to write: minimal, gastown, gascity, custom, or empty
--yesboolbypass the cross-city supervisor cycle confirmation prompt (warning is still printed for the audit trail)

gc lint

Validate a pack before merge.

gc lint <pack> validates the pack.toml file, reports non-fatal loader warnings, and parses prompt templates with the same missing-key behavior used by runtime prompt rendering. Use gc lint . to recursively find every pack.toml below the current directory.

gc lint <pack> [flags]
FlagTypeDefaultDescription
--jsonboolemit structured JSON report

gc login

Log in to a hosted Gas City service and store a local API token.

By default this targets https://gascity.com; pass --at <url> to log in to any server that implements the Gas City Service Protocol v0. It opens a browser to sign in; use --device for headless shells, or --token to store an existing token. The token is stored per service under ~/.gc/credentials.json.

gc login [flags]
FlagTypeDefaultDescription
--atstringservice base URL; defaults to GC_SERVICE_URL, the stored default, then https://gascity.com
--devicebooluse device-code login instead of browser callback login
--labelstringlabel for the minted token; defaults to <user>@<host>
--no-browserboolprint the browser login URL instead of opening it
--timeoutduration15m0smaximum time to wait for interactive login
--tokenstringexisting API token to store; defaults to GC_SERVICE_TOKEN

gc logout

Log out of a hosted Gas City service: revoke the session server-side, then remove the stored token. Because the session is the only long-lived credential, this is the kill switch for a leaked ~/.gc/credentials.json — the local token is always removed even if the server-side revoke fails or is not yet supported.

gc logout [flags]
FlagTypeDefaultDescription
--allboollog out of every stored service
--atstringservice base URL; defaults to GC_SERVICE_URL, the stored default, then https://gascity.com

gc mail

Send and receive messages between agents and humans.

Mail is implemented as beads with type="message". Messages have a sender, recipient, subject, and body. Use "gc mail check --inject" in agent hooks to deliver mail notifications into agent prompts.

gc mail
SubcommandDescription
gc mail archiveArchive one or more messages without reading them
gc mail checkCheck for unread mail (use --inject for hook output)
gc mail countShow total/unread message count
gc mail deleteDelete one or more messages (closes the beads)
gc mail inboxList unread messages (defaults to your inbox)
gc mail mark-readMark a message as read
gc mail mark-unreadMark a message as unread
gc mail peekShow a message without marking it as read
gc mail readRead a message and mark it as read
gc mail replyReply to a message
gc mail sendSend a message to a session alias or human
gc mail threadList all messages in a thread

gc mail archive

Remove one or more message beads without displaying their contents.

Use this to dismiss messages without reading them. Each message is removed and will no longer appear in mail check or inbox results. When multiple IDs are passed, they are archived in input order.

For large advisory backlogs, use --to or --all-recipients with --subject-prefix, --subject-contains, or --from to archive a bounded matching slice without enumerating IDs by hand.

gc mail archive <id>... [flags]
FlagTypeDefaultDescription
--all-recipientsboolarchive matching messages across all recipients
--dry-runboollist matching messages without archiving them
--empty-bodyboolonly archive matching messages whose body is empty
--fromstringarchive matching unread messages from this exact sender
--include-readboolinclude read-but-open messages when selecting by filter
--jsonboolemit JSONL result
--limitint100maximum matching messages to archive in this run
--subject-containsstringarchive matching unread messages whose subject contains this text
--subject-prefixstringarchive matching unread messages whose subject starts with this text
--tostringarchive matching unread messages addressed to this recipient

gc mail check

Check for unread mail addressed to a session alias or mailbox.

Without --inject: prints the count and exits 0 if mail exists, 1 if empty. With --inject: outputs a <system-reminder> block suitable for hook injection (always exits 0). The recipient defaults to $GC_SESSION_ID, $GC_ALIAS, $GC_AGENT, or "human".

gc mail check [session] [flags]

Example:

gc mail check
gc mail check --inject
gc mail check mayor
FlagTypeDefaultDescription
--hook-formatstringformat hook output for a provider
--injectbooloutput <system-reminder> block for hook injection

gc mail count

Show total and unread message counts for a session alias or human. The recipient defaults to $GC_SESSION_ID, $GC_ALIAS, $GC_AGENT, or "human".

gc mail count [session] [flags]
FlagTypeDefaultDescription
--jsonboolemit JSON result

gc mail delete

Delete one or more messages by closing the beads. Same effect as archive but with different user intent. When multiple IDs are passed, they are deleted in a single batch round-trip.

gc mail delete <id>... [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL result

gc mail inbox

List all unread messages for a session alias or human.

Shows message ID, sender, subject, and body in a table. The recipient defaults to $GC_SESSION_ID, $GC_ALIAS, $GC_AGENT, or "human". Pass a session alias to view another inbox.

gc mail inbox [session] [flags]
FlagTypeDefaultDescription
--jsonboolemit JSON result

gc mail mark-read

Mark a message as read without displaying it. The message will no longer appear in inbox results.

gc mail mark-read <id> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL result

gc mail mark-unread

Mark a message as unread. The message will appear again in inbox results.

gc mail mark-unread <id> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL result

gc mail peek

Display a message without marking it as read.

Same output as "gc mail read" but does not change the message's read status. The message will continue to appear in inbox results.

gc mail peek <id> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSON result

gc mail read

Display a message and mark it as read.

Shows the full message details (ID, sender, recipient, subject, date, body). The message stays in the store — use "gc mail archive" to remove it.

gc mail read <id> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSON result

gc mail reply

Reply to a message. The reply is addressed to the original sender.

Inherits the thread ID from the original message for conversation tracking. Use --notify to request a recipient turn after replying. In a managed city, it can request a wake for a non-running recipient. Unread mail alone does not request a wake. Use -s/--subject for the reply subject and -m/--message for the reply body.

gc mail reply <id> [-s subject] [-m body] [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL result
-m, --messagestringreply body text
--notifyboolrequest a recipient turn (including a managed wake if not running), even with earlier unread mail
-s, --subjectstringreply subject line

gc mail send

Send a message to a session alias or human.

Creates a message bead addressed to the recipient. The sender defaults to $GC_SESSION_ID, $GC_ALIAS, $GC_AGENT, or "human". Use --notify to request a recipient turn after sending. In a managed city, it can request a wake for a non-running recipient. Unread mail alone does not request a wake. Use --from to override the sender identity. Use --to as an alternative to the positional <to> argument. Use -s/--subject for the summary line and -m/--message for the body text. Use --all to broadcast to all live sessions (excluding sender and "human").

gc mail send [<to>] [<body>] [flags]

Example:

gc mail send mayor "Build is green"
gc mail send mayor -s "Build is green"
gc mail send myrig/witness -s "Need investigation" -m "Attach logs from the last failed run"
gc mail send --to mayor "Build is green"
gc mail send human "Review needed for PR #42"
gc mail send polecat "Priority task" --notify
gc mail send --all "Status update: tests passing"
FlagTypeDefaultDescription
--allboolbroadcast to all live sessions (excludes sender and human)
--fromstringsender identity (default: $GC_SESSION_ID, $GC_ALIAS, $GC_AGENT, or "human")
--jsonboolemit JSONL result
-m, --messagestringmessage body text
--notifyboolrequest a recipient turn (including a managed wake if not running), even with earlier unread mail
-s, --subjectstringmessage subject line
--tostringrecipient address (alternative to positional argument)

gc mail thread

Show all messages sharing a thread ID or message ID, ordered by time.

gc mail thread <id> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSON result

gc maintenance

Manage periodic Dolt store maintenance (see docs/adr/0002-dolt-store-maintenance-runbook.md).

The weekly loop runs inside the supervisor process when [maintenance.dolt] enabled=true in city.toml. 'status' shows loop state and recent runs; 'dolt-gc' triggers a manual run.

gc maintenance
SubcommandDescription
gc maintenance dolt-gcTrigger a Dolt store maintenance run
gc maintenance statusShow Dolt store maintenance status

gc maintenance dolt-gc

Trigger a Dolt store maintenance run

gc maintenance dolt-gc [flags]
FlagTypeDefaultDescription
--jsonboolemit machine-readable JSON
--waitboolblock until the run completes (exit 1 on failure)

gc maintenance status

Show Dolt store maintenance status

gc maintenance status [flags]
FlagTypeDefaultDescription
--jsonboolemit machine-readable JSON

gc mcp

Inspect the projected MCP catalog for a concrete target.

Projected MCP is target-specific. Use "gc mcp list --agent <name>" when the agent has a single deterministic projection target from config, or "gc mcp list --session <id>" for a live session target.

gc mcp
SubcommandDescription
gc mcp listShow projected MCP servers

gc mcp list

Show the precedence-resolved MCP servers that Gas City would project into the provider-native config for one agent or session target.

gc mcp list [flags]
FlagTypeDefaultDescription
--agentstringshow the projected MCP config for this agent
--jsonboolOutput one JSONL result record
--sessionstringshow the projected MCP config for this session

gc metrics

Inspect or control Gas City command usage metrics

gc metrics
SubcommandDescription
gc metrics examplePrint the fixed state-independent command-usage request example
gc metrics offDisable command usage metrics and delete local queued data
gc metrics onRead and accept the command-usage disclosure on a verified TTY
gc metrics statusShow redacted local command-usage metrics status

gc metrics example

Print the fixed state-independent command-usage request example

gc metrics example [flags]
FlagTypeDefaultDescription
--jsonboolwrite only the exact example JSON

gc metrics off

Disable command usage metrics and delete local queued data

gc metrics off

gc metrics on

Read and accept the command-usage disclosure on a verified TTY

gc metrics on

gc metrics status

Show redacted local command-usage metrics status

gc metrics status [flags]
FlagTypeDefaultDescription
--jsonboolwrite the redacted status as JSON
--show-installation-idboolprint the stable linkable installation pseudonym with a warning

gc nudge

Inspect and deliver deferred nudges.

Deferred nudges are reminders that were queued because the target agent was asleep or was not at a safe interactive boundary yet.

gc nudge
SubcommandDescription
gc nudge statusShow queued and dead-letter nudges for a session

gc nudge status

Show queued and dead-letter nudges for a session.

Defaults to $GC_ALIAS or $GC_SESSION_ID when run inside a session.

gc nudge status [session] [flags]
FlagTypeDefaultDescription
--jsonboolOutput as JSON

gc order

Manage orders — scheduled or event-driven dispatch of formulas and scripts.

Orders live in flat orders/<name>.toml files. Each order pairs a trigger condition (cooldown, cron, condition, event, or manual) with an action (a formula or an exec script). The controller evaluates triggers on each tick and dispatches work when a trigger opens.

gc order
SubcommandDescription
gc order checkCheck which orders are due to run
gc order historyShow order execution history
gc order listList available orders
gc order runExecute an order manually
gc order showShow details of an order
gc order sweep-nudge-mailClose stale delivered nudge beads and read mail beads
gc order sweep-trackingClose stale and prune closed order-tracking beads

gc order check

Evaluate trigger conditions for all orders and show which are due.

Prints a table with each order's trigger, due status, and reason. Returns exit code 0 if any order is due, 1 if none are due.

gc order check [flags]
FlagTypeDefaultDescription
--jsonboolJSON output

gc order history

Show execution history for orders.

Queries bead history for past order runs. Optionally filter by order name. Use --rig to filter by rig.

The read is bounded by default: only the most recent runs are fetched. Widen it with --limit (0 fetches every retained run) or bound it by time with --since. On a city with a long order-run history an unbounded read costs tens of seconds, so prefer keeping a bound when triaging.

gc order history [name] [flags]
FlagTypeDefaultDescription
--jsonbooloutput JSONL summary
--limitint50maximum runs to show (0 = every retained run)
--rigstringrig name to filter order history
--sincestringonly show runs from within this duration ago (e.g. 1h, 24h)

gc order list

List all available orders with their trigger type, schedule, and target.

Scans orders/ directories for flat .toml files defining trigger conditions, scheduling parameters, and target pools.

gc order list [flags]
FlagTypeDefaultDescription
--jsonboolemit JSON

gc order run

Execute an order manually, bypassing its trigger conditions.

Formula orders instantiate a wisp from the order's formula and route it to the configured target (if any). Exec orders run their script directly — no wisp is created, and --json is rejected because the exec body may write arbitrary stdout. Useful for testing orders or triggering them outside their normal schedule. Use --rig to disambiguate same-name orders in different rigs. Use --var key=value (repeatable) to pass args to the order: formula orders receive them as formula vars, exec orders as environment variables. A param declared required in [order.params] must be supplied or the run fails.

gc order run <name> [flags]
FlagTypeDefaultDescription
--jsonboolJSON output (formula orders only; rejected for exec orders)
--rigstringrig name to disambiguate same-name orders
--varstringArrayorder arg as key=value (repeatable): formula var / exec env

gc order show

Display detailed information about a named order.

Shows the order name, description, formula reference, trigger type, scheduling parameters, check command, target, and source file. Use --rig to disambiguate same-name orders in different rigs.

gc order show <name> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSON
--rigstringrig name to disambiguate same-name orders

gc order sweep-nudge-mail

Close stale delivered nudge beads and read mail beads.

Nudge beads that are past --nudge-ttl and not in the live nudge queue are closed. Read mail beads past --mail-ttl are closed. A budget cap of 50 closes per invocation prevents runaway sweeps under load.

Use --dry-run to log what would be closed without making any changes. The controller watchdog also runs this sweep automatically every 5 minutes.

gc order sweep-nudge-mail [flags]
FlagTypeDefaultDescription
--dry-runboollog what would be closed; make no changes
--mail-ttlduration1h0m0smin age before a read mail bead is GC'd
--nudge-ttlduration10m0smin age before a delivered nudge bead is GC'd
--quietboolsuppress success output

gc order sweep-tracking

Close stale open order-tracking beads and prune expired closed history.

This is intended for maintenance exec orders. It only closes tracking beads older than --stale-after so a fresh in-flight order is not interrupted. Closed order-tracking history is deleted after [beads.policies.order_tracking].delete_after_close, defaulting to 7d, while always retaining at least the latest 10 closed tracking beads per order. The manual command runs to completion; controller startup and watchdog sweeps use bounded cleanup to avoid spending an unbounded tick on stale work.

Use --include-wisps for operator recovery of abandoned order-run wisp subtrees whose open descendants are also older than --stale-after. Pass one or more scoped order names when --include-wisps is set; wisp recovery is order-scoped to avoid scanning unrelated beads.

When the number of eligible closed-bead deletions exceeds GC_BULK_DELETE_CONFIRM_THRESHOLD (default 20), --confirm is required to proceed. This guard prevents accidental mass-deletes without an explicit operator acknowledgement.

gc order sweep-tracking [order ...] [flags]
FlagTypeDefaultDescription
--confirmboolconfirm bulk deletion when eligible count > GC_BULK_DELETE_CONFIRM_THRESHOLD (default 20)
--dry-runboolreport stale order-tracking and order wisp beads without closing them
--include-wispsboolalso close stale order-run wisp subtrees with open descendants
--quietboolsuppress success output
--stale-afterduration10m0sminimum age for an open tracking bead to be closed

gc pack

Manage remote pack sources that provide agent configurations.

Packs are git repositories containing pack.toml files that define agent configurations for rigs. They are cached locally and can be pinned to specific git refs.

gc pack
SubcommandDescription
gc pack fetchClone missing and update existing remote packs
gc pack listShow remote pack sources and cache status
gc pack registryManage pack registries
gc pack releaseAuthor pack registry release metadata

gc pack fetch

Clone missing and update existing remote pack caches.

Fetches all configured pack sources from their git repositories, updates the local cache, and writes a lockfile with commit hashes for reproducibility. Automatically called during "gc start".

gc pack fetch

gc pack list

Show configured pack sources with their cache status.

Displays each pack's name, source URL, git ref, cache status, and locked commit hash (if available).

gc pack list

gc pack registry

Manage configured Gas City pack registries, inspect cached catalog entries, authenticate to the hosted Registry, and publish packs.

Native Registry login stores a per-registry API token. When no explicit, environment, stored native, development, or GitHub Actions credential applies, the canonical hosted Registry uses the existing Gasworks login through "gasworks credential-provider". Set GC_CREDENTIAL_PROVIDER to a JSON argv array to configure that command without invoking a shell. Gasworks credentials are never persisted by gc and are never sent to custom Registry origins.

gc pack registry
SubcommandDescription
gc pack registry addAdd a pack registry
gc pack registry listList configured pack registries
gc pack registry loginLog in to Gas City Registry
gc pack registry publishSubmit a pack publish request
gc pack registry refreshRefresh cached pack registry catalogs
gc pack registry removeRemove a pack registry
gc pack registry requestsShow your Registry publish request status
gc pack registry searchSearch cached pack registry catalogs
gc pack registry showShow one pack registry entry
gc pack registry whoamiShow the authenticated registry account

gc pack registry add

Add a pack registry

gc pack registry add <registry-name> <source> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL result
--no-validateboolrecord the registry without fetching its catalog now

gc pack registry list

List configured pack registries

gc pack registry list [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL result

gc pack registry login

Log in to Gas City Registry and store a local API token.

By default this opens a browser for GitHub or Google Workspace sign-in. Use --device for headless shells, or --token to store an existing registry token.

gc pack registry login [flags]
FlagTypeDefaultDescription
--devicebooluse device-code login instead of browser callback login
--labelstringGC CLI loginlabel for the registry API token
--no-browserboolprint the browser login URL instead of opening it
--registry-urlstringregistry app base URL; defaults to GC_REGISTRY_URL, the stored login default, then https://registry.gascity.com
--timeoutduration15m0smaximum time to wait for interactive login
--tokenstringregistry API token; defaults to GC_REGISTRY_TOKEN

gc pack registry publish

Submit a pack publish request to Gas City Registry.

The command requires a clean Git checkout whose current HEAD matches its configured upstream branch, then submits the GitHub repository, commit, pack path, pack name, and version to the registry API.

Registry pack names are scoped as <github-owner>/<pack>, where <github-owner> is the lowercased GitHub owner of the source repository. [pack].name must already carry that scoped name: the registry compares it byte-for-byte with the requested name, and reserves unscoped names for packs it already holds a claim for. --allow-unscoped-name submits such a legacy unscoped name anyway.

--dev-auth (localhost only) replaces all other credentials. Otherwise, authentication precedence is --token, GC_REGISTRY_TOKEN, a complete session cookie and CSRF-token pair from flags or the environment, a stored native Registry token, GitHub Actions OIDC, then the existing Gasworks login for the canonical hosted Registry. Run "gasworks login" once before using the provider, or use "gc pack registry login" to create a separate native Registry token.

gc pack registry publish <path-to-pack-root> [flags]
FlagTypeDefaultDescription
--allow-unscoped-nameboolsubmit an unscoped (bare) pack name; the registry accepts these only for names it already holds a claim for
--csrf-tokenstringregistry CSRF token; defaults to GC_REGISTRY_CSRF_TOKEN
--descriptionstringrelease description; defaults to [pack].description
--dev-authboolcreate a local dev-auth session before submitting; localhost only
--dev-auth-handlestringlocal-clidev-auth handle when --dev-auth is used
--dry-runboolprint the publish request without submitting
--namestringregistry pack name; must equal [pack].name (the registry rejects a mismatch)
--refstringrelease ref label; defaults to the upstream branch name
--registry-urlstringregistry app base URL; defaults to GC_REGISTRY_URL, the stored login default, then https://registry.gascity.com
--session-cookiestringregistry_session cookie value or Cookie header; defaults to GC_REGISTRY_SESSION
--tokenstringregistry API token; defaults to GC_REGISTRY_TOKEN
--validatebooltrueask the registry to validate the request immediately; a rejected validation exits non-zero
--versionstringrelease version; defaults to [pack].version

gc pack registry refresh

Refresh cached pack registry catalogs

gc pack registry refresh [registry-name] [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL result

gc pack registry remove

Remove a pack registry

gc pack registry remove <registry-name> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL result

gc pack registry requests

Show recent publish requests you submitted to Registry, or one request with its feedback comments.

This command is read-only. Use a personal Registry token; run "gc pack registry login" if you have not logged in yet.

gc pack registry requests [request-id] [flags]
FlagTypeDefaultDescription
--jsonboolemit one JSON response object
--registry-urlstringregistry app base URL; defaults to GC_REGISTRY_URL, the stored login default, then https://registry.gascity.com
--tokenstringpersonal registry API token; defaults to GC_REGISTRY_TOKEN or stored login

Search cached pack registry catalogs

gc pack registry search [query] [flags]
FlagTypeDefaultDescription
--allboolshow all results
--jsonboolemit JSONL result
--limitint50maximum number of results
--refreshboolrefresh catalogs before searching
--registrystringsearch only one registry

gc pack registry show

Show one pack registry entry

gc pack registry show <pack-name> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL result
--refreshboolrefresh catalogs before showing

gc pack registry whoami

Show the Registry account for the active credential.

Explicit, environment, and stored native Registry tokens take precedence. For the canonical hosted Registry, gc otherwise uses the existing Gasworks login through the configured credential provider without storing its credential.

gc pack registry whoami [flags]
FlagTypeDefaultDescription
--registry-urlstringregistry app base URL; defaults to GC_REGISTRY_URL, the stored login default, then https://registry.gascity.com
--tokenstringregistry API token; defaults to GC_REGISTRY_TOKEN or stored login

gc pack release

Author pack registry release metadata, including canonical pack content hashes.

gc pack release
SubcommandDescription
gc pack release hashCompute a pack release content hash
gc pack release stampStamp a registry release entry with a computed content hash
gc pack release validateValidate registry release content hashes
gc pack release verifyVerify a pack release content hash

gc pack release hash

Compute a pack release content hash

gc pack release hash <source> [flags]
FlagTypeDefaultDescription
--commitstringgit commit or ref to hash
--pathstringpack path inside the source repository

gc pack release stamp

Stamp a registry release entry with a computed content hash

gc pack release stamp <registry.toml> <pack-name> [flags]
FlagTypeDefaultDescription
--commitstringgit commit or ref to hash and record
--descriptionstringrelease description
--pack-descriptionstringpack description; required when creating a new [[pack]]
--pathstringpack path inside the source repository
--refstringrelease ref to record
--replaceboolreplace an existing release with the same version
--sourcestringpack source; required when creating a new [[pack]]
--versionstringrelease version to stamp

gc pack release validate

Validate registry release content hashes

gc pack release validate <registry.toml> [flags]
FlagTypeDefaultDescription
--include-withdrawnboolalso validate withdrawn releases
--packstringvalidate only one registry pack

gc pack release verify

Verify a pack release content hash

gc pack release verify <source> [flags]
FlagTypeDefaultDescription
--commitstringgit commit or ref to verify
--hashstringexpected sha256:<64hex> content hash
--pathstringpack path inside the source repository

gc prime

Outputs the behavioral prompt for an agent.

Use it to prime any CLI coding agent with city-aware instructions: claude "$(gc prime mayor)" codex --prompt "$(gc prime worker)"

Runtime hook profiles may call gc prime --hook. When agent-name is omitted, GC_ALIAS is used (falling back to GC_AGENT).

If agent-name matches a configured agent with a prompt_template, that template is output. Otherwise outputs a default worker prompt.

Pass --strict to fail on debugging mistakes instead of silently falling back to the default prompt. Strict errors on:

  • no city config found
  • city config fails to load
  • no agent name given (from args, GC_ALIAS, or GC_AGENT)
  • agent name not in city config (typo detection — the main use case)
  • agent's prompt_template points at a file that cannot be read

Strict does NOT error on agents whose config intentionally lacks a prompt_template (a supported minimal config), on templates that render to empty output from valid conditional logic, or on suspended states (city or agent) — those are legitimate quiet states, not mistakes.

gc prime [agent-name] [flags]
FlagTypeDefaultDescription
--hookboolcompatibility mode for runtime hook invocations
--hook-formatstringformat hook output for a provider
--jsonboolemit JSON summary
--strictboolfail on missing city, missing or unknown agent, or unreadable prompt_template instead of falling back to the default prompt

gc prompt

Subcommands for authoring agent prompt templates.

Currently the only subcommand is 'synth', which invokes the configured provider in one-shot mode to generate a prompt template for a given role.

gc prompt
SubcommandDescription
gc prompt synthGenerate an agent prompt template by invoking the LLM

gc prompt synth

Renders a meta-prompt with the given parameters, invokes the configured provider in one-shot mode, and emits the generated prompt template.

The default behavior prints the generated prompt to stdout. Pass --write to save it directly to <city>/agents/<role>/prompt.template.md (use --force to overwrite an existing file).

Context type is determined by --rig:

(no --rig) City context. The agent is HQ-only and operates at the city level (e.g. mayor, deacon). The meta-prompt emphasizes coordination, dispatch, monitoring. --rig <name> Rig context. The agent is attached to the named rig (looked up in city.toml). The meta-prompt includes the rig path, default branch, and project-aware guidance (git operations, branch management, etc.).

Auto-detection: --provider defaults to workspace.provider in city.toml

Baseline: The synth pulls in an existing prompt template as a refinement baseline so the LLM iterates on a known-good shape rather than designing from scratch. Resolution priority:

  1. <city>/agents/<role>/prompt.template.md (user customization)
  2. <composed pack dirs>/agents/<role>/ (pack default)
  3. embedded prompts/<role>.md (built-in fallback)
  4. embedded prompts/mayor.md (structural reference, used only when no role-specific source exists)

Two execution modes:

--writer-agent "" Direct mode (default). Spawns a one-shot subprocess of the configured provider; no Gas City agent is involved. Useful for bootstrap and offline-friendly invocations.

--writer-agent <name> Slingued mode. Creates a bead and slings the synth as work to the named agent via the mol-prompt-synth formula; the agent's session reads the meta-prompt, generates the prompt, and writes it to the destination.

Async by default — the CLI prints the bead ID + destination and returns immediately; use 'gc bd show <id>' to track progress. Pass --wait to block until the agent closes the bead (or --wait-timeout fires).

The output is LLM-generated. Review it carefully before relying on it. When --write is used, a comment header records the inputs and generation date for traceability.

gc prompt synth [flags]
FlagTypeDefaultDescription
--citystringcity path (default: auto-resolve)
--forceboolwith --write, overwrite the destination if it exists
--meta-promptstringoverride the embedded meta-prompt with a file path
--providerstringtarget AI provider key (default: city.toml workspace.provider)
--rigstringrig name from city.toml (default: empty = city/HQ context, no rig)
--rolestringagent role to design (required, e.g. mayor, polecat, witness)
--waitboolin slingued mode, block until the agent closes the bead
--wait-timeoutduration10m0sin slingued mode with --wait, abort after this duration
--writeboolwrite to <city>/agents/<role>/prompt.template.md instead of stdout (direct mode only; slingued mode always writes)
--writer-agentstringGas City agent to delegate the synth to via mol-prompt-synth (default: empty = direct mode, no agent)

gc ready

List ready, claimable work as a JSON array, federating the city store, the rig stores, and — on a split city — the relocated graph store where molecule roots, step beads and control beads live.

It is the in-process, city-wide drop-in for the single-store "bd ready" work query, so workers and the control plane see graph-class work instead of an authoritative-looking short answer. On a city that relocates no coordination class it reads the one store, unchanged.

The flags mirror the "bd ready" contract the default work_query builds: gc ready --metadata-field "gc.routed_to=$target" --unassigned
--exclude-type=epic --exclude-label "hold:mayor"
--sort oldest --limit 20 --json

Rows are emitted in canonical ready order (priority, created_at, id) unless --sort selects a created_at order, and --limit is applied last, so a bounded read is the true top-N of the merged set rather than the top-N of whichever store answered first.

Every leg is read across both storage tiers, so the wisp/ephemeral rows an orchestration step runs as are claimable work here whether or not --include-ephemeral is passed.

gc ready [flags]
FlagTypeDefaultDescription
--assigneestringonly work assigned to this identity
--exclude-labelstringArraydrop beads carrying this label (repeatable)
--exclude-typestringArraydrop beads of this issue type (repeatable)
--include-ephemeralboolaccept --include-ephemeral for bd-ready parity (every leg already spans the wisp tier)
--jsonbooltrueaccept --json for bd-ready parity (output is always a JSON array)
--limitintmax beads to return (0 = unlimited)
--metadata-fieldstringArrayrequire metadata "key=value", or bare "key" for any non-empty value (repeatable)
--sortstringsort order: oldest|newest (default: canonical ready order)
--statusstringlist beads in this status instead of ready work: open|in_progress|blocked|closed
--unassignedboolonly unassigned work

gc register

Register a city directory with the machine-wide supervisor.

If no path is given, registers the current city (discovered from cwd). Use --name to set the machine-local registration alias. The alias is stored in the machine-local supervisor registry and never written back to city.toml. When --name is omitted, the current effective city identity is used (site-bound workspace name if present, otherwise legacy workspace.name, otherwise the directory basename) — in every case city.toml is not modified. Registration is idempotent — registering the same city twice is a no-op. The supervisor is started if needed and immediately reconciles the city.

gc register [path] [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL summary
--namestringmachine-local alias for this city registration
--yesboolbypass the cross-city supervisor cycle confirmation prompt (warning is still printed for the audit trail)

gc reload

Force the current city controller to re-read effective config and process one reload tick without restarting the city/controller.

Reload may fetch configured remote packs before recomputing effective config. By default, per-session restarts may still happen if normal config drift rules require them.

With --soft, the controller accepts any detected per-session config drift instead of draining the drifted sessions: each open session's recorded config hash is updated to the hash the freshly reloaded config produces for it, the matching hash breakdown is refreshed, and any already queued config-drift drain for that session is canceled. The immediately-following reconcile tick sees no drift and no config-drift drains fire. Useful when editing a running city's .gc/settings.json without disrupting in-flight work. Sessions whose template no longer maps to a configured agent are NOT updated; normal orphan/suspended drain handles them on the next tick.

gc reload [path|name] [flags]
FlagTypeDefaultDescription
--asyncboolReturn after the controller accepts the reload request
--jsonboolemit JSONL summary
--softboolAccept config drift on open sessions instead of draining them
--timeoutstring5mHow long to wait for reload completion

gc restart

Restart the city by stopping it then starting it again.

Equivalent to running "gc stop" followed by "gc start". Under supervisor mode this unregisters the city, then re-registers it and triggers an immediate reconcile.

gc restart [path|name] [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL summary

gc resume

Resume a suspended city by recording an explicit "resumed" preference in .gc/runtime/suspension-state.json. The override sticks across city restarts even when [workspace] declares suspended_on_start = true.

Restores normal operation: the reconciler will spawn agents again and gc hook/prime will return work. Use "gc agent resume" to resume individual agents, or "gc rig resume" for rigs.

gc resume [path|name] [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL summary

gc rig

Manage rigs (external project directories) registered with the city.

Rigs are project directories that the city orchestrates. Each rig gets its own beads database, agent hooks, and cross-rig routing. Agents are scoped to rigs via their "dir" field.

gc rig
SubcommandDescription
gc rig addRegister a project as a rig
gc rig listList registered rigs
gc rig removeRemove a rig from the city
gc rig restartRestart all agents in a rig
gc rig resumeResume a suspended rig
gc rig set-endpointSet the canonical endpoint ownership for a rig
gc rig statusShow rig status and agent running state
gc rig suspendSuspend a rig (reconciler will skip its agents)

gc rig add

Register an external project directory as a rig.

Initializes beads database, installs agent hooks if configured, generates cross-rig routes, and appends the rig to city.toml. If the target directory doesn't exist, it is created. Use --include to apply a pack source that defines the rig's agent configuration; repeat the flag to compose multiple packs for one rig. The flag is compatibility sugar: gc rig add writes canonical rig imports.

--include takes a pack source (local path or remote URL) or a pack name: a bundled pack ("gastown"), or a registry pack resolved from the cached registry catalogs, including a scoped community name ("owner/pack"). A "./" prefix or a "packs/<name>" token is never read as a registry name (a bundled pack still canonicalizes, so "./gastown" resolves to the bundled source), and an existing directory always wins over a registry pack of the same name.

Use --name to set the rig name explicitly (default: directory basename). Use --prefix to set the bead ID prefix explicitly (default: derived from name). Use --default-branch to set the rig's mainline branch explicitly. By default, gc rig add probes the repo's remote HEADs — origin first, then any other configured remote — and falls back to the currently checked-out branch, then stores the result in city.toml so polecats and the refinery target the right branch without manual metadata patching. The banner reports which remote answered, or says the branch was inferred when no remote HEAD is set. Use --start-suspended to add the rig in a suspended state (dormant-by-default). The rig's agents won't spawn until explicitly resumed with "gc rig resume".

Use --adopt to register a directory that already has a fully initialized .beads/ directory (must include both metadata.json and config.yaml). For managed-Dolt rigs, runs an idempotent config sync (registers types.custom and other config into the DB, never destructively reinitializes). The git repo check remains informational.

gc rig add <path> [flags]

Example:

gc rig add /path/to/project
gc rig add /path/to/project --name myrig
gc rig add /path/to/project --prefix r1
gc rig add /path/to/master-repo --default-branch master
gc rig add ./my-project --include gastown
gc rig add ./my-project --include packs/planner --include packs/architect
gc rig add ./my-project --include acme/planner
gc rig add ./my-project --include gastown --start-suspended
gc rig add /path/to/existing --adopt
FlagTypeDefaultDescription
--adoptbooladopt existing .beads/ directory (skip init)
--allow-ephemeralboolregister the rig even though its path is on a filesystem that does not survive a restart
--default-branchstringmainline branch (default: auto-detect from a remote HEAD — origin preferred — or the current branch)
--git-urlstringgit URL to clone into a new rig on a REMOTE city (server-side provisioning)
--includestringArraypack source or pack name for rig agents (repeatable; writes canonical rig imports)
--jsonboolOutput in JSONL format
--namestringrig name (default: directory basename, or git URL basename for --git-url)
--prefixstringbead ID prefix (default: derived from name)
--request-idstringidempotency key for a remote --git-url add; reuse it to resume/retry a provision
--start-suspendedbooladd rig in suspended state (dormant-by-default)

gc rig list

List all registered rigs with their paths, prefixes, default branches, and beads status.

Shows the HQ rig (the city itself) and all configured rigs. Each rig displays its bead ID prefix, recorded default branch when set, and whether its beads database is initialized.

gc rig list [flags]
FlagTypeDefaultDescription
--jsonboolOutput in JSON format

gc rig remove

Remove a rig from the current city's configuration.

Removes the rig entry from city.toml and removes its machine-local path binding from .gc/site.toml.

gc rig remove <name> [flags]

Example:

gc rig remove myrig
FlagTypeDefaultDescription
--jsonboolOutput in JSONL format

gc rig restart

Kill all agent sessions belonging to a rig.

The reconciler will restart the agents on its next tick. This is a quick way to force-refresh all agents working on a particular project.

gc rig restart [name]

gc rig resume

Resume a suspended rig by recording an explicit "resumed" preference in .gc/runtime/suspension-state.json. The override sticks across city restarts even when the rig declares suspended_on_start = true.

The reconciler will start the rig's agents on its next tick.

gc rig resume [name] [flags]
FlagTypeDefaultDescription
--jsonboolOutput in JSONL format

gc rig set-endpoint

Set the canonical endpoint ownership for a rig.

Use --inherit to make a rig derive its endpoint from the current city topology. Use --external to pin the rig to its own external Dolt endpoint. Use --self to mark the rig as running its own local Dolt server on 127.0.0.1 at the given --port; while the city is in managed_city mode the command requires --force because the rig's .beads/dolt-server.port mirror will no longer track the managed city Dolt.

This command owns the rig's canonical .beads/config.yaml topology state.

gc rig set-endpoint <rig> [flags]

Example:

gc rig set-endpoint frontend --inherit
gc rig set-endpoint frontend --external --host db.example.com --port 3307
gc rig set-endpoint frontend --external --host db.example.com --port 3307 --user agent --adopt-unverified
gc rig set-endpoint frontend --self --port 28232 --force
gc rig set-endpoint frontend --inherit --dry-run
FlagTypeDefaultDescription
--adopt-unverifiedboolrecord the endpoint without live validation
--dry-runboolshow the canonical changes without writing files
--externalboolset an explicit external endpoint for the rig
--forceboolacknowledge conflicting managed-city state when using --self
--hoststringexternal Dolt host
--inheritboolinherit the city endpoint
--jsonboolOutput in JSONL format
--portstringexternal Dolt port (required with --external or --self)
--selfboolmark the rig as running its own local Dolt on 127.0.0.1
--userstringexternal Dolt user

gc rig status

Show rig status and agent running state

gc rig status [name] [flags]
FlagTypeDefaultDescription
--jsonboolOutput in JSON format

gc rig suspend

Suspend a rig by recording the suspension in the runtime state file (.gc/runtime/suspension-state.json).

All agents scoped to the suspended rig are effectively suspended — the reconciler skips them and gc hook returns empty. The rig's beads database remains accessible. Use "gc rig resume" to restore.

Suspension state is stored in the runtime directory, not city.toml, so it is local to this machine and does not need to be committed.

gc rig suspend [name] [flags]
FlagTypeDefaultDescription
--jsonboolOutput in JSONL format

gc runtime

Process-intrinsic runtime operations called by agent code from within sessions.

These commands read and write session metadata to coordinate lifecycle events (drain, restart) between agents and the controller. They are designed to be called from within running agent sessions, not by humans.

The exception is "gc runtime check", which validates a Runtime Provider Protocol executable — run by humans and runtime-pack CIs.

gc runtime
SubcommandDescription
gc runtime checkValidate a runtime executable against the Runtime Provider Protocol
gc runtime conformanceRun the golden RPP conformance suite against a runtime executable
gc runtime drainSignal a session to drain (wind down gracefully)
gc runtime drain-ackAcknowledge drain — signal the controller to stop this session
gc runtime drain-checkCheck if a session is draining (exit 0 = draining)
gc runtime heartbeatExtend idle-timeout window during a long operation
gc runtime request-restartRequest controller restart this session (waits to be killed)
gc runtime undrainCancel drain on a session

gc runtime check

Validate a runtime executable against the Runtime Provider Protocol (RPP v0).

Runs the protocol handshake, the required lifecycle round-trip (start, is-running, stop, idempotent stop), exercises every capability the handshake declares, and probes optional operations. Optional operations that are absent (exit 2) are reported but never fail the run; everything else that misbehaves does. Exits non-zero if any check fails, so a runtime pack's CI can gate on it directly.

One exception: when the argument resolves to a pack-declared runtime whose [runtimes.<name>] entry declares prompt_delivery = "nudge-fallback", the nudge probe is reported as "required: nudge" and an absent or broken nudge op fails the run — the declaration is smoke-tested, not trusted.

The argument is an executable (path or PATH name) or a pack-declared runtime name: when it names a [runtimes.<name>] entry from the current city's packs, the check runs against that pack's declared command. Arguments containing a path separator, or matching an existing file, are always treated as the executable itself.

The protocol contract is docs/reference/exec-session-provider.md.

gc runtime check <name|executable> [flags]
FlagTypeDefaultDescription
--commandstringsession command sent in the start config (default "sleep 300")
--session-namestringsession name for the conformance round-trip (default: generated unique name)

gc runtime conformance

Run the golden Runtime Provider Protocol conformance suite against an executable. Every requirement is requirement-coded (RPP-<GROUP>-NNN) and mirrors the in-tree provider contract (RunProviderTests); a run that passes every required requirement is guaranteed to behave like a gascity runtime.

Unlike "gc runtime check" (a lighter smoke test), each requirement is proven to gate: the suite is kept honest by negative tests in which a broken reference fails exactly its requirement's check.

The argument is an executable (path or PATH name) or a pack-declared runtime name from the current city's packs. Path-like or existing-file arguments are always the executable itself.

Use --json for a machine-readable report (CI artifacts). Exits non-zero if any required requirement fails.

gc runtime conformance <name|executable> [flags]
FlagTypeDefaultDescription
--envboolalso run the environment-plane capability suite (env.* guarantees)
--jsonboolemit a machine-readable JSON report

gc runtime drain

Signal a session to drain — wind down its current work gracefully.

Sets a GC_DRAIN metadata flag on the session. The agent should check for drain status periodically (via "gc runtime drain-check") and finish its current task before exiting. Pass a session alias or ID. Use "gc runtime undrain" to cancel.

gc runtime drain <name> [flags]
FlagTypeDefaultDescription
--jsonboolOutput as JSON

gc runtime drain-ack

Acknowledge a drain signal — tell the controller to stop this session.

Sets GC_DRAIN_ACK metadata on the session, then pokes the controller socket so the reconciler stops the session immediately rather than on its next patrol tick. Call this after the session has finished its current work in response to a drain signal.

gc runtime drain-ack [name] [flags]
FlagTypeDefaultDescription
--jsonboolOutput as JSON

gc runtime drain-check

Check if a session is currently draining.

Returns exit code 0 if draining, 1 if not. Designed for use in conditionals: "if gc runtime drain-check; then finish-up; fi". Without arguments, uses the current session context.

gc runtime drain-check [name] [flags]
FlagTypeDefaultDescription
--jsonboolOutput as JSON

gc runtime heartbeat

Extend the idle-timeout and max-session-age windows during a long operation.

Sets held_until on the current session's bead, suppressing the idle-timeout and max-session-age timers until the hold expires. Call this at the start of slow operations that produce no terminal output and would otherwise trigger a false-alarm watchdog kill.

The hold is automatically cleared by the reconciler once held_until passes. This is the agent-facing API for the held_until bead-metadata mechanism; it does not put the session into a suspended state or change its sleep_intent.

The default duration (45m0s) covers long-running operations. Pass --duration to override.

gc runtime heartbeat [flags]
FlagTypeDefaultDescription
--durationstringhold duration (e.g. 30m, 1h); default 45m0s
--jsonboolOutput as JSON

gc runtime request-restart

Signal the controller to stop and restart this session.

Sets GC_RESTART_REQUESTED metadata on the session, then waits while the controller stops the session on its next reconcile tick and restarts it fresh. The wait keeps the agent idle so it does not consume more context in the interim.

Under normal operation the controller SIGKILLs the process tree before this command returns. If the controller accepts the stop handoff, the runtime is already gone, or a SIGINT/SIGTERM is received, the command exits 0 cleanly. If the controller has not acted within a bounded timeout (max(5*PatrolInterval, 5min), capped at 30min) the command exits 1 with a diagnostic pointing at controller health.

This command is designed to be called from within a session context. It emits a session.draining event before waiting.

gc runtime request-restart

gc runtime undrain

Cancel a pending drain signal on a session.

Clears the GC_DRAIN and GC_DRAIN_ACK metadata flags, allowing the session to continue normal operation. Pass a session alias or ID.

gc runtime undrain <name> [flags]
FlagTypeDefaultDescription
--jsonboolOutput as JSON

gc service

Inspect workspace services

gc service
SubcommandDescription
gc service doctorShow detailed workspace service status
gc service listList workspace services
gc service restartRestart a workspace service

gc service doctor

Show detailed workspace service status

gc service doctor <name> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSON

gc service list

List workspace services

gc service list [flags]
FlagTypeDefaultDescription
--jsonboolemit JSON

gc service restart

Stop and restart a workspace service by name.

The controller closes the current service process and starts a fresh one. Useful after updating pack scripts without a full city restart.

gc service restart <name> [flags]
FlagTypeDefaultDescription
--jsonboolOutput in JSONL format

gc session

Create, resume, suspend, and close persistent conversations with agents.

Sessions are conversations backed by agent templates. They can be suspended to free resources and resumed later with full conversation continuity.

gc session
SubcommandDescription
gc session attachAttach to (or resume) a chat session
gc session closeClose a session permanently
gc session killForce-kill session runtime (reconciler restarts)
gc session listList chat sessions
gc session logsShow session logs for a session
gc session newCreate a new chat session from an agent template
gc session nudgeSend a text message to a running session
gc session peekView session output without attaching
gc session pinKeep a session awake
gc session pruneClose old dormant sessions
gc session renameRename a session
gc session resetRestart a session fresh while preserving the bead
gc session submitSubmit a message with semantic delivery intent
gc session suspendSuspend a session (save state, free resources)
gc session unpinRemove a session awake pin
gc session waitRegister a dependency wait for a session
gc session wakeWake a session (request start and clear holds)

gc session attach

Attach to a running session or resume a suspended one.

If the session is active with a live tmux session, reattaches. If the session is suspended or the tmux session died, resumes using the provider's resume mechanism (if supported) or restarts.

Accepts a session ID (e.g., gc-42) or session alias (e.g., mayor).

gc session attach <session-id-or-alias>

gc session close

End a conversation. Stops the runtime if active and closes the bead.

Accepts a session ID (e.g., gc-42) or session alias (e.g., mayor).

gc session close <session-id-or-alias> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL

gc session kill

Force-kill the runtime process for a session without changing its bead state.

The session remains marked as active, so the reconciler will detect the dead process and restart it according to the session's lifecycle rules. This is useful for unsticking a session without losing its conversation history.

Accepts a session ID (e.g., gc-42) or session alias (e.g., mayor).

gc session kill <session-id-or-alias> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL

gc session list

List all chat sessions. By default shows active and suspended sessions.

gc session list [flags]
FlagTypeDefaultDescription
--jsonboolJSON output
--statestringfilter by state: "active", "suspended", "closed", "all"
--templatestringfilter by template name

gc session logs

Show structured session log messages from a session's JSONL file.

Reads the session log, resolves the conversation DAG, and prints messages in chronological order. Searches default paths (~/.claude/projects/) and any extra paths from [daemon] observe_paths in city.toml.

Use --tail to print only the last N transcript entries (0 = all). Semantics match Unix 'tail -n': '--tail 5' prints the final 5 entries, not the first 5. A single assistant turn with multiple tool-use blocks still counts as one entry. Compact-boundary dividers count as entries when they fall inside the final window.

Compatibility note: before 1.0, --tail mapped to compaction segments. As of 1.0, --tail trims the displayed transcript entry window instead. The HTTP API's tail query parameter still uses compaction-segment semantics. Use -f to follow new messages as they arrive.

gc session logs <session> [flags]

Example:

gc session logs mayor
gc session logs mayor --tail 2
gc session logs gc-123 --tail 20
gc session logs gc-123 --tail 0
gc session logs s-gc-123 -f
FlagTypeDefaultDescription
-f, --followboolFollow new messages as they arrive
--jsonboolemit JSONL result for the bounded snapshot
--tailint10Number of most recent transcript entries to show (0 = all; compact dividers count as entries)

gc session new

Create a new persistent conversation from an agent template defined in the loaded city configuration. By default, attaches the terminal after creation.

When --title-hint is provided without --title, the session title is auto-generated from the hint text: a short version is set immediately and refined by the title model in the background.

If the template config sets tmux_alias, it controls the runtime tmux session_name. --alias still sets the public command and mail alias.

gc session new <template> [flags]

Example:

gc session new helper
gc session new helper --alias sky
gc session new helper --title "debugging auth"
gc session new helper --title-hint "fix the login redirect loop"
gc session new helper --no-attach
FlagTypeDefaultDescription
--aliasstringhuman-friendly session identifier for commands and mail
--jsonboolJSON output
--no-attachboolcreate session without attaching
--titlestringhuman-readable session title
--title-hintstringtext to auto-generate a session title from
--wait-timeoutduration2m0smax time to wait for the reconciler to start the session before attaching

gc session nudge

Send text input to a running session via the runtime provider.

The message is delivered as text content to the session's input. This is equivalent to typing the message into the session's terminal.

Accepts a session ID or session alias. Multi-word messages are joined automatically.

gc session nudge <id-or-alias> <message...> [flags]
FlagTypeDefaultDescription
--deliverystringwait-idledelivery mode: immediate, wait-idle, or queue
--jsonboolJSON output

gc session peek

View session output without attaching

gc session peek <session-id-or-alias> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL result
--linesint50number of lines to capture

gc session pin

Keep a session awake by setting its durable pin override.

Pinning does not clear suspend holds or other hard blockers. If the target is a configured named session that has not been materialized yet, pin creates its canonical bead so the reconciler can start it when unblocked.

gc session pin <session-id-or-alias> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL

gc session prune

Close dormant sessions older than a given age. By default only suspended sessions are affected — active sessions are never pruned. Pass --state to opt asleep or drained sessions into the same cleanup pass; multiple states may be comma-separated.

gc session prune [flags]

Example:

gc session prune --before 7d
gc session prune --before 24h
gc session prune --state asleep,suspended,drained --before 1h
FlagTypeDefaultDescription
--beforestring7dprune sessions older than this duration (e.g., 7d, 24h)
--jsonboolemit JSONL
--statestringsuspendedcomma-separated states to prune (suspended, asleep, drained)

gc session rename

Rename a session

gc session rename <session-id-or-alias> <title> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL

gc session reset

Request a fresh restart for an existing session without closing its bead.

The controller stops the current runtime and starts the same session again with fresh provider conversation state. Session identity, alias, mail, and queued work remain attached to the existing session bead. For named sessions, reset also clears any tripped named-session respawn circuit breaker before requesting the fresh restart.

Accepts a session ID (e.g., gc-42) or session alias (e.g., mayor).

gc session reset <session-id-or-alias> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL

gc session submit

Submit a user message to a session without choosing provider transport details.

The runtime decides whether to wake, inject immediately, or queue the message according to the selected semantic intent.

gc session submit <id-or-alias> <message...> [flags]

Example:

gc session submit mayor "status update"
gc session submit mayor "after this run, handle docs" --intent follow_up
gc session submit mayor "stop and do this instead" --intent interrupt_now
FlagTypeDefaultDescription
--intentstringdefaultsubmit intent: default, follow_up, or interrupt_now
--jsonboolJSON output

gc session suspend

Suspend an active session by stopping its runtime process. The session bead persists and can be resumed later.

Accepts a session ID (e.g., gc-42) or session alias (e.g., mayor).

gc session suspend <session-id-or-alias> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL

gc session unpin

Remove only the durable pin override from a session.

Unpinning does not force an immediate stop. The reconciler will apply the normal wake/sleep rules on its next pass.

gc session unpin <session-id-or-alias> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL

gc session wait

Register a dependency wait for a session

gc session wait [session-id-or-alias] [flags]
FlagTypeDefaultDescription
--anyboolwake when any watched bead closes (default: all)
--notestringreminder text delivered when the wait is satisfied
--on-beadsstringSlicebead IDs to watch
--sleepboolset wait hold so the session can drain to sleep

gc session wake

Request wake for a session and release user hold or crash-loop quarantine metadata.

After waking, the reconciler will start the session on its next tick if it has wake reasons (e.g., a matching config agent). If the session has no wake reasons, it remains asleep.

Accepts a session ID (e.g., gc-42) or session alias (e.g., mayor).

gc session wake <session-id-or-alias> [flags]

Example:

gc session wake gc-42
gc session wake mayor
FlagTypeDefaultDescription
--jsonboolemit JSONL

gc shell

The shell integration adds a completion hook to your shell RC file that provides tab-completion for gc commands and flags.

Subcommands: install, remove, status.

gc shell
SubcommandDescription
gc shell installInstall or update shell integration
gc shell removeRemove shell integration
gc shell statusShow shell integration status

gc shell install

Install or update the gc shell completion hook.

If no shell is specified, the shell is detected from $SHELL. The completion script is written to ~/.gc/completions/ and a source line is added to your shell RC file.

gc shell install [bash|zsh|fish]

gc shell remove

Remove the gc shell completion hook from your shell RC file and delete the completion script.

gc shell remove

gc shell status

Show shell integration status

gc shell status [flags]
FlagTypeDefaultDescription
--jsonboolOutput one JSONL result record

gc skill

List skills visible to the current city.

Output includes:

  • City pack skills (skills/<name>/SKILL.md under the city root)
  • Imported pack shared skills (binding-qualified, e.g. ops.code-review)
  • Compatibility bootstrap skills, when legacy implicit imports still exist
  • With --agent/--session: that agent's agents/<name>/skills/ catalog

The listing is a diagnostic view of what's available. It does not collapse precedence, filter to agents whose provider has a vendor sink, or predict exactly which entries the materializer will pick on name collision. For the materialized set, inspect the <scope-root>/.<vendor>/skills/ sink after "gc start" or run "gc doctor" to surface collisions.

gc skill
SubcommandDescription
gc skill listList visible skills

gc skill list

List the current shared and agent-local visible skills, optionally scoped to an agent or session.

gc skill list [flags]
FlagTypeDefaultDescription
--agentstringshow the effective skill view for this agent
--jsonboolemit JSON summary
--sessionstringshow the effective skill view for this session

gc sling

Route a bead to a session config or agent using the target's sling_query.

The target is an agent qualified name (e.g. "mayor" or "hello-world/polecat"). The second argument is a bead ID, a formula name when --formula is set, or arbitrary text (which auto-creates a task bead).

When target is omitted, the bead's rig prefix is used to look up the rig's default_sling_targets (or default_sling_target) from config and one is chosen at random. Requires --formula to have an explicit target. Inline text also requires an explicit target.

With --formula, the formula is instantiated and its root bead is routed to the target. v2 formulas — those declaring [requires] formula_compiler = ">=2.0.0" — start a workflow; v1 formulas instantiate a wisp (ephemeral molecule). A v2 formula that references {{convoy_id}} or contains a drain step requires a target convoy: route it with gc sling <target> <bead> --on <formula>, or attach it with gc formula cook --attach. Formula slings to a pool (multi-session) target are rejected unless the compiled root is Ready-visible — a v2 workflow root or a root-only wisp. See docs/reference/specs/formula-spec-v2.md for the formula format and contract details.

Examples: gc sling my-rig/claude BL-42 # route existing bead gc sling my-rig/claude "write a README" # create bead from text, then route gc sling mayor code-review --formula # instantiate formula, route its root echo "fix login" | gc sling mayor --stdin # read bead text from stdin

gc sling [target] <bead-or-formula-or-text> [flags]
FlagTypeDefaultDescription
-n, --dry-runboolshow what would be done without executing
--forceboolsuppress warnings, allow cross-rig routing, allow formulas v2 workflow replacement, and for direct bead routes dispatch even if the bead does not resolve in the local store
-f, --formulabooltreat argument as formula name
--jsonboolOutput dispatch result in JSON format
--mergestringmerge strategy: direct, mr, or local
--no-convoyboolskip auto-convoy creation
--no-formulaboolsuppress default formula (route raw bead)
--nudgeboolnudge target after routing
--onstringattach wisp from formula to bead before routing
--ownedboolmark auto-convoy as owned (skip auto-close)
--reassignboolclear any existing human assignee before routing (for human→pool handoff)
--scope-kindstringlogical workflow scope kind for formulas v2 launches
--scope-refstringlogical workflow scope ref for formulas v2 launches
--stdinboolread bead text from stdin (first line = title, rest = description)
-t, --titlestringwisp root bead title (with --formula or --on)
--varstringArrayvariable substitution for formula (key=value, repeatable)

gc start

Start the city under the machine-wide supervisor.

Requires an existing city bootstrapped by "gc init". Fetches remote packs as needed, registers the city with the machine-wide supervisor, ensures the supervisor is running, and triggers immediate reconciliation. Use "gc supervisor run" for foreground operation.

gc start [path|name] [flags]

Example:

gc start
gc start ~/my-city
gc start --dry-run
gc supervisor run
FlagTypeDefaultDescription
-n, --dry-runboolpreview what agents would start without starting them
--jsonboolemit JSONL summary
--no-auto-restartbooldetect supervisor binary drift but do not auto-restart; exits non-zero on drift
--verbosebooldisable warning deduplication and print every supervisor warning

gc status

Shows a city-wide overview: controller state, suspension, all agents with running status, rigs, and a summary count.

gc status [path|name] [flags]
FlagTypeDefaultDescription
--formatstringOutput format: text or json
--jsonboolOutput in JSON format

gc stop

Stop all agent sessions in the city with graceful shutdown.

Sends interrupt signals to running agents, waits for the configured shutdown timeout, then force-kills any remaining sessions. Also stops the Dolt server and cleans up orphan sessions. If a controller is running, delegates shutdown to it.

If the city is registered with the machine-wide supervisor, stop also unregisters it (equivalent to a following "gc unregister") — the city will not be found by name or auto-started again until it is re-registered with "gc register". Use "gc unregister" directly to remove a registration without stopping sessions.

Use --timeout=DURATION to cap the wall-clock time gc stop will spend before giving up; the default budgets configured session interrupt and stop waves, the configured shutdown grace wait, and a second orphan cleanup pass. Use --force to skip the interrupt grace period and go straight to kill.

gc stop [path|name] [flags]
FlagTypeDefaultDescription
--forceboolskip the interrupt grace period and force-kill all sessions immediately
--jsonboolemit JSONL summary
--timeoutduration0swall-clock cap for the stop sequence (0 = derive from city config)

gc storage

Move this city's storage-class layout, and report on it.

These are operator commands. Nothing here runs on boot: a city whose [storage.classes] name a binding it has not converged on refuses to start and names the migrate command, because the source's writer set is something an operator arranges rather than something a program can observe.

gc storage
SubcommandDescription
gc storage migrateMigrate this city's infrastructure classes onto their configured binding
gc storage preflightReport what the migration would refuse, without migrating (read-only)
gc storage recover-strandedCopy stranded infrastructure beads from the retained work store into the converged binding
gc storage statusReport this city's storage-class layout (read-only)

gc storage migrate

Copy this city's infrastructure-class beads out of the work store and into the binding [storage.classes] assigns them to.

Every bead is copied with its id and its within-class dependency topology preserved, proven field-equal against a closed and reopened destination, and then recorded in a proven-copy manifest and a convergence marker. The source is RETAINED verbatim: nothing here writes to, moves or prunes the work store, so a rollback before cutover is a config edit with no data recovery step.

The move refuses while a writer can reach the source. This binary can prove the absence of a controller and cannot prove the absence of anything else, so that half is an explicit operator attestation.

gc storage migrate [flags]
FlagTypeDefaultDescription
--fleet-stoppedboolattest that every writer that can reach this city's work store is stopped — not just its controller, which this command proves on its own
--from-workboolmigrate the infrastructure classes out of this city's work store

gc storage preflight

Run every check gc storage migrate --from-work runs and report what it finds — without copying anything, creating anything, taking the migration guard, or publishing any event.

This is for deciding whether the window you are about to take will be spent migrating or spent reading a refusal. It runs against a LIVE city: a controller serving this city is reported by PID rather than refused, because stopping it is the next thing you were going to do anyway.

It resolves its destination from [storage.classes], so it has nothing to check until that section names a binding. On a city with no infrastructure split it reports exactly that and exits non-zero — author the split first.

It exits non-zero when the migration would refuse for a reason you have to go and fix first. That is a different question from gc storage status, which exits non-zero whenever the city is not yet serving from its binding — the ordinary state of every city with a cutover still ahead of it.

One condition is never checked here, because no process can check it: --fleet-stopped attests that every writer that can reach this city's work store is stopped — not just its controller, which this command proves on its own.

gc storage preflight

gc storage recover-stranded

Copy the infrastructure beads a converged city's proven copy never carried out of the retained work store and into the binding that is already serving.

This is the recovery the stranded-write refusal names. It is additive: it moves only ids the binding does not hold and the proven-copy manifest does not record, it deletes nothing from either store, and it extends the manifest only after every moved bead has been proven equal against a closed and reopened destination. A bead whose class it cannot state is named and left where it is.

It refuses on a city that has NOT converged — the whole copy is still owed there, and gc storage migrate --from-work is what owes it. It is not that command run twice: the migration is one-shot on purpose, and forcing it to re-copy would re-import a serving binding from a source that no longer holds what the binding does.

gc storage recover-stranded [flags]
FlagTypeDefaultDescription
--dry-runboolreport the gap and write the dump without touching the binding or the manifest
--dumpstringwrite every stranded bead and its source dep edges to this JSON file before any write
--fleet-stoppedboolattest that every writer that can reach this city's work store is stopped — not just its controller, which this command proves on its own
--from-workboolrecover the stranded infrastructure beads out of this city's work store

gc storage status

Report which binding serves each storage class, whether this city has converged onto it, and what the retained source and the binding each hold.

This path is read-only against a LIVE city: it creates no directory, database, write-ahead log, shared-memory index, schema, marker or manifest. It does not open the binding's engine unless that database already exists, because opening it would create the very database the report is being asked about.

It exits non-zero when the city is configured for a binding it has not converged on, so a deployment script can gate on it. That is the ordinary state of every city with a cutover still ahead of it, and it is NOT a fault report: a non-zero status here says the migration has not run, not that it would fail. To find out whether it would fail, run gc storage preflight, which rehearses every check the migration makes without migrating.

gc storage status

gc supervisor

Manage the machine-wide supervisor.

The supervisor manages all registered cities from a single process, hosting a unified API server. Use "gc init", "gc start", or "gc register" to add cities.

gc supervisor
SubcommandDescription
gc supervisor installInstall the supervisor as a platform service
gc supervisor logsTail the supervisor log file
gc supervisor reloadTrigger immediate reconciliation of all cities
gc supervisor runRun the machine-wide supervisor in the foreground
gc supervisor startStart the machine-wide supervisor in the background
gc supervisor statusCheck if the supervisor is running
gc supervisor stopStop the machine-wide supervisor
gc supervisor uninstallRemove the platform service

gc supervisor install

Install the machine-wide supervisor as a platform service that starts on login.

gc supervisor install [flags]
FlagTypeDefaultDescription
--forcebooloverwrite an existing service unit even if it references a different gc binary

gc supervisor logs

Tail the machine-wide supervisor log file.

Shows recent log output from background and service-managed supervisor runs.

When GC_SUPERVISOR_LOG_TEE=0 is set in this shell, the supervisor may be writing only to the service manager's log: an existing log file is still tailed (with a staleness warning), and when the file is absent the command points at the service manager's log instead.

gc supervisor logs [flags]
FlagTypeDefaultDescription
-f, --followboolfollow log output
-n, --linesint50number of lines to show

gc supervisor reload

Send a reload signal to the running supervisor, causing it to immediately re-read the registry and reconcile all cities. Use this after killing a child process to force the supervisor to detect the change and restart it without waiting for the next patrol tick.

gc supervisor reload [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL summary

gc supervisor run

Run the machine-wide supervisor in the foreground.

This is the canonical long-running control loop. It reads ~/.gc/cities.toml for registered cities, manages them from one process, and hosts the shared API server.

Output is teed into ~/.gc/supervisor.log so 'gc supervisor logs' works regardless of how the supervisor was invoked. Set GC_SUPERVISOR_LOG_TEE=0 in the supervisor's environment to disable the tee when the service manager already captures output (e.g. a hand-managed systemd unit with StandardOutput=journal).

gc supervisor run

gc supervisor start

Start the machine-wide supervisor in the background.

This forks "gc supervisor run", verifies it became ready, and returns.

gc supervisor start [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL summary

gc supervisor status

Check if the supervisor is running

gc supervisor status [flags]
FlagTypeDefaultDescription
--jsonboolemit JSON

gc supervisor stop

Stop the running machine-wide supervisor and all its cities.

By default, returns as soon as the supervisor acknowledges the stop request — shutdown continues asynchronously. Pass --wait to block until the supervisor socket is no longer answering, which is what most callers that need deterministic cleanup want (e.g., integration tests that then expect to remove temp directories without racing against lingering supervisor / controller subprocesses).

When GC_SUPERVISOR_SYSTEMD_UNIT is set, stop is delegated to 'systemctl [--user] stop <unit>' instead of the control-socket stop. The systemctl invocation is synchronous and bounded by --wait-timeout whether or not --wait is set, gc then verifies a previously-running supervisor actually exited (failing with its PID when the unit does not manage it), and stop with nothing running still exits 1.

gc supervisor stop [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL summary
--waitboolWait for the supervisor to finish stopping all managed cities and release its socket before returning
--wait-timeoutduration30sMaximum time to wait when --wait is set (in delegated mode, bounds the synchronous systemctl stop regardless of --wait)

gc supervisor uninstall

Remove the platform service and stop the machine-wide supervisor.

On systemd, uninstall refuses to remove an active unit when the supervisor control socket is unavailable. Start the supervisor first so it can re-adopt preserved sessions, then retry uninstall.

gc supervisor uninstall

gc suspend

Suspends the city by recording an explicit "suspended" preference in .gc/runtime/suspension-state.json (per-clone runtime state, not committed).

This inherits downward — when the city is suspended, all agents are effectively suspended regardless of their individual suspended fields. The reconciler won't spawn agents, gc hook/prime return empty.

Use "gc resume" to restore.

gc suspend [path|name] [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL summary

gc trace

Inspect and control the session reconciler trace stream.

Trace state is persisted locally under .gc/runtime/session-reconciler-trace and can be managed even when the controller is offline.

gc trace
SubcommandDescription
gc trace cycleShow a cycle by tick id
gc trace reasonsShow reason codes observed in trace records
gc trace showShow trace records
gc trace startStart or extend tracing for a template
gc trace statusShow trace arms and stream state
gc trace stopStop tracing for a template
gc trace tailFollow trace records

gc trace cycle

Show a cycle by tick id

gc trace cycle [flags]
FlagTypeDefaultDescription
--tickstringtick id to display

gc trace reasons

Show reason codes observed in trace records

gc trace reasons [flags]
FlagTypeDefaultDescription
--sincestringshow reasons since duration ago
--templatestringexact normalized template selector

gc trace show

Show trace records

gc trace show [flags]
FlagTypeDefaultDescription
--jsonboolemit JSON result
--reasonstringfilter by reason code
--sincestringshow records since duration ago
--templatestringexact normalized template selector
--tickstringfilter by tick id
--trace-idstringfilter by trace id
--typestringfilter by record type

gc trace start

Start or extend tracing for a template

gc trace start [flags]
FlagTypeDefaultDescription
--autoboolmark the arm as auto-triggered
--forstring15mtrace arm duration (e.g. 15m)
--levelstringdetailtrace level: baseline or detail
--templatestringexact normalized template selector

gc trace status

Show trace arms and stream state

gc trace status [flags]
FlagTypeDefaultDescription
--jsonboolemit JSON result

gc trace stop

Stop tracing for a template

gc trace stop [flags]
FlagTypeDefaultDescription
--allboolremove both manual and auto arms
--templatestringexact normalized template selector

gc trace tail

Follow trace records

gc trace tail [flags]
FlagTypeDefaultDescription
--sincestringfollow from duration ago
--templatestringexact normalized template selector

gc unregister

Remove a city from the machine-wide supervisor registry.

The argument may be a path to a city directory or a registered city name (as shown by 'gc cities'); a name is resolved against the supervisor registry. An existing local city directory of the same name takes precedence over a registration; if a local city directory and a different registration both exist, the name is reported as ambiguous. If no argument is given, unregisters the current city (discovered from cwd). If the supervisor is running, it immediately stops managing the city. Unlike 'gc register' (which is idempotent), this errors when the resolved path is not a registered city, so it is not a silent no-op on an unknown target.

gc unregister [path|name] [flags]
FlagTypeDefaultDescription
--jsonboolemit JSONL summary

gc version

Print the gc version string.

Use --long to include git commit and build date metadata.

gc version [flags]
FlagTypeDefaultDescription
--jsonboolemit JSON summary
-l, --longboolInclude git commit and build date metadata

gc wait

Inspect and manage durable session waits

gc wait
SubcommandDescription
gc wait cancelCancel a wait
gc wait inspectShow details for a wait
gc wait listList durable waits
gc wait readyManually mark a wait ready

gc wait cancel

Cancel a wait

gc wait cancel <wait-id> [flags]
FlagTypeDefaultDescription
--jsonboolOutput in JSONL format

gc wait inspect

Show details for a wait

gc wait inspect <wait-id> [flags]
FlagTypeDefaultDescription
--jsonboolemit JSON

gc wait list

List durable waits

gc wait list [flags]
FlagTypeDefaultDescription
--jsonboolemit JSON
--sessionstringfilter by session ID
--statestringfilter by wait state

gc wait ready

Manually mark a wait ready

gc wait ready <wait-id> [flags]
FlagTypeDefaultDescription
--jsonboolOutput in JSONL format

gc whoami

Show the authenticated hosted Gas City account

gc whoami [flags]
FlagTypeDefaultDescription
--atstringservice base URL; defaults to GC_SERVICE_URL, the stored default, then https://gascity.com
--tokenstringAPI token to check; defaults to GC_SERVICE_TOKEN or the stored login

gc worktree

Ensure or verify agent workspace worktrees.

gc worktree is the single transactional owner for workspace provisioning. Postconditions: the path is a direct child of the configured per-rig root and the root of a worktree of the given repository, with the bead's uniquely named branch checked out on an attached HEAD (never detached). Durable provenance is stored in the worktree's private git directory and returned as JSON so callers can atomically publish the same evidence on the bead. A new branch is created from --base, resolved verbatim against the local repository. Failed creation rolls back everything it created; --dry-run plans without mutating anything.

gc worktree
SubcommandDescription
gc worktree cleanupRemove an owned worktree after all safety gates pass
gc worktree ensureEnsure the worktree exists and satisfies all postconditions
gc worktree verifyVerify the worktree satisfies all postconditions without mutating

gc worktree cleanup

Remove an owned worktree after all safety gates pass.

Cleanup verifies the canonical repository, path, branch, and durable ownership provenance before acting. It refuses dirty worktrees, commits reachable from no branch, tag, or remote-tracking ref, and commits not merged into --base. --attempt-id binds the removal to one exact provisioning attempt, so a stale request cannot remove a workspace re-created at the same path. There is no force mode and no recursive-filesystem fallback. An already-absent, unregistered path is an idempotent success. With --json, safety refusals return a structured cleanup_pending result for formula automation.

gc worktree cleanup [flags]
FlagTypeDefaultDescription
--attempt-idstringattempt id returned by the ensure that created this worktree (required)
--basestringexact base ref used for this worktree (required)
--base-shastringrecorded base SHA to verify when reusing a worktree
--beadstringwork bead bound to this worktree (required)
--branchstringbranch that must be checked out (required)
--creatorstringmechanism creating the worktree (required)
--generationstringprovisioning generation fence (required)
--jsonboolemit the report as JSON
--lifecyclestringactiveworktree lifecycle state
--ownerstringsingle selected provisioning owner (required)
--pathstringworktree path (required)
--repostringrepository directory the worktree belongs to (required)
--rootstringconfigured per-rig worktree root; path must be its direct child (required)
--store-refstringwork bead store reference (required)

gc worktree ensure

Ensure the worktree exists and satisfies all postconditions

gc worktree ensure [flags]
FlagTypeDefaultDescription
--basestringexact base ref used for this worktree (required)
--base-shastringrecorded base SHA to verify when reusing a worktree
--beadstringwork bead bound to this worktree (required)
--branchstringbranch that must be checked out (required)
--creatorstringmechanism creating the worktree (required)
-n, --dry-runboolplan without mutating anything
--generationstringprovisioning generation fence (required)
--jsonboolemit the report as JSON
--lifecyclestringactiveworktree lifecycle state
--ownerstringsingle selected provisioning owner (required)
--pathstringworktree path (required)
--repostringrepository directory the worktree belongs to (required)
--rootstringconfigured per-rig worktree root; path must be its direct child (required)
--store-refstringwork bead store reference (required)

gc worktree verify

Verify the worktree satisfies all postconditions without mutating

gc worktree verify [flags]
FlagTypeDefaultDescription
--basestringexact base ref used for this worktree (required)
--base-shastringrecorded base SHA to verify when reusing a worktree
--beadstringwork bead bound to this worktree (required)
--branchstringbranch that must be checked out (required)
--creatorstringmechanism creating the worktree (required)
--generationstringprovisioning generation fence (required)
--jsonboolemit the report as JSON
--lifecyclestringactiveworktree lifecycle state
--ownerstringsingle selected provisioning owner (required)
--pathstringworktree path (required)
--repostringrepository directory the worktree belongs to (required)
--rootstringconfigured per-rig worktree root; path must be its direct child (required)
--store-refstringwork bead store reference (required)