Use gc --json and gc --json-schema from scripts, agents, tests, and other software.
Gas City’s CLI is human-readable by default. When software calls gc — agents,
shell scripts, dashboard tools, smoke tests, CI — pass --json on commands that
support it, so callers read JSON fields instead of parsing tables, status text,
or progress messages. Human-readable output stays the default for interactive
use.
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.
Newer JSON commands use a common success envelope:
{ "schema_version": "1", "ok": true}
Command-specific fields sit alongside that envelope. For example, a city status
result includes fields such as city_name, city_path, controller,
agents, rigs, and summary.Action commands usually include a command field and an action field:
Use each command’s JSON Schema as the authoritative shape. Do not assume every
command has exactly the same fields beyond the shared success indicators.
Use the process exit code as the first success/failure signal (as in
Quick Start): parse stdout only after a successful exit, and
capture stderr separately for diagnostics. Many failures write to stderr without
a command-specific JSON failure record, so don’t assume every --json command
emits a structured failure payload.JSON Schema requests are different: if a requested schema is unavailable, gc
returns a structured failure payload on stdout and exits nonzero:
gc dashboard --json-schema=result
{ "schema_version": "1", "ok": false, "error": { "code": "json_schema_unavailable", "message": "command \"dashboard\" does not declare JSON support", "exit_code": 1 }}
gc writes complete JSON records followed by newlines. For most bounded
commands, stdout has exactly one record.Some streaming commands can emit multiple records. Their result schema may use
the x-gc-jsonl extension to describe record counts:
Tools can combine --json and --json-schema=result to validate command
output. Start by fetching the schema and command result:
schema="$(gc status --json-schema=result)"result="$(gc status --json)"printf '%s\n' "$result" | jq .
The jq command only confirms that stdout is parseable JSON. Use a JSON Schema
validator when you need contract enforcement. Keep validation at command
boundaries rather than writing ad hoc field checks throughout an agent or
script.For streaming commands, validate each JSONL record against the result schema:
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.For compatibility, local pack-defined commands can still pass their own --json
handling through when they do not declare schemas. Set
GC_JSON_CONTRACT_STRICT=1 in tests or CI when you want missing local command
schemas to fail instead of passing through.
Pack-defined commands can be scripts or external programs, so Gas City does not
automatically make arbitrary pack command output JSON-safe.Pack command schemas live next to the command implementation:
Nested command directories imply nested command paths. In the example above,
the result schema belongs to the pack command leaf represented by
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.
Use the generated CLI Reference for exact command flags.
Use Events for the gc events JSONL event contract.
Use Schemas for published non-CLI schema artifacts such as OpenAPI,
events, and city config.
Last modified on June 16, 2026
⌘I
{"docsConfig":{"theme":"linden","$schema":"https://mintlify.com/docs.json","name":"Gas City Docs","colors":{"primary":"#c9a84c","light":"#c9a84c","dark":"#b8862d"},"logo":{"light":"https://mintcdn.com/gascityinc-5c0069dd/nVs1BR-I28rczSmX/images/logo-wordmark.svg?fit=max\u0026auto=format\u0026n=nVs1BR-I28rczSmX\u0026q=85\u0026s=6987cf243022d0fef33d045e88fc6b53","dark":"https://mintcdn.com/gascityinc-5c0069dd/nVs1BR-I28rczSmX/images/logo-wordmark.svg?fit=max\u0026auto=format\u0026n=nVs1BR-I28rczSmX\u0026q=85\u0026s=6987cf243022d0fef33d045e88fc6b53","href":"https://docs.gascity.com"},"favicon":"https://mintcdn.com/gascityinc-5c0069dd/nVs1BR-I28rczSmX/images/favicon.png?fit=max\u0026auto=format\u0026n=nVs1BR-I28rczSmX\u0026q=85\u0026s=26604859a9467157d3c0388a3466a02d","appearance":{"default":"dark","strict":true},"background":{"color":{"light":"#fdfcfa","dark":"#0a0a0f"}},"navbar":{"links":[{"href":"https://gascityhall.com","label":"Gas City Hall"},{"icon":"discord","href":"https://discord.gg/xHpUGUzZp2","label":"Discord"},{"icon":"x-twitter","href":"https://x.com/gastownhall","label":"X"},{"icon":"github","href":"https://github.com/gastownhall/gascity","label":"GitHub"}]},"fonts":{"heading":{"family":"Cinzel","weight":700},"body":{"family":"Raleway","weight":400}},"styling":{"codeblocks":"dark","latex":true},"metadata":{"timestamp":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"gascityinc-5c0069dd","hasAudioNarration":false,"actualSubdomain":"gascityinc-5c0069dd","customDomains":["docs.gascity.com"],"gitSource":{"type":"github","owner":"gastownhall","repo":"gascity","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae5300e0c81df08591d8687","collectionId":"16250022-268f-4dc0-b651-00bab6c84509","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae5300e0c81df08591d8687"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae5300e0c81df08591d8687","clientVersion":"0.0.4043","searchFilterCounts":[{"language":"default","tag":"Reference","count":34},{"language":"default","tag":"Guides","count":12},{"language":"default","tag":"Getting Started","count":9},{"language":"default","tag":"Troubleshooting","count":9},{"language":"default","tag":"How-to","count":8},{"language":"default","tag":"Tutorials","count":8},{"language":"default","tag":"Specifications","count":6},{"language":"default","tag":"Operate","count":5},{"language":"default","tag":"Understand","count":3},{"language":"default","tag":"Diagnose","count":3}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"custom.css","content":"/* cyrillic-ext */\n@font-face {\n font-family: 'Raleway';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/raleway/v37/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVs9pbCFPrEHJA.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Raleway';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/raleway/v37/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVs9pbCMPrEHJA.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Raleway';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/raleway/v37/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVs9pbCHPrEHJA.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Raleway';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/raleway/v37/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVs9pbCGPrEHJA.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Raleway';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/raleway/v37/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVs9pbCIPrE.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\nhtml{font-size:1.2rem}body{color:#f0ece4;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body::before{content:\"\";position:fixed;top:0;left:0;width:100%;height:100%;background:url(/images/bg.webp) center center/cover no-repeat;opacity:.18;z-index:-1;pointer-events:none}h1{font-size:2.4rem;letter-spacing:.08em}h2{font-size:1.8rem;letter-spacing:.06em}h3{font-size:1.4rem;letter-spacing:.04em}li,p{line-height:1.6}a{color:#c9a84c;transition:color .2s ease}a:hover{color:#e8c84a}#sidebar{border-right:1px solid rgba(201,168,76,.15)}#navbar{border-bottom:1px solid rgba(201,168,76,.15);backdrop-filter:blur(12px)}#footer{border-top:1px solid rgba(201,168,76,.12)}.code-block{border:1px solid rgba(201,168,76,.1)}a[href=\"https://gascityhall.com\"]{font-weight:700!important}.navbar-link:has(svg){font-size:0!important;gap:0!important}.navbar-link:has(svg) svg{font-size:1rem;width:1.2em;height:1.2em}"}],"page":{"pagePath":"guides/using-json-from-gc","slug":"/guides/using-json-from-gc","pageMetadata":{"title":"Use JSON from the gc CLI","description":"Use `gc --json` and `gc --json-schema` from scripts, agents, tests, and other software.","href":"/guides/using-json-from-gc"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_components.p, {\n children: [\"Use \", _jsx(_components.code, {\n children: \"gc --json\"\n }), \" and \", _jsx(_components.code, {\n children: \"gc --json-schema\"\n }), \" from scripts, agents, tests, and other software.\"]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,OptimizedImage}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Gas City’s CLI is human-readable by default. When software calls `,_jsx(_components.code,{children:`gc`}),` — agents,\nshell scripts, dashboard tools, smoke tests, CI — pass `,_jsx(_components.code,{children:`--json`}),` on commands that\nsupport it, so callers read JSON fields instead of parsing tables, status text,\nor progress messages. Human-readable output stays the default for interactive\nuse.`]}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/gascityinc-5c0069dd/0futwZDQKCMfbNeI/diagrams/excalidraw-rendered/json-discover-validate.svg?fit=max\u0026auto=format\u0026n=0futwZDQKCMfbNeI\u0026q=85\u0026s=4e621dea8d4903062c884a50921744e6`,alt:`Driving gc from software: a gc command with --json prints a JSON result on stdout, and with --json-schema=result prints the command's JSON Schema; a caller validates the result against the schema at the command boundary.`,\"data-og-width\":`887`,width:`887`,\"data-og-height\":`384`,height:`384`,\"data-path\":`diagrams/excalidraw-rendered/json-discover-validate.svg`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/gascityinc-5c0069dd/0futwZDQKCMfbNeI/diagrams/excalidraw-rendered/json-discover-validate.svg?w=280\u0026fit=max\u0026auto=format\u0026n=0futwZDQKCMfbNeI\u0026q=85\u0026s=efa321475e0a6a8b1dd93de9a1620b11 280w, https://mintcdn.com/gascityinc-5c0069dd/0futwZDQKCMfbNeI/diagrams/excalidraw-rendered/json-discover-validate.svg?w=560\u0026fit=max\u0026auto=format\u0026n=0futwZDQKCMfbNeI\u0026q=85\u0026s=c526e0e69ed07def0e376a8c4c5c639b 560w, https://mintcdn.com/gascityinc-5c0069dd/0futwZDQKCMfbNeI/diagrams/excalidraw-rendered/json-discover-validate.svg?w=840\u0026fit=max\u0026auto=format\u0026n=0futwZDQKCMfbNeI\u0026q=85\u0026s=1e10de11d17644e2564595239ec165fc 840w, https://mintcdn.com/gascityinc-5c0069dd/0futwZDQKCMfbNeI/diagrams/excalidraw-rendered/json-discover-validate.svg?w=1100\u0026fit=max\u0026auto=format\u0026n=0futwZDQKCMfbNeI\u0026q=85\u0026s=a74fe0ae59fab209bd3f9da5c1ff3271 1100w, https://mintcdn.com/gascityinc-5c0069dd/0futwZDQKCMfbNeI/diagrams/excalidraw-rendered/json-discover-validate.svg?w=1650\u0026fit=max\u0026auto=format\u0026n=0futwZDQKCMfbNeI\u0026q=85\u0026s=b095b43e3ca367c28d121c97c8c970d8 1650w, https://mintcdn.com/gascityinc-5c0069dd/0futwZDQKCMfbNeI/diagrams/excalidraw-rendered/json-discover-validate.svg?w=2500\u0026fit=max\u0026auto=format\u0026n=0futwZDQKCMfbNeI\u0026q=85\u0026s=c3715e6503a9d4e21d856b18c151023c 2500w`}),`\n`,_jsx(Heading,{level:`2`,id:`quick-start`,children:`Quick Start`}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`--json`}),` on supported commands:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`gc`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` status`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --json`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`gc`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` session`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` list`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --json`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`gc`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` rig`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` list`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --json`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`gc`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` mail`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` inbox`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --json`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Most bounded commands emit one JSON value followed by a newline. Ordinary JSON\nparsers can read the whole stdout body:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`gc`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` status`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --json`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` | `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`jq`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` .`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Shell scripts should use the process exit code for control flow, then parse\nstdout only after a successful exit:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` out`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"$(`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`gc`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` status `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`--json`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`)\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`then`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` jq`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` -r`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '.city_name'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c\u003c\u003c`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`$out`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`else`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` code`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`$?`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` printf`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'gc status failed with exit code %s\\\\n'`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`$code`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` >\u00262`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` exit`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`$code`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`fi`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`stdout-and-stderr`,children:`Stdout And Stderr`}),`\n`,_jsxs(_components.p,{children:[`When `,_jsx(_components.code,{children:`--json`}),` is passed, stdout is reserved for machine-readable output.`]}),`\n`,_jsx(_components.p,{children:`Supported JSON commands should not write human progress lines, tables, banners,\ndebug text, or summaries to stdout. Important command results belong in JSON\nfields, not copied prose.`}),`\n`,_jsx(_components.p,{children:`Stderr remains available for operational diagnostics. A caller should not need\nstderr to understand the successful result shape, but stderr may still contain\nhuman-readable details that help debug failures.`}),`\n`,_jsx(Heading,{level:`2`,id:`common-result-shape`,children:`Common Result Shape`}),`\n`,_jsx(_components.p,{children:`Newer JSON commands use a common success envelope:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"schema_version\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"1\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"ok\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Command-specific fields sit alongside that envelope. For example, a city status\nresult includes fields such as `,_jsx(_components.code,{children:`city_name`}),`, `,_jsx(_components.code,{children:`city_path`}),`, `,_jsx(_components.code,{children:`controller`}),`,\n`,_jsx(_components.code,{children:`agents`}),`, `,_jsx(_components.code,{children:`rigs`}),`, and `,_jsx(_components.code,{children:`summary`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Action commands usually include a `,_jsx(_components.code,{children:`command`}),` field and an `,_jsx(_components.code,{children:`action`}),` field:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"schema_version\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"1\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"ok\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"command\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"session pin\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"action\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"pin\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"session_id\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"gc-1\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Use each command’s JSON Schema as the authoritative shape. Do not assume every\ncommand has exactly the same fields beyond the shared success indicators.`}),`\n`,_jsx(Heading,{level:`2`,id:`failure-handling`,children:`Failure Handling`}),`\n`,_jsxs(_components.p,{children:[`Use the process exit code as the first success/failure signal (as in\n`,_jsx(_components.a,{href:`#quick-start`,children:`Quick Start`}),`): parse stdout only after a successful exit, and\ncapture stderr separately for diagnostics. Many failures write to stderr without\na command-specific JSON failure record, so don’t assume every `,_jsx(_components.code,{children:`--json`}),` command\nemits a structured failure payload.`]}),`\n`,_jsxs(_components.p,{children:[`JSON Schema requests are different: if a requested schema is unavailable, `,_jsx(_components.code,{children:`gc`}),`\nreturns a structured failure payload on stdout and exits nonzero:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`gc`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` dashboard`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --json-schema=result`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"schema_version\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"1\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"ok\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"json_schema_unavailable\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"command `}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`dashboard`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` does not declare JSON support\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"exit_code\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`1`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`jsonl-framing`,children:`JSONL Framing`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`gc`}),` writes complete JSON records followed by newlines. For most bounded\ncommands, stdout has exactly one record.`]}),`\n`,_jsxs(_components.p,{children:[`Some streaming commands can emit multiple records. Their result schema may use\nthe `,_jsx(_components.code,{children:`x-gc-jsonl`}),` extension to describe record counts:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"$schema\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"https://json-schema.org/draft/2020-12/schema\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"x-gc-jsonl\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: {},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"object\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`When `,_jsx(_components.code,{children:`x-gc-jsonl`}),` is absent, treat the command as a single-record command.\nWhen it is present:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`minRecords`}),` is the minimum number of records. If omitted, the minimum is `,_jsx(_components.code,{children:`0`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`maxRecords`}),` is the maximum number of records. If omitted, there is no maximum.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`{}`}),` means zero or more records.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`{ \"minRecords\": 1 }`}),` means one or more records.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`{ \"minRecords\": 0, \"maxRecords\": 1 }`}),` means zero or one record.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`{ \"minRecords\": 1, \"maxRecords\": 1 }`}),` means exactly one record, explicitly.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`For bounded commands, parse stdout as a whole JSON value. For streaming commands,\nparse one JSON value per line.`}),`\n`,_jsx(Heading,{level:`2`,id:`discover-schemas`,children:`Discover Schemas`}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`--json-schema`}),` to discover a command’s JSON contract without running the\ncommand’s normal behavior:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`gc`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` status`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --json-schema`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`That prints a manifest record:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`16`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"schema_version\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"1\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"command\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"json_supported\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"schemas\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"result\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"$schema\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"https://json-schema.org/draft/2020-12/schema\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"title\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"gc status --json result\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"object\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"failure\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"$schema\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"https://json-schema.org/draft/2020-12/schema\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"object\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Use role-specific schema requests when a caller only needs one schema:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`gc`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` status`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --json-schema=result`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`gc`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` status`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --json-schema=failure`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The role may be passed with `,_jsx(_components.code,{children:`=`}),` or as the next argument:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`gc`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` status`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --json-schema`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` result`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`If a known command does not declare JSON support, the manifest still succeeds\nand reports `,_jsx(_components.code,{children:`json_supported: false`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`gc`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` dashboard`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --json-schema`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"schema_version\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"1\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"command\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"dashboard\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"json_supported\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` \"schemas\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: {}`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Role-specific requests for unavailable schemas fail with the structured failure\nshape shown above.`}),`\n`,_jsx(Heading,{level:`2`,id:`validate-output`,children:`Validate Output`}),`\n`,_jsxs(_components.p,{children:[`Tools can combine `,_jsx(_components.code,{children:`--json`}),` and `,_jsx(_components.code,{children:`--json-schema=result`}),` to validate command\noutput. Start by fetching the schema and command result:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`schema`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"$(`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`gc`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` status `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`--json-schema=result`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`)\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"$(`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`gc`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` status `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`--json`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`)\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`printf`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '%s\\\\n'`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`$result`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` | `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`jq`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` .`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`jq`}),` command only confirms that stdout is parseable JSON. Use a JSON Schema\nvalidator when you need contract enforcement. Keep validation at command\nboundaries rather than writing ad hoc field checks throughout an agent or\nscript.`]}),`\n`,_jsx(_components.p,{children:`For streaming commands, validate each JSONL record against the result schema:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`gc`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` events`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --json-schema=result`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` > `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`/tmp/gc-events.schema.json`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`gc`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` events`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --json`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --follow`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` | `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`while`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` IFS`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`= `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`read`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` -r`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` line`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`do`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` printf`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '%s\\\\n'`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`$line`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` | `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`jq`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` .`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`done`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The example above only parses records with `,_jsx(_components.code,{children:`jq`}),`; use a schema validator when\nyou need full schema checking.`]}),`\n`,_jsx(Heading,{level:`2`,id:`supported-surface`,children:`Supported Surface`}),`\n`,_jsx(_components.p,{children:`The JSON rollup added or standardized coverage across the main automation\nsurface, including:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`city lifecycle and status commands.`}),`\n`,_jsx(_components.li,{children:`agent and rig inspection/routing commands.`}),`\n`,_jsx(_components.li,{children:`session list, action, log, and mutation commands.`}),`\n`,_jsx(_components.li,{children:`mail and trace inspection commands.`}),`\n`,_jsx(_components.li,{children:`convoy, converge, formula, order, graph, service, and skill commands.`}),`\n`,_jsx(_components.li,{children:`runtime drain/nudge commands.`}),`\n`,_jsx(_components.li,{children:`schema discovery for supported commands.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Use the generated `,_jsx(_components.a,{href:`/reference/cli`,children:`CLI Reference`}),` for exact flags on each\ncommand. Use `,_jsx(_components.code,{children:`gc \u003ccommand> --json-schema`}),` to confirm whether a command declares\nJSON support.`]}),`\n`,_jsx(Heading,{level:`2`,id:`passthrough-commands`,children:`Passthrough Commands`}),`\n`,_jsxs(_components.p,{children:[`Some commands pass arguments through to another CLI. For example, `,_jsx(_components.code,{children:`gc bd ...`}),`\nroutes to the bead CLI in the correct city or rig context.`]}),`\n`,_jsxs(_components.p,{children:[`Passthrough commands are not native `,_jsx(_components.code,{children:`gc`}),` JSON contracts. If the downstream tool\nsupports JSON, it owns that output shape. Gas City should not represent\npassthrough output with a fake “anything is valid” schema.`]}),`\n`,_jsxs(_components.p,{children:[`For compatibility, local pack-defined commands can still pass their own `,_jsx(_components.code,{children:`--json`}),`\nhandling through when they do not declare schemas. Set\n`,_jsx(_components.code,{children:`GC_JSON_CONTRACT_STRICT=1`}),` in tests or CI when you want missing local command\nschemas to fail instead of passing through.`]}),`\n`,_jsx(Heading,{level:`2`,id:`pack-defined-commands`,children:`Pack-Defined Commands`}),`\n`,_jsx(_components.p,{children:`Pack-defined commands can be scripts or external programs, so Gas City does not\nautomatically make arbitrary pack command output JSON-safe.`}),`\n`,_jsx(_components.p,{children:`Pack command schemas live next to the command implementation:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`commands/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` review/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` pr/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` run.sh`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` schemas/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` result.schema.json`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Nested command directories imply nested command paths. In the example above,\nthe result schema belongs to the pack command leaf represented by\n`,_jsx(_components.code,{children:`commands/review/pr/`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`schemas/failure.schema.json`}),` is optional. Use it only when the command has\nmeaningful command-specific failure fields beyond the shared default failure\nshape.`]}),`\n`,_jsx(Heading,{level:`2`,id:`compatibility-notes`,children:`Compatibility Notes`}),`\n`,_jsx(_components.p,{children:`JSON output is an automation contract. A PR that changes an existing JSON output\nshape should call that out explicitly, including:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`the command and invocation.`}),`\n`,_jsx(_components.li,{children:`the old shape.`}),`\n`,_jsx(_components.li,{children:`the new shape.`}),`\n`,_jsx(_components.li,{children:`whether the change is additive or intentionally incompatible.`}),`\n`,_jsx(_components.li,{children:`the rationale for making the change in that PR.`}),`\n`]}),`\n`,_jsx(_components.p,{children:`Human-readable output remains the default and should stay compatible unless a\ncommand’s normal human behavior is intentionally changed.`}),`\n`,_jsx(Heading,{level:`2`,id:`related-reference`,children:`Related Reference`}),`\n`,_jsxs(_components.p,{children:[`Use the generated `,_jsx(_components.a,{href:`/reference/cli`,children:`CLI Reference`}),` for exact command flags.\nUse `,_jsx(_components.a,{href:`/reference/events`,children:`Events`}),` for the `,_jsx(_components.code,{children:`gc events`}),` JSONL event contract.\nUse `,_jsx(_components.a,{href:`/reference/schema`,children:`Schemas`}),` for published non-CLI schema artifacts such as OpenAPI,\nevents, and city config.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"Use JSON from the gc CLI","description":"Use `gc --json` and `gc --json-schema` from scripts, agents, tests, and other software.","href":"/guides/using-json-from-gc"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Quick Start","slug":"quick-start","depth":2,"children":[]},{"title":"Stdout And Stderr","slug":"stdout-and-stderr","depth":2,"children":[]},{"title":"Common Result Shape","slug":"common-result-shape","depth":2,"children":[]},{"title":"Failure Handling","slug":"failure-handling","depth":2,"children":[]},{"title":"JSONL Framing","slug":"jsonl-framing","depth":2,"children":[]},{"title":"Discover Schemas","slug":"discover-schemas","depth":2,"children":[]},{"title":"Validate Output","slug":"validate-output","depth":2,"children":[]},{"title":"Supported Surface","slug":"supported-surface","depth":2,"children":[]},{"title":"Passthrough Commands","slug":"passthrough-commands","depth":2,"children":[]},{"title":"Pack-Defined Commands","slug":"pack-defined-commands","depth":2,"children":[]},{"title":"Compatibility Notes","slug":"compatibility-notes","depth":2,"children":[]},{"title":"Related Reference","slug":"related-reference","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"gascityinc-5c0069dd","siteName":"Gas City Docs","title":"Use JSON from the gc CLI - Gas City Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-06-16T16:55:24.222Z","gitLastModified":"2026-06-16T16:54:56.000Z","originalFileLocation":"guides/using-json-from-gc.md"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"dark\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Use gc --json and gc --json-schema from scripts, agents, tests, and other software.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Gas City Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/gascityinc-5c0069dd/CFOu2PAl8rh2R3IH/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/gascityinc-5c0069dd/CFOu2PAl8rh2R3IH/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/gascityinc-5c0069dd/CFOu2PAl8rh2R3IH/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/gascityinc-5c0069dd/CFOu2PAl8rh2R3IH/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/gascityinc-5c0069dd/CFOu2PAl8rh2R3IH/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/gascityinc-5c0069dd/CFOu2PAl8rh2R3IH/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/gascityinc-5c0069dd/CFOu2PAl8rh2R3IH/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/gascityinc-5c0069dd/CFOu2PAl8rh2R3IH/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/gascityinc-5c0069dd/CFOu2PAl8rh2R3IH/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Use JSON from the gc CLI - Gas City Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Use gc --json and gc --json-schema from scripts, agents, tests, and other software.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Gas City Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.gascity.com/guides/using-json-from-gc\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://gascityinc-5c0069dd.mintlify.app/_mintlify/api/og/v2?division=How-to\u0026amp;title=Use+JSON+from+the+gc+CLI\u0026amp;description=Use+%60gc+--json%60+and+%60gc+--json-schema%60+from+scripts%2C+agents%2C+tests%2C+and+other+software.\u0026amp;theme=0f4f17a33d6540af3e25f7d1\u0026amp;signature=e69f1ad78c3f6d572d7be129d9d338539e5839d0365a9248202530279b4ccf5b\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Use JSON from the gc CLI - Gas City Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Use gc --json and gc --json-schema from scripts, agents, tests, and other software.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://gascityinc-5c0069dd.mintlify.app/_mintlify/api/og/v2?division=How-to\u0026amp;title=Use+JSON+from+the+gc+CLI\u0026amp;description=Use+%60gc+--json%60+and+%60gc+--json-schema%60+from+scripts%2C+agents%2C+tests%2C+and+other+software.\u0026amp;theme=0f4f17a33d6540af3e25f7d1\u0026amp;signature=e69f1ad78c3f6d572d7be129d9d338539e5839d0365a9248202530279b4ccf5b\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/gascityinc-5c0069dd/CFOu2PAl8rh2R3IH/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Gas City Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#c9a84c\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.gascity.com/guides/using-json-from-gc\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/using-json-from-gc.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.gascity.com/#organization\",\"name\":\"Gas City Docs\",\"url\":\"https://docs.gascity.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/gascityinc-5c0069dd/nVs1BR-I28rczSmX/images/logo-wordmark.svg?fit=max\u0026auto=format\u0026n=nVs1BR-I28rczSmX\u0026q=85\u0026s=6987cf243022d0fef33d045e88fc6b53\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.gascity.com#website\",\"name\":\"Gas City Docs\",\"url\":\"https://docs.gascity.com\",\"publisher\":{\"@id\":\"https://docs.gascity.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.gascity.com/guides/using-json-from-gc#webpage\",\"url\":\"https://docs.gascity.com/guides/using-json-from-gc\",\"name\":\"Use JSON from the gc CLI\",\"description\":\"Use gc --json and gc --json-schema from scripts, agents, tests, and other software.\",\"dateModified\":\"2026-06-16T16:54:56.000Z\",\"isPartOf\":{\"@id\":\"https://docs.gascity.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.gascity.com/guides/using-json-from-gc#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.gascity.com/guides/using-json-from-gc#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Guides\",\"item\":\"https://docs.gascity.com/guides/index\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How-to\",\"item\":\"https://docs.gascity.com/guides/configuring-an-agent\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Use JSON from the gc CLI\",\"item\":\"https://docs.gascity.com/guides/using-json-from-gc\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.gascity.com/guides/using-json-from-gc#article\",\"headline\":\"Use JSON from the gc CLI\",\"name\":\"Use JSON from the gc CLI\",\"description\":\"Use gc --json and gc --json-schema from scripts, agents, tests, and other software.\",\"url\":\"https://docs.gascity.com/guides/using-json-from-gc\",\"mainEntityOfPage\":{\"@id\":\"https://docs.gascity.com/guides/using-json-from-gc#webpage\"},\"dateModified\":\"2026-06-16T16:54:56.000Z\",\"publisher\":{\"@id\":\"https://docs.gascity.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.gascity.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Gas City Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Gas City Docs","nav":{"global":null,"groups":[{"group":"Getting Started","pages":[{"title":"Overview","href":"/index"},{"title":"Installation","href":"/getting-started/installation"},{"title":"Upgrading an Existing City","href":"/getting-started/upgrading"},{"title":"Quickstart","href":"/getting-started/quickstart"},{"title":"Web dashboard","href":"/getting-started/dashboard"},{"title":"How Gas City Works","href":"/getting-started/how-gas-city-works"},{"title":"Coming from Gas Town","href":"/getting-started/coming-from-gastown"},{"title":"FAQ","href":"/getting-started/faq"},{"title":"Troubleshooting","href":"/getting-started/troubleshooting"}]},{"group":"Tutorials","pages":[{"title":"Overview","href":"/tutorials/index"},{"title":"Tutorial 01 - Cities and Rigs","sidebarTitle":"01 - Cities and Rigs","href":"/tutorials/01-cities-and-rigs"},{"title":"Tutorial 02 - Agents","sidebarTitle":"02 - Agents","href":"/tutorials/02-agents"},{"title":"Tutorial 03 - Sessions","sidebarTitle":"03 - Sessions","href":"/tutorials/03-sessions"},{"title":"Tutorial 04 - Agent-to-Agent Communication","sidebarTitle":"04 - Communication","href":"/tutorials/04-communication"},{"title":"Tutorial 05 - Formulas","sidebarTitle":"05 - Formulas","href":"/tutorials/05-formulas"},{"title":"Tutorial 06 - Beads","sidebarTitle":"06 - Beads","href":"/tutorials/06-beads"},{"title":"Tutorial 07 - Orders","sidebarTitle":"07 - Orders","href":"/tutorials/07-orders"}]},{"group":"Guides","pages":[{"title":"Overview","href":"/guides/index"},{"group":"Understand","pages":[{"title":"Coming from Coding Agents","href":"/guides/capabilities-for-coding-agent-users"},{"title":"Understanding Packs","href":"/guides/understanding-packs"},{"title":"Understanding Formulas","href":"/guides/understanding-formulas"}]},{"group":"How-to","pages":[{"title":"Configuring an Agent","href":"/guides/configuring-an-agent"},{"title":"Harness Recipes","href":"/guides/harness-recipes"},{"title":"Create and Share Packs","href":"/guides/shareable-packs"},{"title":"Find and Import Public Packs","href":"/guides/registry-showcase"},{"title":"Configure the Gastown Pack","description":"Task-oriented config overrides for running the Gastown pack on Gas City — register rigs, scale pools, swap providers, patch agents, and tweak prompts.","href":"/guides/gastown-config-recipes"},{"title":"Use JSON from the gc CLI","href":"/guides/using-json-from-gc"},{"title":"Connect an external client","description":"Bring a chat, voice, or bot front end into a city conversation — send turns to an agent over HTTP and receive its replies on a callback.","href":"/guides/connected-clients"},{"title":"Set Up a Multi-Agent Engineering Environment","href":"/guides/multi-agent-engineering-environment"}]}]},{"group":"Troubleshooting","pages":[{"title":"Overview","href":"/troubleshooting/index"},{"group":"Diagnose","pages":[{"title":"Diagnose a Failed gc start","href":"/troubleshooting/gc-start-walkthrough"},{"title":"Recover from Dolt Bloat","href":"/troubleshooting/dolt-bloat-recovery"},{"title":"Clean Up bd Auto-Backups","href":"/troubleshooting/bd-backup-cleanup"}]},{"group":"Operate","pages":[{"title":"Operate Managed-City Dolt Endpoints","href":"/runbooks/managed-city-endpoints"},{"title":"Operate a Direct Hardened City from the gc CLI","href":"/runbooks/remote-hardened-city"},{"title":"Move a City's Infrastructure Classes onto Their Own Store","href":"/runbooks/split-storage-classes"},{"title":"Dolt Storage Maintenance","href":"/runbooks/dolt-compact"},{"title":"Ship the Event Log","href":"/runbooks/events-mirror"}]}]},{"group":"Reference","pages":[{"group":"Reference","pages":[{"title":"Overview","href":"/reference/index"},{"title":"CLI Reference","href":"/reference/cli"},{"title":"Gas Town → Gas City Command Map","href":"/reference/gastown-command-map"},{"title":"Gas City Configuration","href":"/reference/config"},{"title":"Command Execution Trust Boundaries","href":"/reference/trust-boundaries"},{"title":"Supervisor REST API","href":"/reference/api"},{"title":"gc events Output Formats","href":"/reference/events"},{"title":"Schemas","href":"/reference/schema/index"},{"title":"Builtin Packs","href":"/reference/system-packs"},{"title":"Exec Session Provider","href":"/reference/exec-session-provider"},{"title":"Exec Beads Provider","href":"/reference/exec-beads-provider"},{"title":"Tmux Agent Slice (GC_AGENT_SLICE)","href":"/reference/tmux-agent-slice"},{"title":"herdr Session Provider","href":"/reference/herdr-provider"}]},{"group":"Specifications","pages":[{"title":"Overview","href":"/reference/specs/index"},{"title":"Gas City Pack Specification","href":"/reference/specs/pack-spec"},{"title":"Gas City Formula Specification — v1","href":"/reference/specs/formula-spec-v1"},{"title":"Gas City Formula Specification — v2","href":"/reference/specs/formula-spec-v2"},{"title":"Gas City Service Protocol — v0","href":"/reference/specs/service-protocol-v0"},{"title":"Gas City Identity Separator Contract — v1","href":"/reference/specs/identity-separator-contract-v1"}]},{"group":"Internal","pages":[{"title":"Overview","href":"/reference/internal/index"},{"title":"Beads Storage Topology","href":"/reference/internal/beads-topology"}]}]}]},"basePath":"","title":"Use JSON from the gc CLI - Gas City Docs","buildId":"dpl_G9nrg4qeJSZtah1Ziwbc2n6WkLch","deploymentId":"dpl_G9nrg4qeJSZtah1Ziwbc2n6WkLch","dynamics":["a74be98ba7"],"chunks":["zoom-image-lightbox-DL4wrF0w.js","lightbox-handle-r17bVUz3.js"]}