Grok Build (the grok CLI/TUI) is xAI's terminal-based AI coding agent. It runs as a full-screen, mouse-interactive TUI that understands your codebase, edits files, executes shell commands, searches the web, and manages long-running tasks. It can be used interactively, headlessly for scripting/CI, or embedded in editors via the Agent Client Protocol (ACP).
The project is open source (Apache-2.0), written in Rust, and periodically synced from the SpaceXAI monorepo. A SOURCE_REV file at the repository root records the exact monorepo commit the tree was built from.
Grok Build is built for developers who want to stay in the terminal:
- Launch a full-screen TUI directly in a project directory
- Ask natural-language questions about a repository
- Let the agent plan, edit files, run tools, and iterate in the same session
- Interactive TUI — scrollback, prompt, modals, mouse interaction
- Headless mode — non-interactive runs for scripting and CI
- ACP integration — embed the agent in ACP-compatible editors
Grok Build ships the capabilities commonly needed for agentic development:
- MCP servers
- Skills and plugins
- Lifecycle hooks
- Sandboxing and workspace checkpoints
- Theming and configuration
- Analyze project structure and dependencies
- Read, search, and modify files
- Implement features, fix bugs, and refactor code
- Run build, test, lint, and project scripts
- Chain multiple steps while observing tool feedback
- Manage long-running tasks
- Search the web from within a session
- Configure MCP servers, skills, plugins, and hooks
Prebuilt binaries are published for macOS, Linux, and Windows:
curl -fsSL https://x.ai/cli/install.sh | bash # macOS / Linux / Git Bash
irm https://x.ai/cli/install.ps1 | iex # Windows PowerShell
grok --versionOn first launch it opens your browser to authenticate.
Requirements:
- Rust — the toolchain is pinned by
rust-toolchain.toml;rustupinstalls it automatically on first build. - DotSlash — required so hermetic tools under
bin/(notablybin/protoc) can download and run. - protoc — proto codegen resolves
bin/protocvia DotSlash, or falls back to aprotoconPATH/$PROTOC. - macOS and Linux are supported build hosts; Windows builds are best-effort.
cargo run -p xai-grok-pager-bin # build + launch the TUI
cargo build -p xai-grok-pager-bin --release # release binary: target/release/xai-grok-pager
cargo check -p xai-grok-pager-bin # fast validationThe binary artifact is named xai-grok-pager; official installs ship it as grok.
| Path | Contents |
|---|---|
crates/codegen/xai-grok-pager-bin |
Composition-root package; builds the xai-grok-pager binary |
crates/codegen/xai-grok-pager |
The TUI: scrollback, prompt, modals, rendering |
crates/codegen/xai-grok-shell |
Agent runtime + leader/stdio/headless entry points |
crates/codegen/xai-grok-tools |
Tool implementations (terminal, file edit, search, ...) |
crates/codegen/xai-grok-workspace |
Host filesystem, VCS, execution, checkpoints |
third_party/ |
Vendored upstream source (Mermaid diagram stack) |
- External contributions are not accepted (see
CONTRIBUTING.mdin the repository). - The root
Cargo.tomlis generated — treat it as read-only and prefer editing per-crateCargo.tomlfiles.
First-party code in the repository is licensed under the Apache License, Version 2.0. Third-party and vendored code remains under its original licenses.