REPO-015 · xAI Grok Build upstream source mirror · learning and purification only · not trusted runtime
  • Rust 99.6%
  • Python 0.2%
  • JavaScript 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
grokkybara[bot] 780d1388ff Synced from monorepo
Synced from monorepo

Changes:
- grok-shell: send an expired external-provider credential to the sign-in flow, not a 401 loop
- pager: clickable ▲ jumps to the top of the response being read
- grok-shell: keep a large task log from making the completion message too long
- Plan viewer scrollbar: widen grab zone to the border column; fix striped thumb in Terminal.app
- pager: poll the tmux probe teardown grace instead of sleeping it
- security: vendor-compat MCP kill switch is now actually enforced when reported as on
- grok-shell: restore session eviction when a leader client disconnects
- Bump rust-toolchain to 1.93.0
- workspace: lexical-normalize permission path patterns before glob matching
- pager: reject garbage Enter in the /resume picker
- pager: show Mermaid affordances in plan mode preview
- pager: drop manage-account link from /session-info
- workspace: auto-approve read-only git queries; defer write floor to auto classifier
- Add free-form pattern editor to the "Always allow" command prompt
- grok-shell: fix /btw caching
- pager: Tab walks answers in the ask_user_question card
- External-provider auth refresh: single 7s attempt instead of 3×5s
- pager: don't resurrect finished background tasks as Running when completion arrives first
- pager: report tmux truecolor clamping in Doctor
- Fix plan viewer scrollbar click+drag hijacked by comment gutter
- pager/shell: stop double Recap after the same last turn
- sampler: preserve x-should-retry through stream collection
- pager: clear plan-mode indicator immediately when the user approves a plan
- pager: tmux does not re-read its config on reattach

Source-Revision: 64c4de99cc822b25ce9c54ab5a4f372093d0885d
2026-08-03 08:17:57 +00:00
.cargo Publish harness and TUI open-source 2026-07-16 06:46:02 +01:00
bin Publish harness and TUI open-source 2026-07-16 06:46:02 +01:00
crates Synced from monorepo 2026-08-03 08:17:57 +00:00
prod/mc/cli-chat-proxy-types Synced from monorepo 2026-07-31 18:08:03 +00:00
third_party Publish harness and TUI open-source 2026-07-16 06:46:02 +01:00
.gitignore Publish harness and TUI open-source 2026-07-16 06:46:02 +01:00
Cargo.lock Synced from monorepo 2026-08-03 08:17:57 +00:00
Cargo.toml Synced from monorepo 2026-08-03 08:17:57 +00:00
clippy.toml Synced from monorepo 2026-07-31 18:08:03 +00:00
CONTRIBUTING.md Publish harness and TUI open-source 2026-07-16 06:46:02 +01:00
LICENSE Publish harness and TUI open-source 2026-07-16 06:46:02 +01:00
README.md Synced from monorepo 2026-07-16 20:27:30 +01:00
rust-toolchain.toml Synced from monorepo 2026-08-03 08:17:57 +00:00
rustfmt.toml Publish harness and TUI open-source 2026-07-16 06:46:02 +01:00
SECURITY.md Publish harness and TUI open-source 2026-07-16 06:46:02 +01:00
SOURCE_REV Synced from monorepo 2026-08-03 08:17:57 +00:00
THIRD-PARTY-NOTICES Publish harness and TUI open-source 2026-07-16 06:46:02 +01:00

SpaceXAI logo
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 · Building from source · Documentation · Repository layout · Development · Contributing · License

Grok Build TUI

Learn more about Grok Build at 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:

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 for the latest fixes, features, and improvements in each release.

Building from source

Requirements:

  • Rust — the toolchain is pinned by rust-toolchain.toml; rustup installs it automatically on first build.

  • DotSlash — required so hermetic tools under bin/ (notably bin/protoc) can download and run. Install it and ensure dotslash is on your PATH before building:

    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 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.

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.

Documentation

Full online documentation is available at docs.x.ai/build/overview.

The user guide ships with the pager crate: 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

cargo check -p <crate>        # always target specific crates; full-workspace builds are slow
cargo test -p xai-grok-config # per-crate tests
cargo clippy -p <crate>       # 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.

License

First-party code in this repository is licensed under the Apache License, Version 2.0 — see LICENSE.

Third-party and vendored code remains under its original licenses. See: