This practical manual covers both Grok CLI and Grok API access through XAI Router. Complete installation and configuration first, then start with one small, verifiable task in a real project.
Recommended path:
- Understand what Grok CLI can do and where it runs.
- Install the CLI and check the current version.
- Configure
~/.grok/config.toml and XAI Router. - Complete one verifiable task in a real project.
- 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 XAI Router forwarding path.
1 What Is Grok CLI Understand Grok CLI modes, suitable tasks, and the XAI Router request path. 2 Download and Install Install, update, and verify Grok CLI. 3 Your First Task Open a real project and complete one small, verifiable Grok task. 4 Configuration Understand config.toml paths, models, endpoints, sessions, and UI settings. 5 Use XAI Router Connect grok-4.5 Responses with the main domain and your current XAI API Key. 6 Permissions and Safety Understand auto-approval, plan mode, allow/deny rules, and sandboxing. 7 Workflows and Troubleshooting Sessions, worktrees, self-checking, structured output, MCP, and common failures.