Open source · Apache 2.0

Grok Build Is Fully Open Source: Rust Source on GitHub
A local-first AI coding terminal

As of 2026-10-20, Grok Build is open source under Apache 2.0: the GitHub repo holds the full Rust source, so you can build it yourself or install the official binary. On 2026-07-15 xAI open-sourced its terminal coding agent Grok Build under Apache 2.0. Here is what shipped, what did not (model weights), how to compile it against your own inference endpoint, and the privacy timeline behind the move.

#Apache 2.0 #Rust · TUI #Local-first

What the Grok Build release actually is

As of 2026-10-20, the GitHub repository holds the Rust source for the grok CLI/TUI and its agent runtime, and the official README says it is synced periodically from the SpaceXSI monorepo. The release is Grok Build itself — xAI's terminal AI coding agent (TUI): the full agent shell that reads, edits, searches and runs code, including its extension system (skills, plugins, hooks, MCP servers, subagents), mostly Rust source, on GitHub. What it is not: open model weights. Inference still comes from an endpoint you choose — xAI's API, another cloud provider, or a model you host yourself.

Key facts of the release

Based on the official xAI README, the official docs and GitHub repository data; the privacy timeline rests on major tech coverage (released 2026-07, checked 2026-10-20).

Apache 2.0 license

A permissive license allowing commercial use, modification and redistribution. The entire codebase shipped at once — not a trimmed-down mirror.

Rust source published

Agent engine, terminal UI, tool layer and extension system are all public, so every file access and network call the agent makes can be audited. The Rust toolchain is pinned by rust-toolchain.toml in the repo; as of 2026-10-20 the repository has 27,460 stars on GitHub.

Local-first operation

Compile it yourself and point config.toml at any endpoint: xAI's API, an API-compatible relay, or local inference such as vLLM or llama.cpp.

The privacy incident and the fix

Before the release, researchers found earlier versions syncing entire repositories — including sensitive files — to cloud storage without clear consent. xAI says all uploaded data was permanently deleted, retention is now off by default, and usage limits were reset for all users.

Compiling and running it yourself

As of 2026-10-20 the official docs give two routes: install the released binary (curl -fsSL https://x.ai/cli/install.sh | bash), or clone the GitHub repo and build it with the Rust toolchain, which rust-toolchain.toml pins; macOS and Linux are supported build hosts, while Windows builds are best-effort and not currently tested from this tree. The typical path: clone the GitHub repo, build with the Rust toolchain, configure model endpoints and keys in config.toml, run it in your terminal. The shell itself is light; real compute lives at whatever model endpoint you attach.

# example self-build flow (illustrative)
git clone https://github.com/xai-org/grok-build
cd grok-build && cargo build --release
# edit config.toml: model endpoint, keys, hooks
# then run the built binary per the repo README

For sensitive codebases, audit hooks and network egress settings before choosing an endpoint, and check the data-retention policy of any third-party endpoint you attach.

The privacy timeline

The incident is the direct backdrop of the release: researchers demonstrated that earlier Grok Build versions uploaded user directories — repos, key files and more — to cloud storage without explicit consent. xAI responded publicly: deleting all uploaded data, disabling retention by default, and opening the full source for audit. Whether to trust the hosted path again is your call; self-compiling with an endpoint you control is the conservative answer.

Local + cloud: the practical 2026 pattern

As of 2026-10-20, the official docs describe three ways to use Grok Build: an interactive TUI, headless mode for scripts and bots, or the Agent Client Protocol (ACP) inside other apps. A common setup: run your own Grok Build build against a local model for privacy-sensitive or offline work, and switch the endpoint to hosted frontier models when a task needs more capability. One terminal workflow, two data boundaries.

Where QCode fits in a hybrid setup

QCode gives you one key for the Claude and GPT/Codex families and Chinese models with China-optimized routing. Since the open-source Grok Build lets you choose endpoints freely, it doubles as a unified front end: local models for the privacy baseline, QCode for frontier capability and quota headroom. As of 2026-10-20, QCode bills per token and each model's price is listed in /models; whether Grok models are available on QCode is shown there as well.

Grok Build open source FAQ

Is Grok Build free now that it is open source?

The repo's first-party code is licensed under Apache 2.0 (third-party and vendored code keeps its own licenses) and carries no separate charge. Hosted Grok model inference still bills through xAI subscriptions or API pricing; a self-compiled build pointed at your own or a third-party endpoint does not need an xAI subscription, and the model cost then depends on the service you attach.

Why did xAI open-source it?

The trigger was the privacy incident: earlier versions were caught uploading user repositories without clear consent. xAI answered with three moves — delete the uploaded data, disable retention, open the full source — and reset usage limits for all users.

How do I run Grok Build locally?

Install the released binary with the official script (macOS / Linux / Git Bash: curl -fsSL https://x.ai/cli/install.sh | bash; Windows PowerShell: irm https://x.ai/cli/install.ps1 | iex), or clone the GitHub repo and build it with the Rust toolchain: the toolchain is pinned by rust-toolchain.toml, DotSlash is also required (the hermetic bin/protoc is fetched through it), macOS and Linux are supported build hosts, and Windows builds are best-effort and not currently tested from this tree. The repository does not accept external contributions, so a self-built copy is yours to maintain. At runtime you need a Rust build environment plus one model endpoint: the shell itself barely needs hardware. Fully offline use means hosting an open model yourself (GPU memory depends on the model); pointing at a cloud endpoint runs fine on an ordinary dev machine.

How does a self-built Grok Build complement QCode?

Grok Build is the shell; QCode supplies the model layer. Your build keeps the tool layer auditable, while one QCode key covers Claude, GPT and Chinese models — data boundary on one side, model capability on the other.

Set up the hybrid workflow today

Own the shell, rent the models: one QCode key covers Claude, GPT and Chinese models.

Not sure where to start?

Try it for a week

Small Pack: $4 for $30 of quota, valid 7 days

Use it every day

Starter: $9.00/month with $5 of quota every day — just $0.060 per $1 of quota, vs about $0.113 for the Medium Pack