Short answer
Install Grok CLI with omarchy pkg add grok-cli, then cd into a project and run grok. First launch opens your browser to sign in with your xAI account; on a remote machine use grok login --device-auth instead.
Grok CLI on Omarchy
Grok Build (grok-cli) on Omarchy is xAI's terminal coding agent: a TUI that reads, edits, and tests code in your project, powered by Grok 4.7, with headless and ACP modes for scripts and editors.
Not grok-bot. The grok-bot package is a different xAI product: a desktop always-on agent with a persistent cloud VM, a browser, and a filesystem of its own. This guide covers grok-cli, the terminal coding agent, command grok. If you want the always-on desktop agent, see the grok-bot guide instead.
TL;DR
omarchy pkg add grok-cli
Then cd ~/my-project and run grok. That installs Grok Build v1.0.92-1 (78.9 MB download, 208.5 MB installed, Apache-2.0). On first launch it opens your browser to sign in with your xAI account and keeps you signed in after that. Then describe what you want done.
Getting started (5 minutes)
1. Launch and sign in.
Change into a project folder and run grok. The first launch opens browser authentication automatically; you can also start it yourself with grok login. It prints a URL and a confirmation code to verify in your browser, then reports once you are signed in. On a remote machine with no browser, use grok login --device-auth instead. For scripts or CI, set an XAI_API_KEY from console.x.ai in the environment before launching. To sign out and wipe cached credentials, run grok logout.
2. Start with a read-only question.
Try: "Explain this repo." Grok reads the files it needs, shows each step as it runs, and answers with a summary of the codebase. Once you see that, the install, the sign-in, and the project are all working. Then point it at a file with @, for example @src/main.rs Walk me through this file. You do not need a git repo; unlike some agents, Grok runs fine outside a git directory.
3. Three things worth doing in the first session:
- Check which billing bucket you are on. Signing in with an API key spends from a different bucket than signing in through your browser, so run
/usageinside Grok and check the billing account tied to whichever sign-in method you chose. The free tier has limited Grok Build access; paid plans share one weekly usage pool across Grok and Cursor. - Keep it updated. One command updates Grok for both interactive and headless use:
grok update. Check for a newer release first withgrok update --check. In automation, always pass--no-auto-update, or Grok phones home for update checks and may hang where x.ai is unreachable. - Know where its files live. Settings live in
~/.grok/config.toml, the login in~/.grok/auth.json, and sessions under~/.grok. Grok readsAGENTS.md, skills, plugins, hooks, and MCP servers from the project, and it works through the Agent Client Protocol (ACP) in editors that support it, including a community VS Code extension.
Common issues & fixes
After installing, your shell says grok: command not found
The installer puts the binary in ~/.grok/bin/grok, and your shell only picks it up in a new terminal.
Fix: Open a fresh terminal window and try again, and confirm ~/.grok/bin is on your PATH. Do not grab an unrelated package just because its binary has the same name. (xAI Grok Build docs, Grok Build cheat sheet)
Browser sign-in fails, or the login loop never completes
The login loop never completes, or the browser sign-in fails partway through.
Fix: Run grok logout to clear the cached credentials, then grok login again. On a remote machine where opening a local browser is awkward, use device-code authentication: grok login --device-auth, which prints a URL and a code to approve on another device. (Grok Build cheat sheet)
Usage is billed to the wrong account, or you hit a limit you did not expect
The two sign-in paths bill separately, and a stored login takes precedence over an API key.
Fix: Browser login spends from your X Subscription usage pool; an XAI_API_KEY spends from your xAI API account at per-token rates (Grok 4.7 is listed at $2.00 per million input tokens and $6.00 per million output tokens). A stored login also takes precedence over the API key, so if you want the key to be used, sign out first. Run /usage inside Grok to see which bucket you are drawing from. (Flavio Copes Grok Build guide)
Grok ignores your AGENTS.md
Your project instructions are not being picked up.
Fix: Run grok inspect. It checks the filename, the current directory, the git root, and .gitignore, which is usually where the problem is: a misspelled filename, a file in the wrong folder, or a .gitignore rule hiding it. (Grok Build cheat sheet)
An MCP server will not start, or its tools never appear
The server is configured, but Grok never shows its tools.
Fix: Run grok mcp doctor <name> to diagnose that server, test the server command directly in your shell, and inspect the log at ~/.grok/logs/mcp/<server>.stderr.log. Most failures are a wrong command path or missing environment variable in the server entry, not a Grok bug. (Grok Build cheat sheet)
Pairs well with / If you hate this, try
Pairs well with
- git (review diffs before committing), the Grok Build Community Edition VS Code extension (chat, tools, diffs, and sessions in the editor while the agent runs as
grok agent stdio), and anXAI_API_KEYfor CI runs where browser login cannot work.
If you hate this, try
- Claude Code (Pro $20/mo) if you want simpler subscription billing,
kimi-code(Kimi Code CLI) for per-token API billing with no subscription, or Kilo Code CLI to bring any provider or a local model — if you hate the X Subscription billing.
Comparison: Grok CLI vs Claude Code vs Kimi Code CLI vs Devin CLI
| grok-cli | Claude Code (CLI) | Kimi Code CLI | Devin CLI | |
|---|---|---|---|---|
| Price | Free tier $0 (limited); X Subscription Plus $8/mo, Premium $30/mo, Super $100/mo, Ultra $200/mo; or pay-per-token API | Requires Claude Pro $20/mo+ | Free CLI; Kimi membership from $15/mo or per-token API billing | Free tier $0; Pro $20/mo; Max $200/mo |
| Best for | xAI's Grok 4.7 as a terminal agent, with headless and ACP modes | The strongest single-vendor models, no key juggling | A fast single-binary TUI with subagents and MCP | An agent that can hand a task to the cloud and return a PR |
| Omarchy install | omarchy pkg add grok-cli | npm install -g @anthropic-ai/claude-code | omarchy pkg add kimi-code | omarchy pkg add devin-cli |
Verdict: Pick Grok CLI if you already pay for an X Subscription and want Grok 4.7 in your terminal, or if you want a free tier to try a terminal agent. Pick Claude Code if you want the strongest single-vendor models, and Kimi Code CLI if you want per-token billing with no subscription.
How to switch from Claude Code (~15 minutes per project)
- Export from Claude Code: your project instructions already live in
CLAUDE.md. Grok readsAGENTS.md; copy the contents across or let Grok generate one from the codebase. - Import into Grok: add MCP servers through Grok's config, and skills into the project the same way you would for any agent that reads
AGENTS.md. - What doesn't transfer: chat history, Claude-specific slash commands, and Claude Code's GitHub Actions integration.
- Time estimate: about 15 minutes per project.
Open the Grok CLI package
See the live version, upstream screenshot, requirements, source and exact Omarchy install command.
Frequently asked questions
What is the difference between grok-cli and grok-bot?
They are two different xAI products. grok-cli is Grok Build, a terminal coding agent you run with the grok command in a project folder. grok-bot is a desktop always-on agent: each Bot gets a persistent cloud virtual machine with its own browser, filesystem, and terminal. This guide covers grok-cli only.
Is Grok Build free?
There is a free tier with limited Grok Build access. For more usage, the X Subscription plans start at Plus $8/mo, then Premium $30/mo, Super $100/mo, and Ultra $200/mo. You can also pay per token with an XAI_API_KEY instead of a subscription.
What model does it run?
Grok 4.7, according to the Grok Build overview. The same model family is also available through xAI's API.
Do I need Node.js?
No. The native installer does not depend on Node.js, and the Omarchy package installs a binary. Node.js only matters if your own project needs it.
Where does Grok Build store its config?
Settings live in ~/.grok/config.toml, the login in ~/.grok/auth.json, and sessions under ~/.grok. The installer places the binary in ~/.grok/bin/grok.
Can I run it without the TUI?
Yes. grok -p "your prompt" runs headless for scripts and bots, and ACP mode lets editors drive it directly.
Official sources
- Omarchy package listing (v1.0.92-1, Apache-2.0, 78.9 MB download / 208.5 MB installed, updated 2026-11-23)
- Grok Build docs (install, sign in, device auth, API key, config, update)
- Grok Build tutorial (sign-in methods, /usage billing buckets, update, first task)
- Grok Build cheat sheet (command not found, login loop, AGENTS.md, MCP doctor, logs)
- Grok Build in Docker (binary and config paths, --device-auth, XAI_API_KEY precedence)
- Grok pricing, X Subscription plans and API rates, checked October 25, 2026
- Grok Build Community Edition extension (auth, binary path, config)
- grok-bot package listing, for the grok-cli vs grok-bot distinction (v1.3.0-1, desktop always-on agent, persistent cloud VM)
Commands and fixes verified against official sources November 2026; on-machine verification pending.