SpaceXAI has open-sourced Grok Build, the terminal-based AI coding agent powering its grok CLI, under the Apache 2.0 license. The release includes the source code for the agent harness, terminal user interface (TUI), and tool layer.
- The project is built in Rust and comprises four main areas: the agent loop for context assembly and tool dispatch, tools for code editing and searching, a full-screen TUI with inline diff viewing, and an extension system for plugins and MCP servers.
- Key components are organized into named crates, including xai-grok-shell for the agent runtime, xai-grok-tools for file and search operations, and xai-grok-pager for the UI rendering.
- Grok Build supports local-first operation, allowing users to compile it themselves and configure custom inference endpoints via config.toml.
- The agent operates through three surfaces: an interactive TUI, headless mode for CI scripting, and integration with editors via the Agent Client Protocol (ACP).
The open-source release enables developers to audit the code before adoption, fork the project for internal use, or run it in air-gapped environments without relying on external APIs.