```Grok 构建```
Grok Build is open source

原始链接: https://github.com/xai-org/grok-build

Grok Build 是一款由 x.ai 开发的终端 AI 编程智能体,专为无缝的代码库交互而设计。它以全屏终端用户界面(TUI)形式运行,提供包括文件编辑、Shell 命令执行、网络搜索以及长时间任务管理在内的各项高级功能。它支持交互式使用、用于 CI/CD 的无头(headless)模式,以及通过智能体客户端协议(ACP)与编辑器进行集成。 该项目使用 Rust 编写,用户可通过简单的安装脚本获取适用于 macOS、Linux 和 Windows 的官方二进制文件。完成身份验证后,用户即可使用其强大的功能集,包括 MCP 服务器支持、插件以及沙盒执行环境。该代码库采用模块化结构,分为 TUI、智能体运行时和工作区管理等特定组件(crate)。 包含键盘快捷键、配置和主题设置等内容的详细用户指南,可在 `docs.x.ai/build/overview` 获取。该项目采用 Apache 2.0 开源许可证,源代码库与 SpaceXAI 单体仓库保持同步。开发者可以使用标准的 Cargo 命令从源码构建,但建议通过各组件单独管理来优化性能,而非进行全工作区构建。

Grok Build 源代码在 GitHub 上的发布引发了 Hacker News 上两极分化的争论。批评者认为 xAI 不值得信任,并列举了其充满争议的领导层、过往的数据隐私隐忧,以及在模型内容方面涉嫌的伦理过失。反对者认为,此次开源举措是一种应对性的尝试,旨在缓解近期因数据采集行为和强制代码访问要求而引发的强烈抨击。 另一方面,一些用户则认为发布源代码是迈向透明化的一大进步,指出开源使得社区能够审查代码以排查安全风险。另一些人则认为,专门针对 xAI 的不信任态度有失偏颇,因为谷歌、OpenAI 和 Anthropic 等主要竞争对手同样面临严重的伦理和隐私争议。 讨论还涉及了技术层面,一些开发者表示有兴趣对该工具进行逆向工程,而另一些人则批评了其采用文本用户界面(TUI)的选择,并质疑该项目在数据隐私方面是否仍然是一个“黑箱”。归根结底,这一讨论反映了两种观点之间的深刻分歧:一方将 xAI 的领导层视为一种否定因素,而另一方则在更广泛的 AI 领域中优先考量技术效用和开源的可访问性。
相关文章

原文

Grok Build is SpaceXAI's terminal-based AI coding agent. It runs as a full-screen TUI that understands your codebase, edits files, executes shell commands, searches the web, and manages long-running tasks — interactively, headlessly for scripting/CI, or embedded in editors via the Agent Client Protocol (ACP).

Installing the released binary · Building from source · Documentation · Repository layout · Development · Contributing · License

Grok Build TUI

Learn more about Grok Build at x.ai/cli

This repository contains the Rust source for the grok CLI/TUI and its agent runtime. It is synced periodically from the SpaceXAI monorepo.


Installing the released binary

Prebuilt binaries are published for macOS, Linux, and Windows:

curl -fsSL https://x.ai/cli/install.sh | bash   # macOS / Linux / Git Bash
irm https://x.ai/cli/install.ps1 | iex          # Windows PowerShell
grok --version

See the changelog for the latest fixes, features, and improvements in each release.

Requirements:

  • Rust — the toolchain is pinned by rust-toolchain.toml; rustup installs it automatically on first build.
  • protoc — proto codegen resolves bin/protoc (a dotslash launcher) or falls back to a protoc on PATH / $PROTOC.
  • macOS and Linux are supported build hosts; Windows builds are best-effort and not currently tested from this tree.
cargo run -p xai-grok-pager-bin              # build + launch the TUI
cargo build -p xai-grok-pager-bin --release  # release binary: target/release/xai-grok-pager
cargo check -p xai-grok-pager-bin            # fast validation

The binary artifact is named xai-grok-pager; official installs ship it as grok. On first launch it opens your browser to authenticate — see the authentication guide.

Full online documentation is available at docs.x.ai/build/overview.

The user guide ships with the pager crate: crates/codegen/xai-grok-pager/docs/user-guide/ — getting started, keyboard shortcuts, slash commands, configuration, theming, MCP servers, skills, plugins, hooks, headless mode, sandboxing, and more.

Path Contents
crates/codegen/xai-grok-pager-bin Composition-root package; builds the xai-grok-pager binary
crates/codegen/xai-grok-pager The TUI: scrollback, prompt, modals, rendering
crates/codegen/xai-grok-shell Agent runtime + leader/stdio/headless entry points
crates/codegen/xai-grok-tools Tool implementations (terminal, file edit, search, ...)
crates/codegen/xai-grok-workspace Host filesystem, VCS, execution, checkpoints
crates/codegen/... The rest of the CLI crate closure (config, MCP, markdown, sandbox, ...)
crates/common/, crates/build/, prod/mc/ Small shared leaf crates pulled in by the closure
third_party/ Vendored upstream source (Mermaid diagram stack) — see below

Important

The root Cargo.toml (workspace members, dependency versions, lints, profiles) is generated — treat it as read-only. Prefer editing per-crate Cargo.toml files.

cargo check -p <crate>        # always target specific crates; full-workspace builds are slow
cargo test -p xai-grok-config # per-crate tests
cargo clippy -p <crate>       # lint config: clippy.toml at the repo root
cargo fmt --all               # rustfmt.toml at the repo root

First-party code in this repository is licensed under the Apache License, Version 2.0 — see LICENSE.

Third-party and vendored code remains under its original licenses. See:

联系我们 contact @ memedata.com