|

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

SpaceXAI has open-sourced Grok Build, the terminal-based AI coding agent behind its grok CLI. The supply landed on GitHub right this moment. The launch covers the agent harness, TUI, CLI shell, and developer tooling underneath the Apache 2.0 license

What is Grok Build?

A harness is the scaffolding round a mannequin. It assembles context, calls the mannequin, parses the reply, and dispatches device calls.

Grok Build was launched as an early beta on May 25, 2026. It is an agent that understands your codebase, edits information, executes shell instructions, and searches the online. It additionally manages long-running duties. It runs as a full-screen, mouse-interactive TUI.

Three surfaces exist. There is the interactive TUI, headless mode for scripting and CI. Editors embed it by way of the Agent Client Protocol (ACP).


What does the printed space include?

Building on that framing, SpaceXAI lists 4 printed areas. The agent loop covers context meeting, response parsing, and tool-call dispatch. The instruments cowl how the agent reads, edits, and searches code. The terminal UI covers rendering, enter dealing with, plan evaluation, and the inline diff viewer. The extension system covers expertise, plugins, hooks, MCP servers, and subagents.

Those areas map onto named crates:

Path Contents
crates/codegen/xai-grok-pager-bin Composition-root bundle; builds the xai-grok-pager binary
crates/codegen/xai-grok-pager The TUI: scrollback, immediate, modals, rendering
crates/codegen/xai-grok-shell Agent runtime plus chief/stdio/headless entry factors
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 supply (Mermaid diagram stack)

Read that desk as a studying order. Start at xai-grok-shell for the loop, then xai-grok-tools. One construct word is straightforward to overlook. The root Cargo.toml is generated, and the README says to deal with it as read-only.

How does the local-first path work?

Beyond inspection, SpaceXAI frames one sensible consequence. Grok Build can now run absolutely local-first. Compile it your self, level it at native inference, and drive all the things from config.toml.

# ~/.grok/config.toml  (Windows: %USERPROFILE%.grokconfig.toml)
[model.my-model]
mannequin = "model-id"
base_url = "https://api.instance.com/v1"
identify = "Display Name"
env_key = "API_KEY"

[models]
default = "my-model"

grok examine then prints what the harness found within the present listing. That covers config sources, directions, expertise, plugins, hooks, and MCP servers.

How does Grok Build examine?

Agent First-party license Fork and modify Model selection External PRs
Grok Build (xai-org/grok-build) Apache 2.0 Permitted Any, through config.toml Not accepted
Codex CLI (openai/codex) Apache 2.0 Permitted OpenAI fashions Open PR queue
OpenCode (anomalyco/opencode) MIT Permitted 75+ suppliers Community mission
Claude Code Proprietary Not granted Anthropic fashions n/a

Use instances and examples

Given all of that, 4 makes use of maintain up right this moment.

  • Audit earlier than adoption: Read xai-grok-tools earlier than letting an agent run shell instructions in a regulated repo.
  • Fork for an inside harness: Apache 2.0 permits it; upstream merge shouldn’t be on supply.
  • Air-gapped runs: Compile domestically, set base_url to an inside endpoint, and skip api.x.ai.
  • CI automation: Headless mode feeds structured output right into a pipeline step.
# Prebuilt binary (macOS, Linux, Windows)
curl -fsSL https://x.ai/cli/set up.sh | bash
grok --version

# Or construct from supply (wants protoc and the pinned Rust toolchain)
cargo construct -p xai-grok-pager-bin --release   # -> goal/launch/xai-grok-pager

# Audit path: per-crate instructions, as a result of full-workspace builds are sluggish
cargo test -p xai-grok-tools
cargo check -p xai-grok-config
cargo clippy -p xai-grok-shell

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

# Route one run by way of a mannequin declared in ~/.grok/config.toml
grok examine
grok -p "Hello" -m my-model


Check out the GitHub Repo, the announcement, and the documentation.

The publish SpaceXAI Open-Sources Grok Build: The Rust Agent Harness, TUI, and Tool Layer Behind Its Coding CLI appeared first on MarkTechPost.

Similar Posts