Grok Build · terminal
Grok Build through PowerShell & the CLI
Stable 1.0.46 (30 Sep 2026). Plan, Auto, and always-approve; workflows; memory; MCP; headless.
Grok Build is xAI’s terminal-native coding agent. On Windows you install it with a single PowerShell command. You work in a project directory; the agent reads your repo, proposes plans, edits files, runs tests, and shows clean diffs.
Stable channel is 1.0.46. Memory is generally available. Workflows are on by default. Grok 4.7 is the flagship; Grok 4.7 Fast is selectable inside Build (higher token rate, not the free tier, not the public API). Check grok --version and /release-notes after you install — alpha and enterprise channels move ahead of stable.
Install on Windows (PowerShell)
Open PowerShell (not cmd.exe) and run the official installer:
# Run in PowerShell (Windows)
irm https://x.ai/cli/install.ps1 | iex
# Verify
grok --versionDo not paste the Linux install line (curl … | bash) into PowerShell. That script is for macOS/Linux/WSL. Use the .ps1 installer on native Windows. WSL and PowerShell installs are separate — pick one and stay consistent.
Install on macOS / Linux / WSL
curl -fsSL https://x.ai/cli/install.sh | bash
grok --versionFirst run & auth
cdinto your project root.- Run
grok— interactive TUI opens. - Complete OAuth in the browser (SuperGrok / SuperGrok Heavy / X Premium+ eligibility required depending on current rollout).
- For headless / CI: set
GROK_CODE_XAI_API_KEYfrom console.x.ai.
cd C:\Users\you\projects\my-app
grok
# Headless one-shot (CI / scripts)
grok -p "add integration tests for the auth module"Modes you will actually use
| Mode | How | When |
|---|---|---|
| Normal | Default / Shift+Tab | Everyday edits with per-file approval |
| Plan | Shift+Tab or /plan | Non-trivial features — design before code |
| Auto | /auto or Shift+Tab | Classifier approves safe calls; dangerous ones still prompt |
| Always-approve | /always-approve, Ctrl+O, or grok --always-approve | Skips prompts. Deny rules and hooks still apply. Do not leave it on. |
| Headless | grok -p "…" | Scripts, CI, batch refactors |
Plan mode (the professional default)
For complex work, start in plan mode. The agent writes a structured design document (background, constraints, approach options, risks, validation). You can approve, comment on steps, or rewrite before any file changes. After approval, every edit shows as a clean diff.
/plan Add a multi-tenant billing module with Stripe webhooks,
feature flags per org, and migration path from the legacy plan table.
Constraints: no downtime, TypeScript strict, existing Prisma schema.Plan mode is where /design energy lives for architecture. For visual UI craft specifically, continue to the design chapter.
Subagents & worktrees
Large tasks fan out to specialized subagents in parallel. With worktree isolation, agents can edit in separate git worktrees so experiments do not clobber each other. Use this for:
- Frontend + backend + tests in parallel
- Exploring two implementation options side by side
- Long research (docs scrape) while coding continues
Essential slash commands
| Command | What it does |
|---|---|
| /plan [task] | Plan doc; approve, comment, or quit before edits |
| /view-plan | Reopen the current plan |
| /goal | Start the goal planner |
| /design … | Design skill — see the /design chapter |
| /effort | Reasoning effort on the active model |
| /context-window | Pick a context size when the model offers one |
| /model | Switch model; window choices, then effort |
| /auto | Toggle classifier auto-approval |
| /always-approve | Toggle always-approve (deny rules and hooks still win) |
| /create-workflow | Author and save a workflow |
| /workflow | Launch, pause, resume, stop. Bare command lists runs |
| /workflows | Workflow catalog |
| /deep-research | Background research workflow |
| /loop [interval] | Recurring prompt. Auto-expires (7 days) unless you stop it |
| /tasks | Background tasks, subagents, scheduled work |
| /imagine | Inline image |
| /imagine-video | Inline video; Enter opens a player if the terminal cannot |
| /memory | Browse memories. /remember, /dream, /flush |
| /compact | Compact history. /context shows usage |
| /rewind | Restore files and chat to an earlier turn (/undo) |
| /fork | Branch this session into a peer agent |
| /theme | GrokNight, GrokDay, TokyoNight, RosePineMoon, OscuraMidnight, or auto |
| /mcps | MCP tab. Token files are re-read on every request |
| /hooks | Hooks tab. /plugins, /skills, /marketplace are the same modal |
| /docs | How-to guides. /doctor checks terminal, tmux, clipboard |
| /btw | Side question without derailing the turn |
| grok inspect | What actually loaded: skills, hooks, MCP, AGENTS.md |
| grok -p | Headless one-shot for CI |
Skills, plugins, hooks, MCP
Grok Build discovers instructions from your repo and home directory:
AGENTS.md/CLAUDE.md— project instructions (Claude-format skills are recognized for migration)..grok/skills/or~/.grok/skills/— reusable playbooks invoked as/skill-name.- Plugins via
grok plugin install <name> --trustand/plugin. - Hooks for pre/post tool events (team policy, formatting).
- MCP servers for external tools (email, issue trackers, etc.).
- ACP for building your own orchestrators and bots.
grok inspect
# Shows skills, plugins, hooks, MCP servers, instruction filesRecommended PowerShell daily workflow
- Open project:
cd path\to\repo - Start agent:
grok - For any multi-file feature:
/plan …or cycle to Plan with Shift+Tab. - For UI work:
/designwith screenshots/refs if you have them. - Review diffs; keep auto-approve off until you trust the repo pattern.
- Commit yourself after a green test run — you stay the release manager.
Automation & headless
$env:GROK_CODE_XAI_API_KEY = "xai-..."
grok -p "run the test suite, fix failures only, do not refactor unrelated code"Headless mode is ideal for nightly refactors, dependency upgrades with auto-fix loops, and PR bots. Keep prompts narrow and assert exit criteria (“tests must pass”, “no package.json version bumps”).
Pair CLI Build with local git + your own deploy pipeline (Hostinger Cloud Startup, Vercel, etc.). The browser is for chat, connectors, and Automations. Grok Bot owns work that must keep running. Full matrix on Browser vs CLI vs Bot.