https://github.com/xai-org/grok-build
SpaceXAI's coding agent harness and TUI. Fullscreen, mouse interactive, extensible.
https://github.com/xai-org/grok-build
Last synced: 13 days ago
JSON representation
SpaceXAI's coding agent harness and TUI. Fullscreen, mouse interactive, extensible.
- Host: GitHub
- URL: https://github.com/xai-org/grok-build
- Owner: xai-org
- License: apache-2.0
- Created: 2026-07-14T20:04:23.000Z (22 days ago)
- Default Branch: main
- Last Pushed: 2026-07-15T22:48:00.000Z (21 days ago)
- Last Synced: 2026-07-16T00:26:40.594Z (21 days ago)
- Language: Rust
- Size: 10.4 MB
- Stars: 2,310
- Watchers: 23
- Forks: 331
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
- awesome - xai-org/grok-build - SpaceXAI's coding agent harness and TUI. Fullscreen, mouse interactive, extensible. (Rust)
- awesome-harness-engineering - grok-build - source terminal coding agent harness: a Rust-based fullscreen TUI with an extensible tool runtime, MCP/skills/hooks support, and headless/embedded modes via ACP. A useful first-party counterpoint to Claude Code and Codex CLI for studying how a new model provider structures the loop, checkpoints workspace state, and exposes the same harness through interactive and scripted surfaces.  (Reference Implementations / Demo Harnesses)
- awesome-ai-tools - Grok Build - sourced on GitHub (xai-org/grok-build), Apache-2.0, local-first Rust TUI, 11kโ | (๐๏ธ What's New This Week / ๐ New & Updated This Week)
- awesome - xai-org/grok-build - SpaceXAI's coding agent harness and TUI. Fullscreen, mouse interactive, extensible. (Rust)
- awesome-AI-driven-development - Grok Build (`grok`) - SpaceXAI's coding agent harness and TUI. Fullscreen, mouse interactive, extensible. (Terminal & CLI Agents)
- awesome-coding-agent - Grok Build - **24k stars** ยท `CLI` ยท `Apache-2.0`. A terminal coding agent from xAI with a full-screen interface, repository tools, and an extensible execution harness. (Ranked AI Coding Agents)
- awesome-cli-coding-agents - Grok Build - interactive, and extensible. Apache-2.0. (Terminal-native coding agents / Open Source)
README
Grok Build (grok)
**Grok Build** is SpaceXAI's terminal-based AI coding agent. It runs as a
full-screen TUI that understands your codebase, edits files, executes shell
commands, searches the web, and manages long-running tasks โ interactively,
headlessly for scripting/CI, or embedded in editors via the Agent Client
Protocol (ACP).
[Installing the released binary](#installing-the-released-binary) ยท
[Building from source](#building-from-source) ยท
[Documentation](#documentation) ยท
[Repository layout](#repository-layout) ยท
[Development](#development) ยท
[Contributing](#contributing) ยท
[License](#license)

**Learn more about Grok Build at [x.ai/cli](https://x.ai/cli)**
This repository contains the Rust source for the `grok` CLI/TUI and its agent
runtime. It is synced periodically from the SpaceXAI monorepo.
A small `SOURCE_REV` file at the root records the full monorepo commit SHA
for the version of the code present in this tree.
---
## Installing the released binary
Prebuilt binaries are published for macOS, Linux, and Windows:
```sh
curl -fsSL https://x.ai/cli/install.sh | bash # macOS / Linux / Git Bash
irm https://x.ai/cli/install.ps1 | iex # Windows PowerShell
grok --version
```
See the [changelog](https://x.ai/build/changelog) for the latest fixes,
features, and improvements in each release.
## Building from source
Requirements:
- **Rust** โ the toolchain is pinned by [`rust-toolchain.toml`](rust-toolchain.toml);
`rustup` installs it automatically on first build.
- **[DotSlash](https://dotslash-cli.com)** โ required so hermetic tools under
[`bin/`](bin/) (notably [`bin/protoc`](bin/protoc)) can download and run.
Install it and ensure `dotslash` is on your `PATH` **before** building:
```sh
cargo install dotslash
# or: prebuilt packages โ https://dotslash-cli.com/docs/installation/
/usr/bin/env dotslash --help # sanity check
```
- **protoc** โ proto codegen resolves [`bin/protoc`](bin/protoc) via DotSlash,
or falls back to a `protoc` on `PATH` / `$PROTOC`.
- macOS and Linux are supported build hosts; Windows builds are best-effort
and not currently tested from this tree.
```sh
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 validation
```
The binary artifact is named `xai-grok-pager`; official installs ship it as
`grok`. On first launch it opens your browser to authenticate โ see the
[authentication guide](crates/codegen/xai-grok-pager/docs/user-guide/02-authentication.md).
## Documentation
Full online documentation is available at
[docs.x.ai/build/overview](https://docs.x.ai/build/overview).
The user guide ships with the pager crate:
[`crates/codegen/xai-grok-pager/docs/user-guide/`](crates/codegen/xai-grok-pager/docs/user-guide/)
โ getting started, keyboard shortcuts, slash commands, configuration, theming,
MCP servers, skills, plugins, hooks, headless mode, sandboxing, and more.
## Repository layout
| 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 |
| `crates/codegen/...` | The rest of the CLI crate closure (config, MCP, markdown, sandbox, ...) |
| `crates/common/`, `crates/build/`, `prod/mc/` | Small shared leaf crates pulled in by the closure |
| `third_party/` | Vendored upstream source (Mermaid diagram stack) โ see below |
> [!IMPORTANT]
> The root `Cargo.toml` (workspace members, dependency versions, lints,
> profiles) is **generated** โ treat it as read-only. Prefer editing per-crate
> `Cargo.toml` files.
## Development
```sh
cargo check -p # always target specific crates; full-workspace builds are slow
cargo test -p xai-grok-config # per-crate tests
cargo clippy -p # lint config: clippy.toml at the repo root
cargo fmt --all # rustfmt.toml at the repo root
```
## Contributing
> [!NOTE]
> External contributions are not accepted. See [`CONTRIBUTING.md`](CONTRIBUTING.md).
## License
First-party code in this repository is licensed under the **Apache License,
Version 2.0** โ see [`LICENSE`](LICENSE).
Third-party and vendored code remains under its original licenses. See:
- [`THIRD-PARTY-NOTICES`](THIRD-PARTY-NOTICES) โ crates.io / git dependencies,
bundled UI themes, and **in-tree source ports** (including openai/codex and
sst/opencode tool implementations)
- [`crates/codegen/xai-grok-tools/THIRD_PARTY_NOTICES.md`](crates/codegen/xai-grok-tools/THIRD_PARTY_NOTICES.md)
โ crate-local notice for the codex and opencode ports (license texts +
Apache ยง4(b) change notice)
- [`third_party/NOTICE`](third_party/NOTICE) โ vendored Mermaid-stack index