grok-cli

grok-cli is a skill for Claude Code from Yrzhe/claude-skills. It costs 168 tokens per session (1,534 once invoked), scanned A, original, MIT.

A local command-line tool for using Grok and xAI services through a SuperGrok or X Premium account, with an API-key option. It supports chat, image and video generation, X searches, and saved session history.

In plain words
What is it for?
Chatting with Grok, generating images or videos, searching X posts, switching between sessions, exporting conversations, and summarizing them.
Why use it?
It gives users a local interface for these tasks without requiring them to paste passwords or manually manage browser sessions.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument; mentions Codex.

Part of the grok-cli plugin — 1 skill shipped together

Good fit Chatting with Grok, generating images or videos, searching X posts, switching between sessions, exporting conversations, and summarizing them.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yrzhe/claude-skills/grok-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.

Any agent
npx skills add Yrzhe/claude-skills --skill grok-cli
Clone the repo
git clone --depth 1 https://github.com/Yrzhe/claude-skills

Made for: Claude Code.

Or install grok-cli, the plugin that ships this one along with the rest of its 1 skill.

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 grok-cli

README.md
[![agentmods](https://agentmods.dev/badge/skills/yrzhe/claude-skills/grok-cli/github.svg)](https://agentmods.dev/skills/yrzhe/claude-skills/grok-cli)
Your own site
<a href="https://agentmods.dev/skills/yrzhe/claude-skills/grok-cli"><img src="https://agentmods.dev/badge/skills/yrzhe/claude-skills/grok-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 grok-cli

Your own site · 80×15
<a href="https://agentmods.dev/skills/yrzhe/claude-skills/grok-cli"><img src="https://agentmods.dev/badge/skills/yrzhe/claude-skills/grok-cli.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 168 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,534 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.00168 $0.01534
Opus 5 $0.00084 $0.00767
Sonnet 5 $0.00034 $0.00307
Haiku 4.5 $0.00017 $0.00153

Measured 9d ago against content hash a0273a7f03fa, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

grok-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 9d ago.

The scan reads SKILL.md. This mod also ships 13 executable files (grok_cli/__init__.py, grok_cli/__main__.py, grok_cli/auth.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

plugins/grok-cli/SKILL.md · 160 lines

How it starts

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

grok-cli

Use this skill when the user or an agent needs a local CLI wrapper around Grok/xAI with:

  • Browser-based xAI / SuperGrok OAuth login using Authorization Code + PKCE.
  • Optional XAI_API_KEY fallback.
  • xAI /v1/responses chat calls.
  • Grok Imagine image generation (sync) and video generation (async poll).
  • X/Twitter search through xAI's server-side x_search Responses tool.
  • Persistent local session history in SQLite.
  • Multi-session switching, export, and summarization.

Safety and credential rules

Never ask the user to paste their xAI password. Use grok-cli login to open the xAI authorization URL in a browser. Do not scrape browser cookies, automate grok.com, or capture interactive login credentials. OAuth tokens are stored locally under ~/.grok-cli/auth.json with owner-only file permissions when supported by the OS.

Prefer OAuth for SuperGrok users. API keys are supported only as fallback through XAI_API_KEY or grok-cli key set.

Do not print access tokens, refresh tokens, API keys, or ID tokens. grok-cli status sanitizes credential output.

Image and video generation are paid xAI operations (≈ $0.02 / image, ≈ $0.40 / 8s video — video is ~20x an image). The CLI refuses paid generation in non-interactive mode unless --yes is passed; never auto-pass --yes for an agent without the user's intent. No credentials are bundled in this package — each user logs in with their own SuperGrok / X Premium account via grok-cli login.

Installation

From the skill folder:

python -m venv .venv
source .venv/bin/activate
pip install -e .

Smoke test without network:

grok-cli --help
grok-cli status

Login

Local machine with browser:

grok-cli login

Remote SSH/container session:

# On your local machine, in a separate terminal:
ssh -N -L 56121:127.0.0.1:56121 user@remote-host

# On the remote host:
grok-cli login --no-browser
# Open the printed URL locally.

Alternative API key fallback:

Read the full file on GitHub · 160 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. 9d ago First seen · 160 lines · 168 tokens per session scan A a0273a7f03fa

Subscribe to this mod's changes

grok-cli is a skill published in the GitHub repository Yrzhe/claude-skills (33 stars, last pushed 3mo ago), licensed MIT. It adds 168 tokens to every session and 1,534 once invoked, about $0.0008 per session on Opus 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-30.

Related

Other skills, from other repositories

webgl-holographic-foil

A self-contained WebGL2 hero: thin-film interference over a crushed-foil surface whose palette shifts with the viewing angle; move the cursor to tilt the film.

nexu-io/open-design · 41 tokens

general-video

Author or edit a custom HyperFrames composition when no specialized workflow fits, or when BRIEF.md sets flow: companion. Use for longer or multi-scene pieces, brand and sizzle reels, montages, static loops, static title cards, footage remixes, and freeform builds. Use motion-graphics instead for a short unnarrated…

heygen-com/hyperframes · 92 tokens

html-ppt-hermes-cyber-terminal

OpenDesign + BYOK: choosing and wiring your own model, hands-on — cost, quality, and the routing decision. Built as a decision-grade AI literacy deck for engineers, IT, applied-AI teams.

nexu-io/open-design · 53 tokens

html-ppt-taste-brutalist

16:9 HTML deck in tactical-telemetry / CRT-terminal taste. Deactivated-CRT charcoal slides, white-phosphor monospace, hazard-red accent, scanline overlay, ASCII syntax, density over decoration. Distilled from Leonxlnx/taste-skill brutalist-skill (Tactical Telemetry mode).

nexu-io/open-design · 78 tokens

diagnostic-stem-delivery

Audio production with diagnostic analysis, timecode parsing from documents, and verified export workflow.

HKUDS/OpenSpace · 23 tokens

chengfeng-check-updates

An environment manager for a video-editing system. It checks whether its skills and runtime—the software needed to run them—are installed and compatible.

Agentchengfeng/chengfeng-videocut-skills · 120 tokens