Grok CLI Manual

Grok Hub

Install Grok CLI, connect it to ZAI Router, then learn Grok Imagine image and video generation, permissions, sessions, worktrees, and API usage step by step.

Grok by xAI

This practical manual covers Grok CLI and Grok API access through ZAI Router. Complete installation and configuration first, then try image generation, editing, video generation, and one small, verifiable task.

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. Generate and edit images with /imagine, image tools, or the Images API.
  5. Generate, poll, and save videos with /imagine-video or the Videos API.
  6. Complete one verifiable task in a real project.
  7. Move on to session resume, worktrees, structured output, and MCP.

Sources checked on 2026-08-16: the official xAI Grok Build documentation, Grok 4.6 and Grok Imagine model information, the local Grok CLI, and the ZAI Router forwarding path.