Grok CLI Manual

What Is Grok CLI

Grok CLI is a terminal coding agent that can understand a repository, edit files, run commands, and complete multi-step tasks.

Grok CLI, also presented as Grok Build in its interface, is xAI's terminal coding agent. It can inspect a project, edit files, run commands, search for information, and retain conversation context.

Three common modes

ModeCommandBest for
Interactive UIgrokDay-to-day development with visible progress
Single requestgrok -p "..."Scripts, CI, or tasks that need only a final result
Resumegrok --continueContinuing the latest session for the current project

Good uses

  • Explain an unfamiliar repository, locate bugs, edit code, and add tests.
  • Review diffs, diagnose build failures, and update documentation.
  • Try changes in a separate worktree without disturbing the current checkout.
  • Return JSON or JSON Schema-constrained output for another program.

Request path on this site

Grok CLI / Responses API

     XAI Router (yai)

       grok-cloud

    Grok upstream service

The CLI still runs inside your local project. XAI Router and grok-cloud handle model-request authentication, routing, protocol conversion, and upstream session maintenance.