uniflow
KO / EN
Dev·실행·2026-05-26

Grok Build CLI — Install, Authenticate, and First Run (2026 Guide)

Grok Build CLI is xAI’s terminal-based AI coding agent, launched May 14, 2026. Here’s the install command, auth options, first run modes, and how Grok Build CLI compares with Claude Code and Codex on attachments.

What Is Grok Build CLI — Where It Sits Next to Claude Code and Codex

Grok Build CLI is xAI's terminal-based AI coding agent, launched in early beta on May 14, 2026. It belongs to the same category as Claude Code and Codex CLI: a tool that reads, edits, and runs code from your command line, with an AI agent doing the work.

The previous xAI coding model, grok-code-fast-1, was retired on May 15, 2026, and its calls are now auto-routed to the new grok-build-0.1 model. Existing code keeps working without changes. The catch is that pricing now follows grok-4.3 rates, so teams that need predictable costs should explicitly update model names in their code (covered in the migration section below).

Here is where Grok Build CLI sits next to the other terminal coding agents:

ToolVendorEntry priceAuth
Grok Build CLIxAISuperGrok $30/mo or X Premium+ $40/mo (or API usage)xAI/X OAuth or API key
Claude CodeAnthropicPro $20/mo (or Max $100/mo, or usage)Anthropic account
Codex CLIOpenAIChatGPT Plus $20/mo (or usage)OpenAI account

All three live in the same neighborhood, but Grok Build CLI ships with two differentiators that matter for day-to-day use: native CLAUDE.md support and model flexibility through OpenRouter, which lets you route the same CLI to Claude, GPT, or local LLMs.

Installing Grok Build CLI on macOS and Linux

Installation is one line.

curl -fsSL https://x.ai/cli/install.sh | bash

Verify the version after installation:

grok --version

Grok Build CLI supports macOS and Linux only. Windows is not officially supported as of May 2026. Windows users have to fall back to WSL (Windows Subsystem for Linux), and even there some commands may behave inconsistently.

The install script appends to your shell profile (~/.bashrc, ~/.zshrc), so open a new terminal session or reload your shell before running grok for the first time.

Authentication — SuperGrok or X Premium+ vs API Key

Grok Build CLI offers two authentication paths. They differ in cost structure and target use case, so choose based on how often you plan to run the agent.

Path 1 — SuperGrok or X Premium+ subscription (OAuth)

Subscribers authenticate once via OAuth.

grok auth login

The command opens a browser and walks through the xAI/X account flow. Entry pricing is SuperGrok at $30/month ($300/year), and X's Premium+ subscribers at $40/month get the same access bundled in — no extra signup needed. For higher quotas there's SuperGrok Heavy at $300/month. The fixed monthly cost is the natural fit for developers who run a coding agent every day.

Path 2 — API key

If you only need the CLI occasionally, or if you're a team that needs to meter usage, the API key path is cheaper.

export XAI_API_KEY=xai-...

Get an API key from the xAI console. Pricing is usage-based at roughly $1 per 1M input tokens for grok-build-0.1. If you only use it a few times a week, this is the more economical option.

First Run — code, plan, and ask Modes

Grok Build CLI exposes three modes that control how autonomous the agent is.

  • code mode (default) — Reads files, edits them, and runs commands automatically. Fastest, with the broadest automatic action scope.
  • plan mode — Shows the proposed diff first and waits for your approval before applying anything.
  • ask mode — Read-only. The agent answers questions and explains code but never modifies files. Useful for code review or explanation-only sessions.

If this is your first time, start in plan mode. Seeing the diff up front prevents the most common kind of "the agent did something I didn't expect" incident.

Switch modes mid-session with slash commands:

Advertisement본문 중간 · 반응형본 도메인에서만 게재
/plan        # switch to plan mode
/model       # change the active model (grok-build-0.1, claude-sonnet-4, ...)
/compact     # compress conversation context
/cost        # show token usage for the current session

To preview a project before kicking off the agent, run grok inspect — it summarizes the directory tree and key files.

Migrating from grok-code-fast-1 — Pricing Checkpoints

According to xAI's model retirement schedule, eight models — including grok-code-fast-1 — were retired at 12:00 PM PT on May 15, 2026. grok-code-fast-1 is now auto-routed to grok-build-0.1, while most other models redirect to grok-4.3. Existing API calls keep working without code changes.

Auto-routing is convenient, but watch two pitfalls:

First, billing follows grok-4.3 rates: $1.25 per 1M input tokens and $2.50 per 1M output tokens. Any budget you built around the old grok-code-fast-1 price will drift, so explicitly updating model names to grok-build-0.1 in your code makes pricing more predictable.

Second, reasoning settings default down. Reasoning models map to grok-4.3 with "low" effort, non-reasoning ones to "none." Response quality may shift slightly, so a short regression test before you finalize the migration is worth the time.

File and Image Attachments — Has the Codex Pain Point Closed?

Anyone who's used Codex CLI has run into the same wall. It reads code files from your directory just fine, but PDFs, images, or screenshots can't be attached into the session. Show a design mock and say "build this in code" — that flow doesn't naturally happen inside Codex CLI. You end up describing it in text, switching to Claude Code, or opening ChatGPT in a separate browser tab.

Claude Code has been ahead on this front. You can attach images and PDFs directly inside the CLI and use them as context — mocks, diagrams, error screenshots all go straight in.

Grok Build CLI sits closer to Claude Code on this. Files can be attached directly to a chat session, and from that point they're available for Q&A, extraction, and agent-driven document search inside that same session.

  • Images: up to 20 MiB per image (vision processing)
  • Documents: PDF, HTML, plain text, Excel, structured datasets (CSV, JSON), major code file formats
  • Pattern: attach the file to the session, then ask questions, extract content, or have the agent operate on it within the conversation context

On top of that, the grok-build-0.1 model itself supports a 256K-token context window. That number matters when you want to keep a large PDF manual or a sizable codebase loaded in a single session.

Here's how the three tools compare on attachment support:

ToolRead code filesImage attachmentsPDF / document attachments
Codex CLI✅❌❌
Claude Code✅✅✅
Grok Build CLI✅✅ (20 MiB/image)✅ (PDF, Excel, CSV, etc.)

For Claude Code Users — Why Native CLAUDE.md Support Matters

Among Grok Build CLI's differentiators, the one with the most immediate impact for developers already using Claude Code is native CLAUDE.md support.

If you've been on Claude Code, you almost certainly have a CLAUDE.md file at your project root — your project context, coding conventions, domain notes. Moving that file to another AI tool usually meant reformatting it or running a separate import. Grok Build CLI reads the same CLAUDE.md file with no extra setup.

Combined with OpenRouter routing — which lets you call claude-sonnet-4 or gpt-5 from inside the same CLI — you get a "one tool, swap the model" workflow. Some tasks go to a Grok model, others to Claude, all from the same terminal session.

Next Steps

This guide only covered the first run of Grok Build CLI: install, authenticate, pick a mode. The next pieces — actually driving the agent through real coding work, Korean-language environment quirks, and how it behaves on long-running tasks — belong in follow-up posts.

xAI's May 2026 wave didn't stop at the CLI. Connectors, Imagine Agent Mode, and Persistent Skills landed in the same window, making May one of the busiest months Grok's ecosystem has seen. The next post will pull all of those updates into one place.

Advertisement글 최하단 · 띠배너본 도메인에서만 게재