grok

Delegate coding tasks to the xAI Grok Build CLI via headless or interactive terminal sessions.

1|Updated Feb 17, 2026
One-click install
npx skills add https://github.com/brittb-dev/zerogravityclaw --skill grok-brittb-dev
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: grok
Source: https://github.com/brittb-dev/zerogravityclaw/tree/main/src/hermes-core/optional-skills/autonomous-ai-agents/grok
Command: npx skills add https://github.com/brittb-dev/zerogravityclaw --skill grok-brittb-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @xai-official/grok.

What problem does it solve? Orchestrating an autonomous coding agent from an AI assistant requires knowing the right invocation modes, auth setup, and flags. This Skill provides a complete operational guide for delegating coding work to xAI's Grok Build CLI without trial-and-error. ## Core Features & Use Cases - Headless One-Shot Execution: Run single coding tasks with grok -p, structured JSON output, and --always-approve for autonomous writes. - Interactive TUI Orchestration: Drive multi-turn Grok sessions through tmux with capture-pane monitoring. - PR Reviews and Parallel Issue Fixing: Review diffs in cloned temp repos and fix multiple issues concurrently using git worktrees. - Use Case: Ask the agent to refactor a database layer in the background while you continue other work, then resume the named session later to add connection pooling. ## Quick Start Use the grok skill to run a headless task that adds a dark mode toggle to the settings page of my project.

Frequently Asked Questions about grok

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Grok CLI headless for a one-shot coding task?▼

Run grok with the -p flag followed by your prompt, plus --no-auto-update to skip update checks. Add --always-approve if Grok should write files autonomously, and --output-format json for parseable results.

How to install and authenticate the Grok Build CLI?▼

Install with npm install -g @xai-official/grok, which avoids the Cloudflare-walled x.ai installer host. Then run grok login once for OAuth with a SuperGrok or X Premium+ subscription; the token is cached in ~/.grok/auth.json.

Does Grok CLI require a git repository to run?▼

No, Grok runs fine outside a git directory, unlike Codex, which makes it suitable for scratch tasks. For PR or commit workflows you still want a repo, so use mktemp -d with git init for throwaway commit work.

Can Grok CLI use my existing CLAUDE.md or AGENTS.md files?▼

Yes, Grok auto-reads CLAUDE.md, the .claude/ directory including skills and MCPs, and the AGENTS.md family with zero configuration. Existing project context works immediately.

Why does my headless Grok run stall without completing?▼

Headless runs stall when tool-approval prompts appear and --always-approve was not passed. Add --always-approve for autonomous builds, or omit it deliberately only for read-only review and audit work.