Grok Build CLI: Zero to Hero (Start Here)
Last updated: June 2026. Tested on Grok Build v0.2.18 (stable channel v0.2.16).
Grok Build is xAI's terminal coding agent. It runs as a full screen TUI that reads your codebase, runs shell commands, edits files, searches the web, and tracks tasks, all from the terminal. You can also run it headless for scripts and CI, or plug it into your editor over the Agent Client Protocol.
This is the hub for a whole series. Start here to get installed and productive in ten minutes, then branch into the deep dives linked at the bottom.
Install
One command on macOS, Linux, or Windows via Git Bash. Pin a version by passing it to the installer.
On native Windows, use the PowerShell installer instead. It adds the Grok binary to your PATH automatically.
First launch
Just run grok. On first launch it opens your browser to log in with grok.com, then stores credentials in ~/.grok/auth.json for about seven days. No browser, like a CI box or a remote VM? Export an XAI_API_KEY from console.x.ai and Grok uses it directly.
Your first session
Type a message and press Enter. Grok thinks, plans, and acts: reading files, running commands, editing code, all streaming into the scrollback in real time. Press Esc or Tab to move focus between the prompt and the scrollback.
To pull files into context, use the @ operator. It opens a fuzzy picker that respects your .gitignore by default. You can attach a whole file, a line range, or a directory.
Stay in control
By default Grok asks before it runs a shell command or edits a file. When you trust the task, flip into auto-approve (often called YOLO) with Ctrl+O, the --yolo flag, or /yolo. Read-only commands like ls, cat, and git status never prompt, so the approvals you do see are the ones that matter.
The mental model
Four ideas carry the whole tool:
- Sessions are your conversations. They persist to disk automatically and can be resumed, rewound, or shared.
- Tools are what Grok can do: read and edit files, run bash, grep, search the web, write todos, spawn subagents. Extend them with MCP servers.
- Slash commands are quick actions. Type / to see them. Skills you install show up here too.
- Project rules live in an AGENTS.md file and teach Grok your conventions once, for every future session.
Each of those is a rabbit hole worth going down. The series below takes them one at a time, from everyday ergonomics to headless automation and OS level sandboxing.
Where to go next
The full series
- Grok Build CLI: Zero to Hero (Start Here) (you are here)
- Grok Build CLI: Sessions, Rewind and Compaction
- Grok Build CLI: Slash Commands and Keyboard Mastery
- Grok Build CLI: Teaching Grok Your Project (AGENTS.md)
- Grok Build CLI: Models and Custom Endpoints
- Grok Build CLI: Extending Grok with MCP, Skills, Plugins and Hooks
- Grok Build CLI: Cross-Session Memory
- Grok Build CLI: Subagents, Plan Mode and Background Work
- Grok Build CLI: Headless Mode and Automation
- Grok Build CLI: Sandbox and Permissions
- Grok Build CLI: IDE Integration with ACP
- Grok Build CLI: The Evolution (Power-User Version History)
Follow @GrokInsider for the rest of the series.