Grok CLI Manual

Grok Hub

Install Grok CLI, connect it to ZAI Router, then learn permissions, sessions, headless mode, worktrees, and API usage step by step.

xAI

This practical manual covers both Grok CLI and Grok API access through ZAI Router. Complete installation and configuration first, then start with one small, verifiable task in a real project.

Recommended path:

  1. Understand what Grok CLI can do and where it runs.
  2. Install the CLI and check the current version.
  3. Configure ~/.grok/config.toml and ZAI Router.
  4. Complete one verifiable task in a real project.
  5. Move on to session resume, worktrees, structured output, and MCP.

Sources checked on 2026-07-11: the official xAI Grok Build documentation, Grok 4.5 model information, the local Grok CLI, and the ZAI Router forwarding path.