Technology & AI

SpaceXAI Open-Sources Grok Build: Rust Agent Harness, TUI, and Tool Layer Behind Its CLI Code





SpaceXAI has open sourced the Grok Buildthe terminal-based AI code agent behind it grok The CLI. The source hit GitHub today. Release includes agent harness, TUI, CLI shell, and developer tools under the Apache 2.0 license

What is Grok Build?

A harnesses scaffolding around the model. It compiles the context, calls the model, parses the response, and dispatches the tool calls.

Grok Build launched as an early beta on May 25, 2026. An agent that understands your codebase, edits files, executes shell commands, and searches the web. It also manages long-running tasks. It works like a full-screen, mouse-friendly TUI.

There are three areas. There is an interactive TUI, a headless mode for writing and CI. Editors have embedded it with Agent Client Protocol (ACP).

“>

What does the published site contain?

Building on that framework, SpaceXAI lists four published areas. I agent loop includes context binding, response parsing, and tool call dispatch. I tools covers how the agent reads, edits, and searches for code. I Terminal UI it includes rendering, input management, program updating, and a separate inline viewer. I expansion system includes skills, plugins, hooks, MCP servers, and subagents.

Those places point to named crates:

The wayContent
crates/codegen/xai-grok-pager-binThe root-compile package; build i xai-grok-pager binary
crates/codegen/xai-grok-pagerTUI: scrollback, fast, modals, rendering
crates/codegen/xai-grok-shellAgent runtime and leader/stdio/headless entry points
crates/codegen/xai-grok-toolsUse of tools (terminal, file editing, search)
crates/codegen/xai-grok-workspaceHost file system, VCS, execution, checkpoints
third_party/Upstream fountain for sale (Mermaid painting stack)

Study that table as a study plan. Start at xai-grok-shell in the loop, then xai-grok-tools. One construction note is easy to remember. The root Cargo.toml is generated, and the README says to treat it as read-only.

How does the local-first approach work?

Apart from the test, SpaceXAI sets one valid result. Grok Build is now fully functional in the first place. Assemble it yourself, point it in the right direction, and remove everything config.toml.

# ~/.grok/config.toml  (Windows: %USERPROFILE%.grokconfig.toml)
[model.my-model]
model = "model-id"
base_url = "
name = "Display Name"
env_key = "API_KEY"

[models]
default = "my-model"

grok inspect then prints what the harness finds in the current directory. That includes maintenance sources, instructions, skills, plugins, hooks, and MCP servers.

How does the Grok Build compare?

AgentFirst person licenseFork and fixModel selectionExternal PRs
Grok Build (xai-org/grok-build)Apache 2.0It is allowedAnywhere, with config.tomlNot accepted
Codex CLI (openai/codex)Apache 2.0It is allowedOpenAI modelsOpen the PR line
OpenCode (anomalyco/opencode)MITIt is allowed75+ suppliersCommunity project
Claude CodeOwnershipNot givenAnthropic modelsn/a

Use cases and examples

Given all that, four uses still exist today.

  • Check before you get it: Read xai-grok-tools before allowing the agent to run commands on the managed repo.
  • Inner harness fork: Apache 2.0 allows it; upstream integration is not provided.
  • Running with air gaps: Assemble in place, set base_url go to the inner end, then jump api.x.ai.
  • CI automation: Headless mode feeds programmed output into a pipeline step.
# Prebuilt binary (macOS, Linux, Windows)
curl -fsSL  | bash
grok --version

# Or build from source (needs protoc and the pinned Rust toolchain)
cargo build -p xai-grok-pager-bin --release   # -> target/release/xai-grok-pager

# Audit path: per-crate commands, because full-workspace builds are slow
cargo check -p xai-grok-tools
cargo test -p xai-grok-config
cargo clippy -p xai-grok-shell

# Headless run with machine-readable output
grok -p "Explain the architecture" --output-format streaming-json

# Route one run through a model declared in ~/.grok/config.toml
grok inspect
grok -p "Hello" -m my-model

Check out the GitHub Repo, announcement, and documentation.


Michal Sutter is a data science expert with a Master of Science in Data Science from the University of Padova. With a strong foundation in statistical analysis, machine learning, and data engineering, Michal excels at turning complex data sets into actionable insights.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button