Grok WorldGrok Build CLI field station

GROK BUILD CLI / 13

Use single-turn prompts and bounded output

Single-turn mode is useful automation only when the working directory, authority, output contract, and failure path are all explicit.

CHANNELBOUNDED AUTOMATION / INTERMEDIATE / 11 MIN
SOURCES CHECKED2026-10-21
ORIGINOFFICIAL DOCS / PRIMARY

Choose the one-shot surface

The released CLI uses -p or --single to run a prompt, print the result, and exit. Supply the prompt as text, from --prompt-file, or as JSON content blocks with --prompt-json; choose one input contract per job.

Use --max-turns to bound agent work and --output-format when a machine, rather than a person, consumes the result. Grok Build 1.0.67 help lists plain (the default), json, streaming-json, and streaming-messages-json; --json-schema constrains the response to a JSON Schema and implies json output.

grok -p "Summarize the staged changes" --output-format json --max-turns 4

Preserve the execution boundary

Run in the intended repository and state whether changes are allowed. Select approval, sandbox, tool, and subagent settings before the job starts; non-interactive operation does not make broad authority safe.

Keep provider and deployment credentials outside repository-controlled code. A pull request job should not inherit a token merely because the prompt says to avoid it.

  • Pin or record the Grok Build release.
  • Set a timeout outside the model turn cap.
  • Treat non-zero exit, malformed output, and missing evidence as failure.

Validate the result, not the tone

Parse the selected format according to its actual contract. json is one result; streaming-json (one ACP session update per line) and streaming-messages-json (NDJSON in a Messages API wire format) are line-delimited streams that must be processed incrementally, and --include-partial-messages affects only the latter.

Before merging or publishing, inspect the diff and run the repository’s real tests. A well-formed response can still describe a failed or incomplete change.