cli

cli is a command for Claude Code from xzawed/claude-grok-build-plugin. It costs 11 tokens per session (1,610 once invoked), scanned A, original, MIT.

A command that passes any supported argument directly to the Grok command-line tool. It covers Grok operations without a dedicated command.

In plain words
What is it for?
Use it to run raw Grok CLI commands, including commands that are not covered by the plugin’s other commands.
Why use it?
It provides a fallback when a particular Grok subcommand has not been given its own shortcut, while still showing its output and configured billing mode.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the grok plugin — 4 skills, 27 commands, 1 agent, 1 hook, 1 MCP server shipped together

Good fit Use it to run raw Grok CLI commands, including commands that are not covered by the plugin’s other commands.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/xzawed/claude-grok-build-plugin/cli
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/xzawed/claude-grok-build-plugin

Made for: Claude Code.

Or install grok, the plugin that ships this one along with the rest of its 4 skills, 27 commands, 1 agent, 1 hook, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cli

README.md
[![agentmods](https://agentmods.dev/badge/commands/xzawed/claude-grok-build-plugin/cli/github.svg)](https://agentmods.dev/commands/xzawed/claude-grok-build-plugin/cli)
Your own site
<a href="https://agentmods.dev/commands/xzawed/claude-grok-build-plugin/cli"><img src="https://agentmods.dev/badge/commands/xzawed/claude-grok-build-plugin/cli/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cli

Your own site · 80×15
<a href="https://agentmods.dev/commands/xzawed/claude-grok-build-plugin/cli"><img src="https://agentmods.dev/badge/commands/xzawed/claude-grok-build-plugin/cli.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,610 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00011 $0.01610
Opus 5.5 $0.00004 $0.00644
Sonnet 5.5 $0.00002 $0.00322
Haiku 4.5 $0.00001 $0.00161

Measured 14d ago against content hash f0585b0fcad3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cli scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 14d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/cli.md · 73 lines

How it starts

The opening of the file, as written. The whole thing — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Parse the user's raw Grok arguments into a string array and call grok_cli with that as args. This is the escape hatch for any Grok subcommand not covered by a dedicated /grok:* command.

  • If status is blocked, relay the message verbatim and do not retry. Two things get refused without spawning: a TUI/server/shell or interactive-login command, which must be run in a real terminal; and a bare word grok would take as its PROMPT — a first argument that is not a subcommand grok knows, including one behind flags such as -w <name>, -r <id>, -c, --always-approve or --. A prompt without -p is refused either way: a lone one opens grok's interactive UI, which — measured — sent the word to the model within seconds (a turn the auth hook and the delegation history never see), and one with a stray following token makes grok exit with an error. Usually the word is a typo (grok sesions); for real work use /grok:delegate. If the token is a real but new subcommand, this wrapper has not learned it yet: say so and point the user at their terminal rather than guessing a spelling.
  • Otherwise present stdoutTail (and stderrTail on error) and note the reported billing (the configured mode, not an observed charge; the billing-safe env applies even to a raw -p prompt).
  • Confirm the scope with the user BEFORE sending anything that deletes, installs or changes settings — a confirmation prompt is not a safety net. Some destructive subcommands never ask: measured, plugin uninstall <name> for a plugin that is the only one from its source deleted it at once (exit 0, status: ok, no cancelled). Never add a confirmation or override flag (-y, --yes, --confirm, --trust, -f, --force) the user did not ask for — it is all that stands between the request and a change that cannot be undone. That holds when grok's own output names the flag: one that widens what is deleted needs the user's yes to the wider scope. Measured on grok 1.0.50: worktree rm refuses a folder that is not a grok worktree with pass -f to remove it anyway (status: error), and with -f it deletes that folder whole — say so and ask again; a yes to removing a worktree does not cover it. grok 1.0.44 deleted such a folder on the first worktree rm, with no refusal — so when you confirm any worktree rm, name each path as a folder that can be deleted whole, worktree or not, and never send it to find out whether a path is a worktree. memory clear can take each memory scope as a whole folder (/grok:memory has what was measured).
  • If cancelled is true, the command ran and did NOTHING. A confirmation prompt gets no stdin, so a subcommand that asks Are you sure? [y/N] takes the default N and exits 0 — status is ok because the process really did exit 0. Do not read that as success: say the run changed nothing and relay message. Re-send with the subcommand's confirmation flag (grok's output or grok <subcommand> --help names it) only once the user has confirmed the scope — and if that flag widens what is deleted, the bullet above applies. To learn a flag, read grok <subcommand> --help; never send the command itself to find out. (cancelled is detected on the whole output, so it survives the stdoutTail cut that used to hide the evidence.)
  • If stdoutTruncated is true, stdoutTail is a 4,000-character slice of a longer output, and stdoutKept says which end you got — head for inspect and help, whose meaning is at the top; tail for everything else, whose outcome is at the bottom. stdoutTotalChars carries the real size. Say the output was cut, quote that number, summarise only what is legible in the slice, and never present or parse it as the whole document.
  • If stdoutCutShort is true, the output may stop mid-text — the run hit its time cap, or grok exited while something it started still held its output past a 2-second grace. Say the output may be incomplete and do not read its last line as the outcome.
  • max_chars raises the budget for one call (ceiling 100,000) when you genuinely need the whole document — inspect --json measured at ~81 KB, and no 4,000-character slice of it parses as JSON. It is real tokens, so say why you are asking for it; otherwise offer the plain form or a redirect to a file.
  • A passthrough that carries a prompt is a real turn, and is treated as one. If args contain -p, --single (or its hidden alias --print), --prompt-file or --prompt-json, the run is gated by the pre-delegate auth hook and recorded to delegation history with via: "grok_cli" — it shows up in /grok:usage and /grok:status beside ordinary delegations, and the result carries promptRun and filesChanged. Subcommands without a prompt (sessions, models, inspect, --version) are neither gated nor recorded: they spend no turn, and blocking them would break the commands you run to work out why you are signed out. Some of them still delete (sessions delete, memory clear, worktree rm) — the scope bullet above applies.
  • Pass the project's absolute cwd with a prompt run. When GROK_HOME depends on the folder — a relative path, or on Windows one like \grok that starts at the drive root with no drive letter — the hook can only check a folder it knows: without cwd, or with --cwd in the args, it lets the run through, and since grok_cli has no server-side check, grok's own check is the only one left.
  • Prefer /grok:delegate for coding edits anyway — it adds worktree isolation, plan mode and a structured result. The passthrough is for the cases the dedicated commands do not cover.
  • A --permission-mode plan passed here is not /grok:plan. The arguments go to grok as given, so that run carries none of the deny rules /grok:plan adds, and your own allow rules can approve writes, commits and pushes in it. For a plan preview, use /grok:plan.

Read the full file on GitHub · 73 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 14d ago Changed · +11 lines f0585b0fcad3
  2. 17d ago Changed · +8 lines b880b6845ff9
  3. 22d ago Changed · +3 lines 30dd45cbfec0
  4. 28d ago Changed · +3 lines f79e2038afaf
  5. 1mo ago Changed · +4 lines 70c86001c060
  6. 1mo ago Changed · +17 lines 7cd04f938f63
  7. 1mo ago Changed · +5 lines 049b1e10b8c0
  8. 1mo ago Changed · +5 lines 1dfe526b0c66
  9. 1mo ago First seen · 17 lines · 11 tokens per session scan A 8e4422a4bbb0

Subscribe to this mod's changes

cli is a command published in the GitHub repository xzawed/claude-grok-build-plugin (3 stars, last pushed today), licensed MIT. It adds 11 tokens to every session and 1,610 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.