Skip to content

Appendix

Cheatsheet · Grok CLI (xAI)

Structural reference, not a tutorial — dense, lookup-first. This is the newest, fastest- moving tool in the matrix; treat every command below as a…

Structural reference, not a tutorial — dense, lookup-first. This is the newest, fastest- moving tool in the matrix; treat every command below as a starting point and confirm against xAI's live docs before relying on it for anything unattended.

Install & entry points

CommandDoes
grokinteractive terminal session in the current directory
grok "<prompt>" / a one-shot flagheadless invocation — the primitive to wrap for a loop
model selection flagpin a specific Grok model for the session

Config file shapes

FileRole
a project rules file (check current docs for the exact filename xAI's tooling reads)context layer — same role as CLAUDE.md/AGENTS.md
MCP server configconnector declarations, where supported

The loop primitives

Grok CLI, like OpenCode, leans on external scheduling rather than a built-in /loop:

MechanismShape
A capped shell wrapperconditional/run-until-done, identical pattern to the OpenCode cheatsheet
Cron / CI invoking the CLI headlesslythe unattended-schedule shape
Platform-level agent/task features (where offered)check current docs — this is the fastest-moving part of the matrix

Permissions & harness guarantees

DirectiveEffect
Tool/action approval settingsgate which actions run without confirmation — verify the current default before your first unattended run
Sandboxing (where offered)isolates shell/file access from the rest of your machine

Until you've read the current release notes for your installed version, assume the conservative default: treat every action as requiring approval, and earn autonomy the same way this course teaches for every tool — a proven L1 history first.

Gotchas

  • This is the tool most likely to have a stale cheatsheet the day you read it — verify the approval/permission model against the live docs before your first unattended run, every time, not just once.
  • The same universal rules still apply regardless of what's changed underneath: guarantees belong in the harness, not the prompt; a stop condition is a spec, not a feeling; and the spine is a file, never the model's memory.

Sources: this cheatsheet is original reference material for this course, written per the attribution policy's rule that tool mechanics are framed as pointers to live documentation rather than authoritative references — mechanics here change weekly. Live reference: docs.x.ai. Cross-referenced against this course's tool-agnostic rules in safety.md and the four layers. Full attribution: resources/sources.md.