← ClaudeAtlas

grok-cli-runtimelisted

Internal helper contract for calling the polycli companion runtime for Grok (xAI Grok Build CLI) from Claude Code
bbingz/polycli · ★ 0 · Code & Development · score 68
Install: claude install-skill bbingz/polycli
# grok-cli-runtime polycli wraps the local **Grok Build** CLI (`grok`, xAI; v0.2.x verified). Call it through the polycli companion (`/polycli:ask|rescue|review --provider grok`), never by spawning `grok` directly. The runtime contract (`packages/polycli-runtime/src/grok.js`) is authoritative; this is a summary. ## Invocation shape - One-shot, non-interactive: `grok -p <prompt> --output-format <json|streaming-json>`. `-p` prints the answer and exits. Unlike kimi-code, `-p` composes with the flags below (verified). - `--output-format json` → a single object `{text, stopReason, sessionId, requestId, thought}` (used for `ask`/`rescue`/`review`). `--output-format streaming-json` → line events `{type:"thought",data}` (reasoning) / `{type:"text",data}` (answer) / `{type:"end",stopReason,sessionId,requestId}`. - Model: `-m <model>`. Available: `grok-composer-2.5-fast` (default; "Compose 2.5") and `grok-build`. - Effort: grok accepts `--effort low|medium|high|xhigh|max` natively; polycli's `--effort` is gemini-only and is **not** forwarded to grok. - **YOLO** (ask/rescue): `--always-approve`. **Review** read-only: `--permission-mode plan`. - Resume: `--resume <id>` / `-r <id>` (resume a session), `-c` / `--continue` (last for cwd). ## Gotchas - **stderr noise on success**: grok prints transient `ERROR worker quit ... UnexpectedContentType` lines to stderr even on a successful run. Success is judged ONLY by exit 0 + a valid stdout JSON envelope with visible text — stderr