Grok Build:xAI 开源 Rust 编码 Agent,全屏 TUI + ACP 协议
Grok Build: xAI Open-Sources Its Rust Coding Agent — Fullscreen TUI and ACP Protocol
xAI 把自己的编码 Agent 开源了
SpaceXAI(即 Elon Musk 的 xAI)将其内部编码 Agent 工具 Grok Build(命令:grok)以 Apache 2.0 开源。
一句话描述:用 Rust 写的、全屏终端界面的 AI 编码 Agent,理解代码库、编辑文件、执行命令、搜索网页、管理长任务——既可以交互使用,也可以无头运行用于脚本和 CI,还能通过 ACP(Agent Client Protocol)嵌入编辑器。
2026年7月开源以来,⭐ 26,283,fork 4,935,是目前 AI 编码 Agent 赛道里开源速度最快的项目之一。
全屏 TUI:不是 CLI,是界面
大多数编码 Agent 是”对话框式”——你输入问题,它输出回答,像一个增强版的终端。
Grok Build 选了不同的方向:全屏 TUI(终端用户界面),支持鼠标交互,有滚动历史、提示符、模态窗口、渲染层。用起来更接近 IDE 的终端面板,而不是一个 chat 窗口。
代码组织上,TUI 层(xai-grok-pager)和 Agent 运行时(xai-grok-shell)是分开的——UI 和 Agent 逻辑解耦,各自可以独立开发。
三种运行模式
| 模式 | 用途 |
|---|---|
| 交互模式 | 全屏 TUI,日常开发使用 |
| 无头模式(Headless) | 脚本、CI/CD 管道,不需要 UI |
| 编辑器嵌入(ACP) | 通过 Agent Client Protocol 嵌入 Cursor、VS Code 等编辑器 |
ACP(Agent Client Protocol)是 xAI 实现的开放协议,让 Grok Build 可以作为后端 Agent 被任意支持 ACP 的编辑器调用——就像 LSP 是语言服务器协议,ACP 是 Agent 服务器协议。
Agent 能力
- 文件编辑:读取、修改、创建文件
- Shell 命令执行:在受控环境里跑终端命令
- 网页搜索:直接从 Agent 里搜索外部信息
- 长任务管理:追踪和管理运行时间长的任务
- 沙盒隔离:可配置的沙盒执行环境,限制 Agent 的操作范围
扩展生态
Grok Build 有完整的扩展机制:
- MCP Servers:接入 Model Context Protocol 生态
- Skills:可复用的技能包
- Plugins:插件系统
- Hooks:在操作前后注入自定义逻辑
- 主题(Theming):自定义 TUI 外观
代码库结构
| Crate | 职责 |
|---|---|
xai-grok-pager | TUI 层:滚动历史、提示符、模态窗口、渲染 |
xai-grok-shell | Agent 运行时:leader / stdio / headless 入口 |
xai-grok-tools | 工具实现:终端、文件编辑、搜索等 |
xai-grok-workspace | 宿主文件系统、VCS、执行环境、检查点 |
值得注意的是 THIRD-PARTY-NOTICES——其中明确记录了 openai/codex 和 sst/opencode 的工具实现被移植进了 grok-build,并附有 Apache §4(b) 变更声明。这说明 xAI 在构建自己的工具层时参考和整合了开源生态里的现有实现。
安装
# macOS / Linux / Git Bash
curl -fsSL https://x.ai/cli/install.sh | bash
grok --version
# Windows PowerShell
irm https://x.ai/cli/install.ps1 | iex
首次启动会在浏览器打开认证页面。二进制产物原名 xai-grok-pager,官方安装脚本把它重命名为 grok。
从源码构建(需要 Rust + DotSlash):
cargo install dotslash # 前置依赖
cargo run -p xai-grok-pager-bin # 构建并启动 TUI
cargo build -p xai-grok-pager-bin --release # 发布版本
注意事项
不接受外部贡献(CONTRIBUTING.md 明确说明)。这个仓库是从 xAI 内部 monorepo 周期性同步出来的镜像,外部 PR 不会被合并。但代码是完整的、可读的、可构建的,fork 自用没有问题。
和其他编码 Agent 的定位对比
| 工具 | 底层语言 | 界面 | 来源 |
|---|---|---|---|
| Grok Build | Rust | 全屏 TUI + ACP | xAI(SpaceXAI) |
| Claude Code | TypeScript | CLI / TUI | Anthropic |
| OpenAI Codex | TypeScript | CLI | OpenAI |
| OpenCode | Go | TUI | SST |
| Gemini CLI | TypeScript | CLI |
Grok Build 选择 Rust 和全屏 TUI,加上 ACP 作为编辑器集成协议,是几个主流编码 Agent 里技术栈选择最激进的一个。
总结
Grok Build 是 xAI 把自己内部使用的编码 Agent 工具开源出来的产物。Rust + 全屏 TUI 的技术路线,交互/无头/ACP 三种运行模式,完整的 MCP/Skills 扩展生态——26k Star 说明这个定位有真实需求。不接受外部 PR,但代码完整公开,是一个可以深读和 fork 的参考实现。
GitHub: xai-org/grok-build ⭐26283
官网: x.ai/cli
文档: docs.x.ai/build/overview
Grok Build: xAI Open-Sources Its Rust Coding Agent
SpaceXAI (Elon Musk’s xAI) has open-sourced Grok Build (grok) — their internal coding agent — under Apache 2.0.
One sentence: a Rust-built, fullscreen-terminal AI coding agent that understands codebases, edits files, executes shell commands, searches the web, and manages long-running tasks — interactive for daily use, headless for scripts and CI, or embedded in editors via ACP (Agent Client Protocol).
Since opening in July 2026: ⭐26,283, 4,935 forks — among the fastest-growing open-source coding agent repos.
Fullscreen TUI: Not a Chat Window
Most coding agents are chat-style — you type, it outputs, like an enhanced terminal prompt. Grok Build takes a different approach: a fullscreen TUI with mouse interaction, scrollback, prompt, modal windows, and a dedicated rendering layer. It feels closer to an IDE’s terminal panel than a chat box.
The TUI layer (xai-grok-pager) and the agent runtime (xai-grok-shell) are separate crates — UI and agent logic decoupled for independent development.
Three Run Modes
| Mode | Use |
|---|---|
| Interactive | Fullscreen TUI for daily development |
| Headless | Scripts, CI/CD pipelines, no UI needed |
| Editor-embedded (ACP) | Via Agent Client Protocol into Cursor, VS Code, etc. |
ACP (Agent Client Protocol) is xAI’s open protocol for embedding Grok Build as a backend agent in any ACP-compatible editor — the way LSP is a server protocol for language tooling, ACP is a server protocol for agents.
Agent Capabilities
- File editing: read, modify, create files
- Shell command execution: run terminal commands in a controlled environment
- Web search: search external information from within the agent
- Long-task management: track and manage extended-duration tasks
- Sandboxed execution: configurable sandboxing to constrain the agent’s action scope
Extension Ecosystem
- MCP Servers: Model Context Protocol integration
- Skills: reusable skill packages
- Plugins: plugin system
- Hooks: inject custom logic before/after operations
- Theming: custom TUI appearance
Codebase Layout
| Crate | Responsibility |
|---|---|
xai-grok-pager | TUI: scrollback, prompt, modals, rendering |
xai-grok-shell | Agent runtime: leader / stdio / headless entry points |
xai-grok-tools | Tool implementations: terminal, file edit, search, … |
xai-grok-workspace | Host filesystem, VCS, execution environment, checkpoints |
Notable: THIRD-PARTY-NOTICES explicitly records that openai/codex and sst/opencode tool implementations were ported into grok-build, with Apache §4(b) change notices. xAI integrated and built on top of existing open-source implementations in the tool layer.
Install
# macOS / Linux / Git Bash
curl -fsSL https://x.ai/cli/install.sh | bash
grok --version
# Windows PowerShell
irm https://x.ai/cli/install.ps1 | iex
First launch opens your browser for authentication. The binary is built as xai-grok-pager; the install script renames it to grok.
Build from source (requires Rust + DotSlash):
cargo install dotslash
cargo run -p xai-grok-pager-bin # build and launch TUI
cargo build -p xai-grok-pager-bin --release
Important: No External Contributions
CONTRIBUTING.md explicitly states external contributions are not accepted. This repo is a periodic mirror from xAI’s internal monorepo — external PRs won’t be merged. But the code is complete, readable, and buildable — forking for personal use is fine.
Positioning vs. Other Coding Agents
| Tool | Language | Interface | Origin |
|---|---|---|---|
| Grok Build | Rust | Fullscreen TUI + ACP | xAI (SpaceXAI) |
| Claude Code | TypeScript | CLI / TUI | Anthropic |
| OpenAI Codex | TypeScript | CLI | OpenAI |
| OpenCode | Go | TUI | SST |
| Gemini CLI | TypeScript | CLI |
Grok Build’s bet on Rust, fullscreen TUI, and ACP as an editor integration protocol is the most technically distinct choice among the major coding agents.
Summary
Grok Build is xAI’s open-sourced internal coding agent. Rust + fullscreen TUI, three run modes (interactive / headless / ACP), and a complete MCP/Skills extension ecosystem. 26k stars confirms the positioning has real demand. External PRs aren’t accepted, but the code is fully public — a readable, buildable reference implementation.
GitHub: xai-org/grok-build ⭐26283
Website: x.ai/cli
Docs: docs.x.ai/build/overview
关于本站 · 免责声明
🍄 Mushroom Research Blog 是非营利、免费公开的个人科技观察博客与公众号 XStack18,不接受商业合作、不代表任何企业或机构立场,也不谋求商业利益。我们以个人视角客观中立地记录和分析 AI、Web3 等领域的最新模型发布与技术动态——不止转述新闻标题或二手信息,而是给出有独立思考的深入分析,希望帮更多人获得有价值的一手科技认知。
⚠️ 文中介绍的开源代码与模型,仅供学习交流与技术借鉴。它们大多仍处于早期阶段,有待进一步研究和验证,请勿直接用于工作或生产环境;如需采用,请先自行充分测试,并核实其许可证与安全性。
Open-source code and models featured here are shared for learning and reference only. Most are early-stage and still need further study and verification — please don't use them directly in your work or in production. Test them thoroughly and check their licenses and security first.
- 本站文章均为作者基于公开信息的个人研究与观点整理,不代表文中提及的任何公司、产品、模型的官方立场,未与其构成商业关联或合作关系。
- 科技行业信息更新极快,我们尽力保证内容准确、及时,但不对完整性、实时性做绝对保证,具体请以相关企业/项目官方公告为准。
- 文中引用的第三方商标、产品名称、图片、数据等版权归原权利人所有,我们会尽量注明来源;如你认为存在版权疑问或侵权,请通过下方邮箱联系我们,收到通知后会尽快核实处理(更正、加注来源或删除)。
- 文章内容仅为技术科普与个人观点,不构成投资、法律或其他专业建议,据此进行任何决策的后果需自行判断和承担。
📮 侵权 / 勘误 / 合作咨询:hello@mushroom.cv
💬 评论与讨论
使用 GitHub 账号登录后发表评论