|
| 1 | +# TAGLINE |
| 2 | + |
| 3 | +xAI's official terminal-native agentic coding CLI |
| 4 | + |
| 5 | +# TLDR |
| 6 | + |
| 7 | +**Start an interactive session** in the current directory |
| 8 | + |
| 9 | +```grok``` |
| 10 | + |
| 11 | +**Run a one-off command** and exit (headless mode) |
| 12 | + |
| 13 | +```grok -p "[prompt]"``` |
| 14 | + |
| 15 | +**Stream structured output** for scripting |
| 16 | + |
| 17 | +```grok -p "[prompt]" --output-format streaming-json``` |
| 18 | + |
| 19 | +**Inspect what Grok discovers** in the current directory |
| 20 | + |
| 21 | +```grok inspect``` |
| 22 | + |
| 23 | +**Select a specific model** in headless mode |
| 24 | + |
| 25 | +```grok -m [model-id]``` |
| 26 | + |
| 27 | +**Provide xAI credentials** via environment variable |
| 28 | + |
| 29 | +```export GROK_CODE_XAI_API_KEY="xai-..."``` |
| 30 | + |
| 31 | +# SYNOPSIS |
| 32 | + |
| 33 | +**grok** [_options_] [_prompt_] |
| 34 | + |
| 35 | +**grok** **inspect** |
| 36 | + |
| 37 | +# PARAMETERS |
| 38 | + |
| 39 | +**-p**, **--prompt** _text_ |
| 40 | +> Run in headless mode: execute a single prompt and exit. Useful inside scripts, CI/CD pipelines, GitHub Actions, or cron jobs. |
| 41 | +
|
| 42 | +**-m**, **--model** _model_ |
| 43 | +> Select the model used for the session. |
| 44 | +
|
| 45 | +**--output-format** _format_ |
| 46 | +> Set the response format (e.g. _streaming-json_) for machine-readable output in headless mode. |
| 47 | +
|
| 48 | +# DESCRIPTION |
| 49 | + |
| 50 | +**Grok Build** is xAI's first-party command-line coding agent, built for professional software engineering, app development, and workflow automation. It runs as a terminal TUI by default and can also operate headlessly for automation. |
| 51 | + |
| 52 | +It ships with **plan mode**, where the agent proposes a full plan that can be approved, commented on, or rewritten before any execution begins. Once approved, every change appears as a clean diff. For larger tasks, Grok Build delegates work to **parallel subagents**, optionally launched in their own git worktrees. |
| 53 | + |
| 54 | +Grok Build is **ACP-first** and deliberately compatible with the Anthropic Skills format, so skills written for Claude Code work with little or no modification. It supports **MCP** out of the box, so existing servers (database connectors, GitHub integrations, custom tools) work without changes. |
| 55 | + |
| 56 | +# CONFIGURATION |
| 57 | + |
| 58 | +**AGENTS.md** |
| 59 | +> Project-level instructions for the agent, loaded automatically from the working directory. Compatible with Claude Code's CLAUDE.md. |
| 60 | +
|
| 61 | +**GROK_CODE_XAI_API_KEY** |
| 62 | +> Environment variable holding the xAI API key. Used when not authenticated via the browser flow. |
| 63 | +
|
| 64 | +**Custom model config** |
| 65 | +> Models can be defined in the user config with a model id, base URL, display name, and env-key reference, then selected as the default or via _/model_ in the TUI. |
| 66 | +
|
| 67 | +# SLASH COMMANDS |
| 68 | + |
| 69 | +**/model** _name_ |
| 70 | +> Switch the active model from within the TUI. |
| 71 | +
|
| 72 | +# CAVEATS |
| 73 | + |
| 74 | +Grok Build is in **early beta** and is available to **SuperGrok Heavy** subscribers. Expect rough edges: commands that don't yet work, incomplete error handling, and occasional regressions in subagent coordination. For production CI/CD pipelines, prefer mature tools until Grok Build hits general availability; for exploration and side projects, beta is fine. First launch opens a browser for authentication unless an API key is set via environment variable. |
| 75 | + |
| 76 | +# HISTORY |
| 77 | + |
| 78 | +xAI launched **Grok Build** as an early beta in **May 2026**, entering the agentic-CLI space alongside Claude Code and Codex CLI. It is installed with a single curl-pipe-bash script from _x.ai/cli/install.sh_, ships with plan mode, parallel subagents with worktree integration, MCP support, and Anthropic-Skills compatibility, and is positioned as xAI's terminal-native counterpart to its web-based Grok coding tools. |
| 79 | + |
| 80 | +# SEE ALSO |
| 81 | + |
| 82 | +[grok](/man/grok)(1), [claude](/man/claude)(1), [copilot](/man/copilot)(1), [gh](/man/gh)(1) |
0 commit comments