[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GGAPQT37DKJ410F0TTSPYP":3,"skill-same:01M6GGAPQT37DKJ410F0TTSPYP":83},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":43,"linkOnly":44,"markdownContent":45,"markdownBody":46,"frontMatter":47,"refName":61,"commitSha":62,"skillDirectory":63,"forksCount":64,"repositoryHtmlUrl":65,"repositoryHomepageUrl":6,"ownerHtmlUrl":66,"ownerBlogUrl":6,"ownerDescription":67,"updatedAt":68,"install":69,"resources":82},"01M6GGAPQT37DKJ410F0TTSPYP","grok",null,"Delegate coding to xAI Grok Build CLI (features, PRs).","zapabob\u002FSkills","zapabob","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F130830376?v=4","01M6DBMYZAGRTFQDSQYW3W764P","峯岸 亮","01M6DBMZ3GKDSJ01NZ9XTZD7JD",2,"MIT","https:\u002F\u002Fgithub.com\u002Fzapabob\u002FSkills\u002Fblob\u002Fmain\u002Farchive\u002Fskill-md-reviewed\u002Fsha256\u002Fe8\u002Fe8047cc80bf73a152413d1d6dabc7908ddc242cd957ff09ba5a2860456cf52f7\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[5,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],"coding","grok build","hermes-agent","build","Coding-Agent","build cli","delegate","hermes","xai","macos","refactoring","code-review","code","windows","automation","codex","linux","cli","review","2026-11-10 10:12:30",false,"---\r\nname: grok\r\ndescription: \"Delegate coding to xAI Grok Build CLI (features, PRs).\"\r\nversion: 0.1.0\r\nauthor: Matt Maximo (MattMaximo), Hermes Agent\r\nlicense: MIT\r\nplatforms: [linux, macos, windows]\r\nmetadata:\r\n  hermes:\r\n    tags: [Coding-Agent, Grok, xAI, Code-Review, Refactoring, Automation]\r\n    related_skills: [codex, claude-code, hermes-agent]\r\n---\r\n\r\n# Grok Build CLI — Hermes Orchestration Guide\r\n\r\nDelegate coding tasks to [Grok Build](https:\u002F\u002Fdocs.x.ai\u002Fbuild\u002Foverview) (xAI's\r\nautonomous coding agent CLI, the `grok` command) via the Hermes terminal. Grok\r\ncan read files, write code, run shell commands, spawn subagents, and manage git\r\nworkflows. It runs three ways: an interactive TUI, **headless** (`-p`), and as\r\nan **ACP agent** over JSON-RPC.\r\n\r\nThis is the third sibling to `codex` and `claude-code`. The orchestration\r\npattern is nearly identical — **prefer headless `-p` for one-shots**, use a PTY\r\nfor interactive sessions.\r\n\r\n## When to use\r\n\r\n- Building features\r\n- Refactoring\r\n- PR reviews\r\n- Batch issue fixing\r\n- Any task where you'd otherwise reach for Codex \u002F Claude Code but want Grok\r\n\r\n## Prerequisites\r\n\r\n- **Install (preferred):** `npm install -g @xai-official\u002Fgrok`\r\n  - The official installer `curl -fsSL https:\u002F\u002Fx.ai\u002Fcli\u002Finstall.sh | bash` also\r\n    works, but the `x.ai` host is Cloudflare-walled in some environments. The\r\n    npm path avoids that dependency entirely.\r\n- **Auth — SuperGrok \u002F X Premium+ subscription (primary path):**\r\n  - Run `grok login` once → opens a browser for OAuth → token cached in\r\n    `~\u002F.grok\u002Fauth.json`. This uses your **SuperGrok or X Premium+** subscription\r\n    (no per-token API billing).\r\n  - Check sign-in state by looking for `~\u002F.grok\u002Fauth.json`, or run a cheap\r\n    headless smoke test: `grok --no-auto-update -p \"Say ok.\"`\r\n  - In the TUI, `\u002Flogout` signs out and `\u002Flogin` (or relaunching) signs back in.\r\n- **No git repo required** — unlike Codex, Grok runs fine outside a git\r\n  directory (good for scratch\u002Fthrowaway tasks).\r\n- **Claude Code \u002F AGENTS.md compatible with zero config** — Grok auto-reads\r\n  `CLAUDE.md`, `.claude\u002F` (skills, agents, MCPs, hooks, rules), and the\r\n  `AGENTS.md` family. Existing project context just works.\r\n\r\n> **API-key fallback (not the default for this user):** Grok also supports\r\n> setting the `XAI_API_KEY` environment variable for pay-as-you-go billing\r\n> via `api.x.ai`. Only use\r\n> this if `grok login` \u002F SuperGrok auth is unavailable. The subscription path\r\n> (`grok login`) is the intended setup here.\r\n\r\n## Two Orchestration Modes\r\n\r\n### Mode 1: Headless (`-p`) — Non-Interactive (PREFERRED)\r\n\r\nRuns a one-shot task, prints the result, and exits. No PTY, no interactive\r\ndialogs to navigate. This is the cleanest integration path — the analog of\r\n`claude -p` and `codex exec`.\r\n\r\n```\r\nterminal(command=\"grok --no-auto-update -p 'Add a dark mode toggle to settings'\", workdir=\"\u002Fpath\u002Fto\u002Fproject\", timeout=180)\r\n```\r\n\r\nAlways pass `--no-auto-update` in automation to skip background update checks.\r\n\r\n**When to use headless:**\r\n- One-shot coding tasks (fix a bug, add a feature, refactor)\r\n- CI\u002FCD automation and scripting\r\n- Structured output parsing with `--output-format json`\r\n- Any task that doesn't need multi-turn conversation\r\n\r\n### Mode 2: Interactive PTY — Multi-Turn TUI Sessions\r\n\r\nThe TUI is a fullscreen, mouse-interactive app. Drive it with `pty=true`. For\r\nrobust monitoring\u002Finput use tmux (same pattern as the `claude-code` skill).\r\n\r\n```\r\n# Launch in a tmux session for capture-pane monitoring\r\nterminal(command=\"tmux new-session -d -s grok-work -x 140 -y 40\")\r\nterminal(command=\"tmux send-keys -t grok-work 'cd \u002Fpath\u002Fto\u002Fproject && grok' Enter\")\r\n\r\n# Wait for startup, then send a task\r\nterminal(command=\"sleep 5 && tmux send-keys -t grok-work 'Refactor the auth module to use JWT' Enter\")\r\n\r\n# Monitor progress\r\nterminal(command=\"sleep 15 && tmux capture-pane -t grok-work -p -S -50\")\r\n\r\n# Exit when done\r\nterminal(command=\"tmux send-keys -t grok-work '\u002Fquit' Enter && sleep 1 && tmux kill-session -t grok-work\")\r\n```\r\n\r\n**Tip for headless-but-inline output:** if you want TUI-style output without the\r\nfullscreen alt-screen takeover (e.g. for cleaner logs), add `--no-alt-screen`.\r\nFor pure automation, headless `-p` is still cleaner than the TUI.\r\n\r\n## Headless Deep Dive\r\n\r\n### Common Flags\r\n\r\n| Flag | Effect |\r\n|------|--------|\r\n| `-p, --single \u003CPROMPT>` | Send one prompt, run headless, exit |\r\n| `-m, --model \u003CMODEL>` | Choose a model |\r\n| `-s, --session-id \u003CID>` | Create or resume a named headless session |\r\n| `-r, --resume \u003CID>` | Resume an existing session |\r\n| `-c, --continue` | Continue the most recent session in the current directory |\r\n| `--cwd \u003CPATH>` | Set the working directory |\r\n| `--output-format \u003CFMT>` | `plain` (default), `json`, or `streaming-json` |\r\n| `--always-approve` | Auto-approve all tool executions (the `--full-auto` \u002F `--yolo` equivalent) |\r\n| `--no-alt-screen` | Run inline, no fullscreen TUI takeover |\r\n| `--no-auto-update` | Skip background update checks (use in all automation) |\r\n\r\n### Output Formats\r\n\r\n- `plain` — human-readable text (default)\r\n- `json` — one JSON object at the end of the run (parse the result cleanly)\r\n- `streaming-json` — newline-delimited JSON events as they arrive\r\n\r\n```\r\n# Structured result for parsing\r\nterminal(command=\"grok --no-auto-update -p 'List all TODO comments in src\u002F' --output-format json\", workdir=\"\u002Fproject\", timeout=120)\r\n\r\n# Auto-approve for autonomous building\r\nterminal(command=\"grok --no-auto-update --always-approve -p 'Refactor the database layer and run the tests'\", workdir=\"\u002Fproject\", timeout=300)\r\n```\r\n\r\n### Background Mode (Long Tasks)\r\n\r\n```\r\n# Start headless in background\r\nterminal(command=\"grok --no-auto-update --always-approve -p 'Refactor the auth module'\", workdir=\"\u002Fproject\", background=true, notify_on_complete=true)\r\n# Returns session_id\r\n\r\n# Monitor\r\nprocess(action=\"poll\", session_id=\"\u003Cid>\")\r\nprocess(action=\"log\", session_id=\"\u003Cid>\")\r\n\r\n# Kill if needed\r\nprocess(action=\"kill\", session_id=\"\u003Cid>\")\r\n```\r\n\r\nFor an interactive (TUI) background session, use `pty=true` + tmux and monitor\r\nwith `tmux capture-pane`, exactly like the `claude-code` \u002F `codex` skills.\r\n\r\n### Session Continuation\r\n\r\n```\r\n# Start a named session\r\nterminal(command=\"grok --no-auto-update -s refactor-db -p 'Start refactoring the database layer' --always-approve\", workdir=\"\u002Fproject\", timeout=240)\r\n\r\n# Resume it later\r\nterminal(command=\"grok --no-auto-update -r refactor-db -p 'Now add connection pooling' --always-approve\", workdir=\"\u002Fproject\", timeout=180)\r\n\r\n# Or continue the most recent session in this directory\r\nterminal(command=\"grok --no-auto-update -c -p 'What did you change last time?'\", workdir=\"\u002Fproject\", timeout=60)\r\n```\r\n\r\n## Read-Only Audit → Markdown Note Pattern\r\n\r\nTo have Grok review local artifacts and return a clean markdown note (for\r\nObsidian or a repo) without mutating anything:\r\n\r\n1. Prepare stable input files first with Hermes tools (`read_file`,\r\n   `write_file`). Snapshot only the relevant context into a temp file rather\r\n   than dumping raw paths.\r\n2. Run Grok headless **without** `--always-approve` so it cannot auto-write, and\r\n   demand `markdown only, no preamble`.\r\n3. Save Grok's stdout straight into the destination note with `write_file()`.\r\n\r\n```\r\ngrok --no-auto-update -p \"Read \u002Ftmp\u002Fcurrent.md and \u002Ftmp\u002Finventory.md. Produce markdown only, no preamble. Output a clean note titled 'Cleanup Review'.\" --output-format plain\r\n```\r\n\r\n**Pitfall (same as Claude Code):** for document rewrites, a loose \"rewrite this\"\r\nprompt may return a change summary instead of the full file. Instead: pipe the\r\nfile in, and demand `Return ONLY the full revised markdown document. No intro,\r\nno explanation, no code fences. Start immediately with '# Title'.` Verify the\r\nfirst lines with `read_file()` before overwriting the destination.\r\n\r\n## PR Review Patterns\r\n\r\n### Quick Review (Headless)\r\n\r\n```\r\nterminal(command=\"cd \u002Fpath\u002Fto\u002Frepo && git diff main...feature-branch | grok --no-auto-update -p 'Review this diff for bugs, security issues, and style problems. Be thorough.'\", timeout=120)\r\n```\r\n\r\n### Clone-to-temp Review (safe, no repo mutation)\r\n\r\n```\r\nterminal(command=\"REVIEW=$(mktemp -d) && git clone https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo.git $REVIEW && cd $REVIEW && gh pr checkout 42 && grok --no-auto-update -p 'Review the changes vs origin\u002Fmain. Check bugs, security, race conditions, missing tests.'\", pty=true, timeout=300)\r\n```\r\n\r\n### Post the review\r\n\r\n```\r\nterminal(command=\"gh pr comment 42 --body '\u003Creview text>'\", workdir=\"\u002Fpath\u002Fto\u002Frepo\")\r\n```\r\n\r\n## Parallel Issue Fixing with Worktrees\r\n\r\n```\r\n# Create worktrees\r\nterminal(command=\"git worktree add -b fix\u002Fissue-78 \u002Ftmp\u002Fissue-78 main\", workdir=\"~\u002Fproject\")\r\nterminal(command=\"git worktree add -b fix\u002Fissue-99 \u002Ftmp\u002Fissue-99 main\", workdir=\"~\u002Fproject\")\r\n\r\n# Launch Grok headless in each (background)\r\nterminal(command=\"grok --no-auto-update --always-approve -p 'Fix issue #78: \u003Cdescription>. Commit when done.'\", workdir=\"\u002Ftmp\u002Fissue-78\", background=true, notify_on_complete=true)\r\nterminal(command=\"grok --no-auto-update --always-approve -p 'Fix issue #99: \u003Cdescription>. Commit when done.'\", workdir=\"\u002Ftmp\u002Fissue-99\", background=true, notify_on_complete=true)\r\n\r\n# Monitor\r\nprocess(action=\"list\")\r\n\r\n# After completion: push and open PRs\r\nterminal(command=\"cd \u002Ftmp\u002Fissue-78 && git push -u origin fix\u002Fissue-78\")\r\nterminal(command=\"gh pr create --repo user\u002Frepo --head fix\u002Fissue-78 --title 'fix: ...' --body '...'\")\r\n\r\n# Cleanup\r\nterminal(command=\"git worktree remove \u002Ftmp\u002Fissue-78\", workdir=\"~\u002Fproject\")\r\n```\r\n\r\n## Useful Subcommands & TUI Commands\r\n\r\n| Command | Purpose |\r\n|---------|---------|\r\n| `grok` | Start the interactive TUI |\r\n| `grok -p \"query\"` | Headless one-shot |\r\n| `grok login` \u002F `grok logout` | Sign in \u002F out (SuperGrok \u002F X Premium+ OAuth) |\r\n| `grok inspect` | Show what Grok discovered in cwd: config sources, instructions, skills, plugins, hooks, MCP servers |\r\n| `grok agent stdio` | Run as an ACP agent over JSON-RPC (for IDE\u002Ftool integration) |\r\n| `grok update` | Update the CLI (needs the `x.ai` host; skip in automation) |\r\n\r\nTUI slash commands (interactive only): `\u002Fmodel \u003Cname>`, `\u002Falways-approve`,\r\n`\u002Fplan`, `\u002Fcontext`, `\u002Fcompact`, `\u002Fresume`, `\u002Fsessions`, `\u002Ffork`, `\u002Fusage`,\r\n`\u002Fquit`. `Shift+Tab` cycles session modes (including Plan mode, which blocks\r\nwrite tools except the session plan file).\r\n\r\n## Config (`~\u002F.grok\u002Fconfig.toml`)\r\n\r\n```toml\r\n[cli]\r\nauto_update = false          # skip background update checks persistently\r\n\r\n[ui]\r\npermission_mode = \"ask\"      # or \"always-approve\" to skip tool prompts by default\r\n\r\n[models]\r\ndefault = \"grok-build-0.1\"\r\n```\r\n\r\nPut global preferences in `~\u002F.grok\u002Fconfig.toml` (not project-scoped\r\n`.grok\u002Fconfig.toml`). `permission_mode` supersedes the legacy `approval_mode` \u002F\r\n`yolo = true` keys.\r\n\r\n- See `references\u002Fhermes-orchestration.md` for the Hermes↔Grok handoff pattern when Hermes-only tools like `x_search` are needed.\r\n\r\n## Pitfalls & Gotchas\r\n\r\n1. **Auth is subscription-gated.** `grok login` requires a SuperGrok or X\r\n   Premium+ subscription. If login fails or there's no `~\u002F.grok\u002Fauth.json`,\r\n   confirm the subscription is active before falling back to `XAI_API_KEY`.\r\n3. **Don't conflate Hermes' xAI auth with the `grok` CLI's auth.** Hermes'\r\n   `x_search` runs on its own xAI OAuth; the standalone `grok` CLI has a\r\n   separate token in `~\u002F.grok\u002Fauth.json`. A working `x_search` does NOT mean\r\n   `grok` is logged in.\r\n4. **Use Hermes as the orchestrator when Hermes-only tools are needed.**\r\n   Grok is for coding\u002Freview\u002FPR work; if the task needs Hermes-only tools such\r\n   as `x_search`, have Hermes gather the data first, then hand the grounded\r\n   context to Grok for implementation or drafting. Grok should not be treated\r\n   as a bridge to Hermes-native tools.\r\n3. **Always pass `--no-auto-update` in automation** — otherwise Grok phones home\r\n   for update checks (and `x.ai`\u002F`storage.googleapis.com` may be unreachable).\r\n4. **Prefer npm install over the curl installer** — `npm install -g\r\n   @xai-official\u002Fgrok` avoids the Cloudflare-walled `x.ai` host.\r\n5. **`--always-approve` is the autonomous-build switch.** Without it, headless\r\n   runs may stall waiting on tool-approval prompts. Omit it deliberately for\r\n   read-only review\u002Faudit work so Grok can't mutate files.\r\n6. **Headless `-p` skips TUI dialogs**; the TUI needs `pty=true` (+ tmux for\r\n   monitoring), just like Claude Code.\r\n7. **Use `--no-alt-screen`** if you run the TUI inline and the fullscreen\r\n   alt-screen takeover garbles captured output.\r\n8. **No git repo needed**, but for PR\u002Fcommit workflows you still want one — use\r\n   `mktemp -d && git init` for scratch commit tasks.\r\n9. **Clean up tmux sessions** with `tmux kill-session -t \u003Cname>` when done.\r\n\r\n## Rules for Hermes Agents\r\n\r\n1. **Prefer headless `-p`** for single tasks — cleanest integration, structured\r\n   output via `--output-format json`.\r\n2. **Always set `workdir`** (or `--cwd`) so Grok targets the right project.\r\n3. **Pass `--no-auto-update`** in every automated invocation.\r\n4. **Use `--always-approve` only when Grok should write autonomously**; omit it\r\n   for read-only reviews and audits.\r\n5. **Background long tasks** with `background=true, notify_on_complete=true` and\r\n   monitor via the `process` tool.\r\n6. **Use tmux for multi-turn interactive work** and monitor with\r\n   `tmux capture-pane -t \u003Csession> -p -S -50`.\r\n7. **Verify auth before relying on it** — check `~\u002F.grok\u002Fauth.json` or run a\r\n   cheap `grok -p \"Say ok.\"` smoke test; don't assume Hermes' xAI auth carries\r\n   over.\r\n8. **Report results to the user** — summarize what Grok changed and what's left.\r\n","# Grok Build CLI — Hermes Orchestration Guide\r\n\r\nDelegate coding tasks to [Grok Build](https:\u002F\u002Fdocs.x.ai\u002Fbuild\u002Foverview) (xAI's\r\nautonomous coding agent CLI, the `grok` command) via the Hermes terminal. Grok\r\ncan read files, write code, run shell commands, spawn subagents, and manage git\r\nworkflows. It runs three ways: an interactive TUI, **headless** (`-p`), and as\r\nan **ACP agent** over JSON-RPC.\r\n\r\nThis is the third sibling to `codex` and `claude-code`. The orchestration\r\npattern is nearly identical — **prefer headless `-p` for one-shots**, use a PTY\r\nfor interactive sessions.\r\n\r\n## When to use\r\n\r\n- Building features\r\n- Refactoring\r\n- PR reviews\r\n- Batch issue fixing\r\n- Any task where you'd otherwise reach for Codex \u002F Claude Code but want Grok\r\n\r\n## Prerequisites\r\n\r\n- **Install (preferred):** `npm install -g @xai-official\u002Fgrok`\r\n  - The official installer `curl -fsSL https:\u002F\u002Fx.ai\u002Fcli\u002Finstall.sh | bash` also\r\n    works, but the `x.ai` host is Cloudflare-walled in some environments. The\r\n    npm path avoids that dependency entirely.\r\n- **Auth — SuperGrok \u002F X Premium+ subscription (primary path):**\r\n  - Run `grok login` once → opens a browser for OAuth → token cached in\r\n    `~\u002F.grok\u002Fauth.json`. This uses your **SuperGrok or X Premium+** subscription\r\n    (no per-token API billing).\r\n  - Check sign-in state by looking for `~\u002F.grok\u002Fauth.json`, or run a cheap\r\n    headless smoke test: `grok --no-auto-update -p \"Say ok.\"`\r\n  - In the TUI, `\u002Flogout` signs out and `\u002Flogin` (or relaunching) signs back in.\r\n- **No git repo required** — unlike Codex, Grok runs fine outside a git\r\n  directory (good for scratch\u002Fthrowaway tasks).\r\n- **Claude Code \u002F AGENTS.md compatible with zero config** — Grok auto-reads\r\n  `CLAUDE.md`, `.claude\u002F` (skills, agents, MCPs, hooks, rules), and the\r\n  `AGENTS.md` family. Existing project context just works.\r\n\r\n> **API-key fallback (not the default for this user):** Grok also supports\r\n> setting the `XAI_API_KEY` environment variable for pay-as-you-go billing\r\n> via `api.x.ai`. Only use\r\n> this if `grok login` \u002F SuperGrok auth is unavailable. The subscription path\r\n> (`grok login`) is the intended setup here.\r\n\r\n## Two Orchestration Modes\r\n\r\n### Mode 1: Headless (`-p`) — Non-Interactive (PREFERRED)\r\n\r\nRuns a one-shot task, prints the result, and exits. No PTY, no interactive\r\ndialogs to navigate. This is the cleanest integration path — the analog of\r\n`claude -p` and `codex exec`.\r\n\r\n```\r\nterminal(command=\"grok --no-auto-update -p 'Add a dark mode toggle to settings'\", workdir=\"\u002Fpath\u002Fto\u002Fproject\", timeout=180)\r\n```\r\n\r\nAlways pass `--no-auto-update` in automation to skip background update checks.\r\n\r\n**When to use headless:**\r\n- One-shot coding tasks (fix a bug, add a feature, refactor)\r\n- CI\u002FCD automation and scripting\r\n- Structured output parsing with `--output-format json`\r\n- Any task that doesn't need multi-turn conversation\r\n\r\n### Mode 2: Interactive PTY — Multi-Turn TUI Sessions\r\n\r\nThe TUI is a fullscreen, mouse-interactive app. Drive it with `pty=true`. For\r\nrobust monitoring\u002Finput use tmux (same pattern as the `claude-code` skill).\r\n\r\n```\r\n# Launch in a tmux session for capture-pane monitoring\r\nterminal(command=\"tmux new-session -d -s grok-work -x 140 -y 40\")\r\nterminal(command=\"tmux send-keys -t grok-work 'cd \u002Fpath\u002Fto\u002Fproject && grok' Enter\")\r\n\r\n# Wait for startup, then send a task\r\nterminal(command=\"sleep 5 && tmux send-keys -t grok-work 'Refactor the auth module to use JWT' Enter\")\r\n\r\n# Monitor progress\r\nterminal(command=\"sleep 15 && tmux capture-pane -t grok-work -p -S -50\")\r\n\r\n# Exit when done\r\nterminal(command=\"tmux send-keys -t grok-work '\u002Fquit' Enter && sleep 1 && tmux kill-session -t grok-work\")\r\n```\r\n\r\n**Tip for headless-but-inline output:** if you want TUI-style output without the\r\nfullscreen alt-screen takeover (e.g. for cleaner logs), add `--no-alt-screen`.\r\nFor pure automation, headless `-p` is still cleaner than the TUI.\r\n\r\n## Headless Deep Dive\r\n\r\n### Common Flags\r\n\r\n| Flag | Effect |\r\n|------|--------|\r\n| `-p, --single \u003CPROMPT>` | Send one prompt, run headless, exit |\r\n| `-m, --model \u003CMODEL>` | Choose a model |\r\n| `-s, --session-id \u003CID>` | Create or resume a named headless session |\r\n| `-r, --resume \u003CID>` | Resume an existing session |\r\n| `-c, --continue` | Continue the most recent session in the current directory |\r\n| `--cwd \u003CPATH>` | Set the working directory |\r\n| `--output-format \u003CFMT>` | `plain` (default), `json`, or `streaming-json` |\r\n| `--always-approve` | Auto-approve all tool executions (the `--full-auto` \u002F `--yolo` equivalent) |\r\n| `--no-alt-screen` | Run inline, no fullscreen TUI takeover |\r\n| `--no-auto-update` | Skip background update checks (use in all automation) |\r\n\r\n### Output Formats\r\n\r\n- `plain` — human-readable text (default)\r\n- `json` — one JSON object at the end of the run (parse the result cleanly)\r\n- `streaming-json` — newline-delimited JSON events as they arrive\r\n\r\n```\r\n# Structured result for parsing\r\nterminal(command=\"grok --no-auto-update -p 'List all TODO comments in src\u002F' --output-format json\", workdir=\"\u002Fproject\", timeout=120)\r\n\r\n# Auto-approve for autonomous building\r\nterminal(command=\"grok --no-auto-update --always-approve -p 'Refactor the database layer and run the tests'\", workdir=\"\u002Fproject\", timeout=300)\r\n```\r\n\r\n### Background Mode (Long Tasks)\r\n\r\n```\r\n# Start headless in background\r\nterminal(command=\"grok --no-auto-update --always-approve -p 'Refactor the auth module'\", workdir=\"\u002Fproject\", background=true, notify_on_complete=true)\r\n# Returns session_id\r\n\r\n# Monitor\r\nprocess(action=\"poll\", session_id=\"\u003Cid>\")\r\nprocess(action=\"log\", session_id=\"\u003Cid>\")\r\n\r\n# Kill if needed\r\nprocess(action=\"kill\", session_id=\"\u003Cid>\")\r\n```\r\n\r\nFor an interactive (TUI) background session, use `pty=true` + tmux and monitor\r\nwith `tmux capture-pane`, exactly like the `claude-code` \u002F `codex` skills.\r\n\r\n### Session Continuation\r\n\r\n```\r\n# Start a named session\r\nterminal(command=\"grok --no-auto-update -s refactor-db -p 'Start refactoring the database layer' --always-approve\", workdir=\"\u002Fproject\", timeout=240)\r\n\r\n# Resume it later\r\nterminal(command=\"grok --no-auto-update -r refactor-db -p 'Now add connection pooling' --always-approve\", workdir=\"\u002Fproject\", timeout=180)\r\n\r\n# Or continue the most recent session in this directory\r\nterminal(command=\"grok --no-auto-update -c -p 'What did you change last time?'\", workdir=\"\u002Fproject\", timeout=60)\r\n```\r\n\r\n## Read-Only Audit → Markdown Note Pattern\r\n\r\nTo have Grok review local artifacts and return a clean markdown note (for\r\nObsidian or a repo) without mutating anything:\r\n\r\n1. Prepare stable input files first with Hermes tools (`read_file`,\r\n   `write_file`). Snapshot only the relevant context into a temp file rather\r\n   than dumping raw paths.\r\n2. Run Grok headless **without** `--always-approve` so it cannot auto-write, and\r\n   demand `markdown only, no preamble`.\r\n3. Save Grok's stdout straight into the destination note with `write_file()`.\r\n\r\n```\r\ngrok --no-auto-update -p \"Read \u002Ftmp\u002Fcurrent.md and \u002Ftmp\u002Finventory.md. Produce markdown only, no preamble. Output a clean note titled 'Cleanup Review'.\" --output-format plain\r\n```\r\n\r\n**Pitfall (same as Claude Code):** for document rewrites, a loose \"rewrite this\"\r\nprompt may return a change summary instead of the full file. Instead: pipe the\r\nfile in, and demand `Return ONLY the full revised markdown document. No intro,\r\nno explanation, no code fences. Start immediately with '# Title'.` Verify the\r\nfirst lines with `read_file()` before overwriting the destination.\r\n\r\n## PR Review Patterns\r\n\r\n### Quick Review (Headless)\r\n\r\n```\r\nterminal(command=\"cd \u002Fpath\u002Fto\u002Frepo && git diff main...feature-branch | grok --no-auto-update -p 'Review this diff for bugs, security issues, and style problems. Be thorough.'\", timeout=120)\r\n```\r\n\r\n### Clone-to-temp Review (safe, no repo mutation)\r\n\r\n```\r\nterminal(command=\"REVIEW=$(mktemp -d) && git clone https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo.git $REVIEW && cd $REVIEW && gh pr checkout 42 && grok --no-auto-update -p 'Review the changes vs origin\u002Fmain. Check bugs, security, race conditions, missing tests.'\", pty=true, timeout=300)\r\n```\r\n\r\n### Post the review\r\n\r\n```\r\nterminal(command=\"gh pr comment 42 --body '\u003Creview text>'\", workdir=\"\u002Fpath\u002Fto\u002Frepo\")\r\n```\r\n\r\n## Parallel Issue Fixing with Worktrees\r\n\r\n```\r\n# Create worktrees\r\nterminal(command=\"git worktree add -b fix\u002Fissue-78 \u002Ftmp\u002Fissue-78 main\", workdir=\"~\u002Fproject\")\r\nterminal(command=\"git worktree add -b fix\u002Fissue-99 \u002Ftmp\u002Fissue-99 main\", workdir=\"~\u002Fproject\")\r\n\r\n# Launch Grok headless in each (background)\r\nterminal(command=\"grok --no-auto-update --always-approve -p 'Fix issue #78: \u003Cdescription>. Commit when done.'\", workdir=\"\u002Ftmp\u002Fissue-78\", background=true, notify_on_complete=true)\r\nterminal(command=\"grok --no-auto-update --always-approve -p 'Fix issue #99: \u003Cdescription>. Commit when done.'\", workdir=\"\u002Ftmp\u002Fissue-99\", background=true, notify_on_complete=true)\r\n\r\n# Monitor\r\nprocess(action=\"list\")\r\n\r\n# After completion: push and open PRs\r\nterminal(command=\"cd \u002Ftmp\u002Fissue-78 && git push -u origin fix\u002Fissue-78\")\r\nterminal(command=\"gh pr create --repo user\u002Frepo --head fix\u002Fissue-78 --title 'fix: ...' --body '...'\")\r\n\r\n# Cleanup\r\nterminal(command=\"git worktree remove \u002Ftmp\u002Fissue-78\", workdir=\"~\u002Fproject\")\r\n```\r\n\r\n## Useful Subcommands & TUI Commands\r\n\r\n| Command | Purpose |\r\n|---------|---------|\r\n| `grok` | Start the interactive TUI |\r\n| `grok -p \"query\"` | Headless one-shot |\r\n| `grok login` \u002F `grok logout` | Sign in \u002F out (SuperGrok \u002F X Premium+ OAuth) |\r\n| `grok inspect` | Show what Grok discovered in cwd: config sources, instructions, skills, plugins, hooks, MCP servers |\r\n| `grok agent stdio` | Run as an ACP agent over JSON-RPC (for IDE\u002Ftool integration) |\r\n| `grok update` | Update the CLI (needs the `x.ai` host; skip in automation) |\r\n\r\nTUI slash commands (interactive only): `\u002Fmodel \u003Cname>`, `\u002Falways-approve`,\r\n`\u002Fplan`, `\u002Fcontext`, `\u002Fcompact`, `\u002Fresume`, `\u002Fsessions`, `\u002Ffork`, `\u002Fusage`,\r\n`\u002Fquit`. `Shift+Tab` cycles session modes (including Plan mode, which blocks\r\nwrite tools except the session plan file).\r\n\r\n## Config (`~\u002F.grok\u002Fconfig.toml`)\r\n\r\n```toml\r\n[cli]\r\nauto_update = false          # skip background update checks persistently\r\n\r\n[ui]\r\npermission_mode = \"ask\"      # or \"always-approve\" to skip tool prompts by default\r\n\r\n[models]\r\ndefault = \"grok-build-0.1\"\r\n```\r\n\r\nPut global preferences in `~\u002F.grok\u002Fconfig.toml` (not project-scoped\r\n`.grok\u002Fconfig.toml`). `permission_mode` supersedes the legacy `approval_mode` \u002F\r\n`yolo = true` keys.\r\n\r\n- See `references\u002Fhermes-orchestration.md` for the Hermes↔Grok handoff pattern when Hermes-only tools like `x_search` are needed.\r\n\r\n## Pitfalls & Gotchas\r\n\r\n1. **Auth is subscription-gated.** `grok login` requires a SuperGrok or X\r\n   Premium+ subscription. If login fails or there's no `~\u002F.grok\u002Fauth.json`,\r\n   confirm the subscription is active before falling back to `XAI_API_KEY`.\r\n3. **Don't conflate Hermes' xAI auth with the `grok` CLI's auth.** Hermes'\r\n   `x_search` runs on its own xAI OAuth; the standalone `grok` CLI has a\r\n   separate token in `~\u002F.grok\u002Fauth.json`. A working `x_search` does NOT mean\r\n   `grok` is logged in.\r\n4. **Use Hermes as the orchestrator when Hermes-only tools are needed.**\r\n   Grok is for coding\u002Freview\u002FPR work; if the task needs Hermes-only tools such\r\n   as `x_search`, have Hermes gather the data first, then hand the grounded\r\n   context to Grok for implementation or drafting. Grok should not be treated\r\n   as a bridge to Hermes-native tools.\r\n3. **Always pass `--no-auto-update` in automation** — otherwise Grok phones home\r\n   for update checks (and `x.ai`\u002F`storage.googleapis.com` may be unreachable).\r\n4. **Prefer npm install over the curl installer** — `npm install -g\r\n   @xai-official\u002Fgrok` avoids the Cloudflare-walled `x.ai` host.\r\n5. **`--always-approve` is the autonomous-build switch.** Without it, headless\r\n   runs may stall waiting on tool-approval prompts. Omit it deliberately for\r\n   read-only review\u002Faudit work so Grok can't mutate files.\r\n6. **Headless `-p` skips TUI dialogs**; the TUI needs `pty=true` (+ tmux for\r\n   monitoring), just like Claude Code.\r\n7. **Use `--no-alt-screen`** if you run the TUI inline and the fullscreen\r\n   alt-screen takeover garbles captured output.\r\n8. **No git repo needed**, but for PR\u002Fcommit workflows you still want one — use\r\n   `mktemp -d && git init` for scratch commit tasks.\r\n9. **Clean up tmux sessions** with `tmux kill-session -t \u003Cname>` when done.\r\n\r\n## Rules for Hermes Agents\r\n\r\n1. **Prefer headless `-p`** for single tasks — cleanest integration, structured\r\n   output via `--output-format json`.\r\n2. **Always set `workdir`** (or `--cwd`) so Grok targets the right project.\r\n3. **Pass `--no-auto-update`** in every automated invocation.\r\n4. **Use `--always-approve` only when Grok should write autonomously**; omit it\r\n   for read-only reviews and audits.\r\n5. **Background long tasks** with `background=true, notify_on_complete=true` and\r\n   monitor via the `process` tool.\r\n6. **Use tmux for multi-turn interactive work** and monitor with\r\n   `tmux capture-pane -t \u003Csession> -p -S -50`.\r\n7. **Verify auth before relying on it** — check `~\u002F.grok\u002Fauth.json` or run a\r\n   cheap `grok -p \"Say ok.\"` smoke test; don't assume Hermes' xAI auth carries\r\n   over.\r\n8. **Report results to the user** — summarize what Grok changed and what's left.\r\n",{"name":5,"author":48,"license":15,"version":49,"metadata":50,"platforms":60,"description":7},"Matt Maximo (MattMaximo), Hermes Agent","0.1.0",{"hermes":51},{"tags":52,"related_skills":58},[28,53,54,55,56,57],"Grok","xAI","Code-Review","Refactoring","Automation",[39,59,26],"claude-code",[40,33,37],"main","0d1434f89f4bc6b07e9d272accd8c1013768820f","archive\u002Fskill-md-reviewed\u002Fsha256\u002Fe8\u002Fe8047cc80bf73a152413d1d6dabc7908ddc242cd957ff09ba5a2860456cf52f7",0,"https:\u002F\u002Fgithub.com\u002Fzapabob\u002FSkills","https:\u002F\u002Fgithub.com\u002Fzapabob","The Open University of JAPAN　2019-now\r\n\r\nTokyo University of Science　2007-2010","2026-10-26 16:29:01",{"source":8,"skillName":5,"commands":70,"prompt":80,"zipAvailable":81},[71,74,77],{"tool":72,"command":73},"npx","npx skills add zapabob\u002FSkills --skill grok",{"tool":75,"command":76},"bunx","bunx skills add zapabob\u002FSkills --skill grok",{"tool":78,"command":79},"pnpm","pnpm dlx skills add zapabob\u002FSkills --skill grok","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fzapabob\u002FSkills\u002Fblob\u002Fmain\u002Farchive\u002Fskill-md-reviewed\u002Fsha256\u002Fe8\u002Fe8047cc80bf73a152413d1d6dabc7908ddc242cd957ff09ba5a2860456cf52f7\u002FSKILL.md",true,[],[84,113,145,172,199,215],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":99,"publishedAt":43},"01M6GJTE1GESGGF9K028Y7753E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002Fzapabob\u002FSkills\u002Fblob\u002Fmain\u002Fregistry\u002Fskills\u002Fxurl\u002Fvariants\u002Fhermes-agent\u002FSKILL.md",[90,93,94],{"categoryNo":91,"categoryName":92,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":95,"categoryName":96,"taxonomyType":97,"taxonomyTypeDesc":98},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[86,100,33,41,101,40,37,102,103,104,105,106,107,31,108,109,61,110,111,112],"openclaw","github","official","search","https","social-media","api","Media","hermes agent","twitter","social","via","post",{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":130,"publishedAt":43},"01M6GJT8S1PXQ8WPXT1HSNBWH2","writing-plans","Write implementation plans: bite-sized tasks, paths, code.","https:\u002F\u002Fgithub.com\u002Fzapabob\u002FSkills\u002Fblob\u002Fmain\u002Fregistry\u002Fskills\u002Fwriting-plans\u002Fvariants\u002Fhermes-agent\u002FSKILL.md",[119,122,125,126,127],{"categoryNo":120,"categoryName":121,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":123,"categoryName":124,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":95,"categoryName":96,"taxonomyType":97,"taxonomyTypeDesc":98},{"categoryNo":128,"categoryName":129,"taxonomyType":97,"taxonomyTypeDesc":98},"01JBSEEDCAT000000000000036","内容创作者",[131,132,133,134,33,42,40,135,37,136,137,138,36,139,35,140,141,142,143,144],"writing","writing plans","plans","design","workflow","documentation","tasks","development","planning","subagent","write","superpowers","paths","test-driven-development",{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":154,"publishedAt":43},"01M6GJST0H5X7WHBJ3BZK0DVKH","whisper","OpenAI's general-purpose speech recognition model. Supports 99 languages, transcription, translation to English, and language identification. Six model sizes from tiny (39M params) to large (1550M params). Use for speech-to-text, podcast transcription, or multilingual audio processing. Best for robust, multilingual ASR.","https:\u002F\u002Fgithub.com\u002Fzapabob\u002FSkills\u002Fblob\u002Fmain\u002Fregistry\u002Fskills\u002Fwhisper\u002Fvariants\u002Fhermes-agent-optional\u002FSKILL.md",[151],{"categoryNo":152,"categoryName":153,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000016","图像与多媒体",[147,33,40,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171],"openai","speech","multimodal","Transformers","ASR","Audio","text","model","speech recognition","use","general","multilingual","translation","english","identification","processing","Audio Processing",{"skillNo":173,"name":174,"nameZh":6,"description":175,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":176,"categories":177,"keywords":181,"publishedAt":43},"01M6GJSMRQ8EETZTYMG72P70EA","weights-and-biases","W&B: log ML experiments, sweeps, model registry, dashboards.","https:\u002F\u002Fgithub.com\u002Fzapabob\u002FSkills\u002Fblob\u002Fmain\u002Fregistry\u002Fskills\u002Fweights-and-biases\u002Fvariants\u002Fhermes-agent\u002FSKILL.md",[178],{"categoryNo":179,"categoryName":180,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000013","分析与可视化",[182,33,183,184,37,185,186,187,188,189,190,162,191,192,193,194,195,196,197,198],"weights and biases","tensorflow","experiments","pytorch","visualization","registry","real-time","tuning","dashboards","experiment","log","time","Experiment Tracking","Model Registry","Hyperparameter Tuning","WandB","Real-Time Visualization",{"skillNo":200,"name":201,"nameZh":6,"description":202,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":203,"categories":204,"keywords":206,"publishedAt":43},"01M6GJS19KDPRY112JTR326S06","watchers","Poll RSS, JSON APIs, and GitHub with watermark dedup.","https:\u002F\u002Fgithub.com\u002Fzapabob\u002FSkills\u002Fblob\u002Fmain\u002Fregistry\u002Fskills\u002Fwatchers\u002Fvariants\u002Fhermes-agent-optional\u002FSKILL.md",[205],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[201,33,207,101,40,38,208,209,210,211,212,31,108,213,214],"terminal","http","monitoring","cron","json","rss","devops","with",{"skillNo":216,"name":217,"nameZh":6,"description":218,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":219,"categories":220,"keywords":223,"publishedAt":43},"01M6GJRHJD2A6Q830SWF9W48BC","serving-llms-vllm","vLLM: high-throughput LLM serving, OpenAI API, quantization.","https:\u002F\u002Fgithub.com\u002Fzapabob\u002FSkills\u002Fblob\u002Fmain\u002Fregistry\u002Fskills\u002Fvllm\u002Fvariants\u002Fhermes-agent\u002FSKILL.md",[221,222],{"categoryNo":91,"categoryName":92,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":95,"categoryName":96,"taxonomyType":97,"taxonomyTypeDesc":98},[224,225,226,40,227,155,228,229,230,158,231,106,232,233,234,235,236,237,238,239],"llms","vLLM","serving llms vllm","research","openai api","tensor","Inference Serving","Production","llm serving","High Throughput","PagedAttention","Continuous Batching","Quantization","Tensor Parallelism","high-throughput","throughput"]