Gas City’s CLI is human-readable by default. When software callsDocumentation Index
Fetch the complete documentation index at: https://docs.gascityhall.com/llms.txt
Use this file to discover all available pages before exploring further.
gc, use
--json on commands that support it so callers do not have to parse tables,
status text, or progress messages.
The standardized JSON contract is being rolled out across the CLI. This guide
separates what works today from conventions that new and newly standardized
commands should follow.
Quick Start
Use--json on supported commands:
Stdout And Stderr
When--json is passed, stdout is reserved for machine-readable output.
Supported JSON commands should not write human progress lines, tables, banners,
debug text, or summaries to stdout. Important command results belong in JSON
fields, not copied prose.
Stderr remains available for operational diagnostics. A caller should not need
stderr to understand the successful result shape, but stderr may still contain
human-readable details that help debug failures.
Failure Output Today
Currentgc --json commands use the process exit code for shell
success/failure logic. On failure, commands may write human-readable diagnostics
to stderr and may write no JSON to stdout.
Agents and scripts should:
- use the process exit code for shell success/failure logic.
- parse stdout as JSON only after a successful exit.
- capture stderr separately when they need diagnostic text.
- not assume every command emits a structured JSON failure payload yet.
JSONL Framing
For the common bounded-command case, stdout is one complete JSON value. That value may be pretty-printed across multiple physical lines, so do not treat each line as a standalone JSON record for bounded commands. Streaming commands may emit multiple records when their schema says so. For example, event streams naturally use one JSON value per event.Planned Schema Discovery
The--json-schema flag is planned but is not implemented by the current gc
binary. Until it ships, use command help, generated reference docs, and command
source/tests to confirm exact JSON shapes.
The planned discovery contract is:
--json-schema should return a
manifest with json_supported: false and an empty schemas object:
Planned Failure Shape
New or newly standardized JSON commands should eventually return one structured JSON failure record on stdout when--json is passed and the command fails:
Planned Record Counts
JSON Schema describes one JSON value. The planned schema-discovery contract may use an optional extension keyword to describe the record stream around that schema:x-gc-jsonl vocabulary is planned; no current CLI tooling enforces it.
When it is implemented, absence should mean the command emits exactly one
record. When present:
minRecordsis the minimum number of records. If omitted, the minimum is0.maxRecordsis the maximum number of records. If omitted, there is no maximum.{}means zero or more records.{ "minRecords": 1 }means one or more records.{ "minRecords": 0, "maxRecords": 1 }means zero or one record.{ "minRecords": 1, "maxRecords": 1 }means exactly one record, explicitly.
Field Conventions
New or newly standardized JSON commands should use stable field names:| Concept | Preferred field |
|---|---|
| Schema version | schema_version |
| Identifier | id |
| Display name | name |
| Fully scoped name | qualified_name or scoped_name |
| Filesystem path | path |
| Source of data | source |
| Durable reference | ref |
| Lifecycle value | status or state |
| Type discriminator | type |
| Dispatch target | target |
| Creation time | created_at |
| Update time | updated_at |
| Warnings | warnings |
| Summary counts | summary |
gc session list --json currently emits Go struct field names such as ID,
State, CreatedAt, and SessionName. Treat each existing command’s actual
output as authoritative until that command is explicitly standardized.
Warnings that matter to software consumers should appear in structured JSON,
for example:
Pack-Defined Commands
Pack-defined commands can be scripts or external programs, so Gas City does not automatically make arbitrary pack command output JSON-safe. Planned schema discovery for pack-defined commands may use schemas next to the command implementation:commands/review/pr/.
schemas/failure.schema.json is optional. Use it only when the command has
meaningful command-specific failure fields beyond the shared default failure
shape.
This convention is not loaded by current gc runtime code. Treat it as a design
direction until pack command schema discovery is implemented.
Passthrough Commands
Some commands pass arguments through to another CLI. For example,gc bd ...
routes to the bead CLI in the correct city or rig context.
Passthrough commands are not native gc JSON contracts. If the downstream tool
supports JSON, it owns that output shape. Gas City should not represent
passthrough output with a fake “anything is valid” schema.
Compatibility Notes
Existing JSON commands may be standardized over time. A PR that changes an existing JSON output shape should call that out explicitly, including:- the command and invocation.
- the old shape.
- the new shape.
- whether the change is additive or intentionally incompatible.
- the rationale for making the change in that PR.
Related Reference
Use the generated CLI Reference for exact command flags. Use Events for thegc events JSONL event contract.