{"slug": "spacexai-open-sources-grok-build-the-rust-agent-harness-tui-and-tool-layer-its", "title": "SpaceXAI Open-Sources Grok Build: The Rust Agent Harness, TUI, and Tool Layer Behind Its Coding CLI", "summary": "SpaceXAI has open-sourced Grok Build, the terminal-based AI coding agent behind its grok CLI, under the Apache 2.0 license. The release includes the agent harness, TUI, CLI shell, and developer tooling, enabling fully local-first operation with any model via config.toml. The move positions Grok Build as a competitive open-source alternative to Codex CLI and Claude Code for AI-assisted coding.", "body_md": "**SpaceXAI has open-sourced Grok Build**, the terminal-based AI coding agent behind its\n\n`grok`\n\nCLI. The source landed on GitHub today. The release covers the **agent harness, TUI, CLI shell, and developer tooling** under the Apache 2.0 license\n\n**What is Grok Build?**\n\nA **harness** is the scaffolding around a model. It assembles context, calls the model, parses the reply, and dispatches tool calls.\n\nGrok Build was launched as an early beta on May 25, 2026. It is an agent that understands your codebase, edits files, executes shell commands, and searches the web. It also manages long-running tasks. It runs as a full-screen, mouse-interactive TUI.\n\nThree surfaces exist. There is the interactive TUI, headless mode for scripting and CI. Editors embed it through the **Agent Client Protocol (ACP)**.\n\n**What does the published area contain?**\n\nBuilding on that framing, SpaceXAI lists four published areas. The **agent loop** covers context assembly, response parsing, and tool-call dispatch. The **tools** cover how the agent reads, edits, and searches code. The **terminal UI** covers rendering, input handling, plan review, and the inline diff viewer. The **extension system** covers skills, plugins, hooks, MCP servers, and subagents.\n\nThose areas map onto named crates:\n\n| Path | Contents |\n|---|---|\n`crates/codegen/xai-grok-pager-bin` | Composition-root package; builds the `xai-grok-pager` binary |\n`crates/codegen/xai-grok-pager` | The TUI: scrollback, prompt, modals, rendering |\n`crates/codegen/xai-grok-shell` | Agent runtime plus leader/stdio/headless entry points |\n`crates/codegen/xai-grok-tools` | Tool implementations (terminal, file edit, search) |\n`crates/codegen/xai-grok-workspace` | Host filesystem, VCS, execution, checkpoints |\n`third_party/` | Vendored upstream source (Mermaid diagram stack) |\n\nRead that table as a reading order. Start at `xai-grok-shell`\n\nfor the loop, then `xai-grok-tools`\n\n. One build note is easy to miss. The root `Cargo.toml`\n\nis generated, and the README says to treat it as read-only.\n\n**How does the local-first path work?**\n\nBeyond inspection, SpaceXAI frames one practical outcome. Grok Build can now run fully local-first. Compile it yourself, point it at local inference, and drive everything from `config.toml`\n\n.\n\n```\n# ~/.grok/config.toml  (Windows: %USERPROFILE%\\.grok\\config.toml)\n[model.my-model]\nmodel = \"model-id\"\nbase_url = \"https://api.example.com/v1\"\nname = \"Display Name\"\nenv_key = \"API_KEY\"\n\n[models]\ndefault = \"my-model\"\n```\n\n`grok inspect`\n\nthen prints what the harness discovered in the current directory. That covers config sources, instructions, skills, plugins, hooks, and MCP servers.\n\n**How does Grok Build compare?**\n\n| Agent | First-party license | Fork and modify | Model choice | External PRs |\n|---|---|---|---|---|\nGrok Build (`xai-org/grok-build` ) | Apache 2.0 | Permitted | Any, via `config.toml` | Not accepted |\nCodex CLI (`openai/codex` ) | Apache 2.0 | Permitted | OpenAI models | Open PR queue |\nOpenCode (`anomalyco/opencode` ) | MIT | Permitted | 75+ providers | Community project |\n| Claude Code | Proprietary | Not granted | Anthropic models | n/a |\n\n**Use cases and examples**\n\nGiven all of that, four uses hold up today.\n\n**Audit before adoption**: Read`xai-grok-tools`\n\nbefore letting an agent run shell commands in a regulated repo.**Fork for an internal harness**: Apache 2.0 permits it; upstream merge is not on offer.** Air-gapped runs**: Compile locally, set`base_url`\n\nto an internal endpoint, and skip`api.x.ai`\n\n.**CI automation**: Headless mode feeds structured output into a pipeline step.\n\n```\n# Prebuilt binary (macOS, Linux, Windows)\ncurl -fsSL https://x.ai/cli/install.sh | bash\ngrok --version\n\n# Or build from source (needs protoc and the pinned Rust toolchain)\ncargo build -p xai-grok-pager-bin --release   # -> target/release/xai-grok-pager\n\n# Audit path: per-crate commands, because full-workspace builds are slow\ncargo check -p xai-grok-tools\ncargo test -p xai-grok-config\ncargo clippy -p xai-grok-shell\n\n# Headless run with machine-readable output\ngrok -p \"Explain the architecture\" --output-format streaming-json\n\n# Route one run through a model declared in ~/.grok/config.toml\ngrok inspect\ngrok -p \"Hello\" -m my-model\n```\n\nCheck out the [GitHub Repo](https://github.com/xai-org/grok-build), the [announcement](https://x.ai/news/grok-build-open-source), and the [documentation](https://docs.x.ai/build/overview).\n\nMichal Sutter is a data science professional with a Master of Science in Data Science from the University of Padova. With a solid foundation in statistical analysis, machine learning, and data engineering, Michal excels at transforming complex datasets into actionable insights.", "url": "https://wpnews.pro/news/spacexai-open-sources-grok-build-the-rust-agent-harness-tui-and-tool-layer-its", "canonical_source": "https://www.marktechpost.com/2026/07/15/spacexai-open-sources-grok-build-the-rust-agent-harness-tui-and-tool-layer-behind-its-coding-cli/", "published_at": "2026-07-16 06:35:54+00:00", "updated_at": "2026-07-16 06:38:25.248286+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "ai-agents"], "entities": ["SpaceXAI", "Grok Build", "GitHub", "Codex CLI", "OpenCode", "Claude Code", "OpenAI", "Anthropic"], "alternates": {"html": "https://wpnews.pro/news/spacexai-open-sources-grok-build-the-rust-agent-harness-tui-and-tool-layer-its", "markdown": "https://wpnews.pro/news/spacexai-open-sources-grok-build-the-rust-agent-harness-tui-and-tool-layer-its.md", "text": "https://wpnews.pro/news/spacexai-open-sources-grok-build-the-rust-agent-harness-tui-and-tool-layer-its.txt", "jsonld": "https://wpnews.pro/news/spacexai-open-sources-grok-build-the-rust-agent-harness-tui-and-tool-layer-its.jsonld"}}