TA-04 · Optional agent

Grok Build

Install xAI's first-party grok coding agent — not a fake “API-only” workaround.

30–60 min · same day Needs: TA-01 + xAI access Outcome: one successful Grok run

Who this is for

People who want xAI's coding agent in the terminal. Yes, a first-party CLI exists — product name Grok Build, command grok after install. Installer from x.ai/cli / docs.x.ai/build/overview. Raw api.x.ai calls remain for people building their own loops — that's a different job.

Which machine are you on? (saved from TA-01 if you picked there)

↑ Pick one to see only your install path. (Showing all until you do.)

The emergency brake

  • Installer hangs or scrolls forever? Hold Ctrl + tap C, close the terminal, open a fresh one, try once more.
  • Scary red text? Copy the exact error — you'll need it for the fix table below or a consult. Red text is information, not damage.

OS matrix — pick your row

Compare all three OS paths (reference — your picker above already filtered the steps)
macOSWindows nativeWSL
Installcurl -fsSL https://x.ai/cli/install.sh | bashirm https://x.ai/cli/install.ps1 | iexLinux curl installer inside WSL
AuthBrowser on first grokSameBrowser, or export XAI_API_KEY=... for headless/SSH
Headlessgrok -p "Explain this codebase" (same everywhere)
installmacOS / WSL
curl -fsSL https://x.ai/cli/install.sh | bash
installWindows PowerShell
irm https://x.ai/cli/install.ps1 | iex

Install, verify, and run once

  1. Install via the matrix.
  2. cd your-project → run grok.
  3. Complete browser login or set XAI_API_KEY (get one at console.x.ai; never commit the key).
  4. First prompt: “Explain this repo.”
  5. Optional: grok -p "List the top-level folders" for non-interactive use.

Success check

  • grok launches (interactive or -p)
  • Authenticated without committing a key
  • One prompt answered about a real folder

Common failure modes

FailureFix
No browser on remote SSHgrok login --device-auth per xAI auth docs, or use an API key
Key in shell historyUse env var for the session; revoke if pasted into a ticket
Expecting “Grok” browser UI onlyThis module is the local agent — different surface

Don't buy / don't install yet

If you only need occasional Grok chat, the web/app UI may be enough — you don't owe xAI a local agent install. If you have no xAI access, skip without guilt.

Commands checked 2026-09-25 against xAI docs; if one fails, the official page wins.

Two agents working? You're done.

Seriously consider jumping to TA-07 and picking a daily driver instead of installing a third.

Book free