← All posts

Grok CLI in Your Terminal: Setup and Honest First Impressions

Installing xAI's Grok in the terminal, what it is fast at, where it falls short of Claude Code, and how to make it look like it belongs on your desktop.

Grok got a command line. I gave it a week of real work, mixed in with the agents I already run, and this is what I found.

Fair warning up front: this space moves fast and some of what follows will age. Where I am unsure I say so instead of guessing.

What "Grok CLI" actually means

There are two things people mean by the phrase, and confusing them wastes an afternoon.

There is xAI's own tooling, shipped by xAI against their API. And there are community CLIs, most visibly the open source grok-cli on npm, which wrap the same API in a terminal agent with file editing and shell access. Both talk to the same models. The community one has been around longer and is what most search results land on.

Either way, the model is the product and the CLI is a client. Check which one you installed before you file a bug, because the two have completely different issue trackers.

Setup

You need an API key from the xAI console. Create one, fund the account, then export it.

export XAI_API_KEY="xai-..."

Put that in your shell profile, not in a project file. Then install:

npm install -g @vibe-kit/grok-cli

Package names shift as these projects rename themselves, so if that fails, search npm for the current one rather than trusting a blog post from three months ago, including this one. Then run it in a project:

cd ~/code/myapp
grok

First run drops you into a TUI. It reads your working directory, and like every agent in this category it will ask before editing files until you tell it not to.

Model selection is a flag or a config key depending on the client:

grok --model grok-code-fast-1

xAI publishes a fast coding-tuned model and a larger general reasoning model, and the exact names have changed at least twice. Run whatever --help or the docs list today. The pattern is stable even when the strings are not: one cheap and quick, one slower and smarter.

You can also point other agents at the xAI API, since it exposes an OpenAI-compatible endpoint. If you already have a tool you like, that is often the better path than adding another CLI.

What it is genuinely good at

Speed. This is the headline and it is real. The coding-tuned model returns first tokens fast and finishes short tasks noticeably quicker than the frontier models I normally use. For "rename this across the module," "write the test for this function," "explain what this regex does," the latency difference changes how you use it. You stop batching questions because asking is cheap.

Cost per task on mechanical work. Fast small models are cheaper, and a lot of daily coding is mechanical. Using an expensive model for a mechanical sweep is a habit worth breaking regardless of which vendor you pick.

Being current. Grok's connection to live information is its differentiator elsewhere, and it shows up here in a narrow but useful way: it is less likely to confidently describe a library API as it existed two years ago. Not immune. Just better than I expected.

Directness. It hedges less. Sometimes that is refreshing and sometimes it is exactly the problem, which brings us to the other column.

Where it falls short

Long autonomous runs. This is the gap. On a forty-minute multi-file task, Claude Code holds the thread: it rereads what it wrote, notices its own contradictions, asks when the spec is ambiguous. Grok CLI drifts sooner. It is more likely to keep going on an assumption instead of stopping to check, and an assumption compounded over twenty tool calls is expensive to unwind.

Calibration. It is confident when it is wrong at a higher rate than Claude Code is. For a code review agent that is a real cost, because the whole value of review is flagging the thing you were not sure about.

Ecosystem depth. Claude Code has hooks, subagents, MCP servers, and project instruction files, and Codex has OpenAI's tooling behind it. The Grok clients are younger and thinner. If your workflow depends on custom hooks, you are rebuilding it.

Docs churn. Flags, package names, and model strings have all moved. Not disqualifying, but budget for the fact that a tutorial from last quarter may be wrong in the details.

How it compares

Against Claude Code: Claude Code wins on anything long, ambiguous, or high-stakes. Grok wins on latency and cost for short well-specified tasks. I have not found a task where Grok produces a better hard-problem answer, and I looked.

Against Codex CLI: closer than you would think. Both are quick and both are comfortable acting on a loose spec. Codex has the more mature harness. Grok is faster. See Claude Code vs Codex vs Gemini for how the other three split up.

Against Gemini CLI: Gemini's long context still wins for anything that needs the agent to hold a large codebase at once. Grok is the faster iterator. Gemini CLI vs Codex CLI covers that pairing in detail.

The routing rule I ended up with: Grok for the quick stuff, Claude Code for the hard stuff. Which is a good outcome for a tool that is a fraction of the cost on the quick stuff.

Making it look right

Grok CLI, like every agent in this category, renders into whatever colors your terminal gives it. It is a full-window TUI with no theme of its own worth speaking of. So the visual experience is entirely your terminal's job.

Two things matter more than they sound like they should when you run several agents.

Telling sessions apart. Three TUIs that all render as green text on black are three tabs you have to read to identify. Giving each agent its own color scheme turns identification into a glance.

Knowing when it wants you. Grok is fast, which paradoxically makes this worse. It finishes while you are looking at another window, and then sits there done while you work on something else for four minutes.

This is what MOLTamp is for. Each session gets a tab, tabs adopt whatever title the agent sets, and per-tab badges glow amber when an agent is waiting on input and green when it finishes unfocused. Run Grok next to Claude Code in different skins and the difference is immediate. The skinning docs cover building your own, and the community marketplace has a pile of skins already made.

Verdict

Worth installing. Not worth switching to.

Grok CLI is a good fast second agent and a bad only agent. The speed is real and the cost story on mechanical work is real. The gap on long, ambiguous, high-stakes tasks is also real, and that is where I spend the part of my day I actually care about.

If you already run one agent well, add this one for the quick jobs and keep your main one for the hard ones. If you are picking your first agent, pick a different one.