Grok Build CLI
M06 · 10 min

TUI, plan, headless, parallel

Match mode to job size. Automate the boring with -p.

Modes

  • TUI — fullscreen interactive agent session for real coding.
  • Plan mode — for complex tasks: approve/comment/rewrite steps before edits.
  • Headless — grok -p "…" for scripts; --output-format streaming-json for machines.
  • Subagents — parallel specialized workers; optional worktree isolation for bigger jobs.

Headless examples

grok -p "Explain this codebase"
grok -p "List flaky tests and likely causes" --output-format streaming-json
grok -p "Hello" -m my-model   # if custom models configured

Config lives in ~/.grok/config.toml (custom models, defaults). Use grok inspect to see what config, instructions, skills, plugins, hooks, and MCP servers apply in the current directory.

Exercise

Mode matching

For each job — (a) refactor auth, (b) nightly summary of TODOs, (c) learn a new repo — pick TUI / plan / headless and say why.

  • Three jobs mapped
  • At least one headless job
  • At least one plan-mode job
Next