yrzhe/claude-skills/grok-cli
Claude Code and agent skill by yrzhe/claude-skills
- community
Checking that the SKILL.md file is still in the repository.
Load when the user or an agent wants to use Grok/xAI locally with their own SuperGrok / X Premium account instead of a paid xAI API key — chat with Grok, generate images or videos with Grok Imagine, or search X/Twitter posts via Grok. Triggers on "用 Grok 聊天/问 Grok", "Grok 生成图片/视频", "grok imagine", "搜一下推特/X 上怎么说", "grok-cli ...", "log in to Grok with my X Premium", "Grok image/video generation", "search tweets with Grok". Uses browser OAuth (no API key needed); image/video generation is paid. Do NOT load for non-Grok LLMs or for the paid xAI API key SDK workflow.
Install
npx vskill@latest install yrzhe/claude-skills/grok-cliSKILL.md
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_KEYfallback. - xAI
/v1/responseschat calls. - Grok Imagine image generation (sync) and video generation (async poll).
- X/Twitter search through xAI's server-side
x_searchResponses 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:
Smoke test without network:
Login
Local machine with browser:
Remote SSH/container session:
Alternative API key fallback:
Main commands
Agent invocation contract
For Codex or another agent, call the CLI rather than importing internals unless you need a custom integration.
Preferred machine-readable calls:
JSON responses include the response id, model, answer, citations, inline citations, status, and usage where available.
Data layout
Default local state:
Set GROK_CLI_HOME=/path/to/state to isolate state for tests or a specific agent workspace.
Implementation notes for agents
grok-cli loginuses the xAI OIDC discovery document and Authorization Code + PKCE.- OAuth defaults are based on the public Hermes Agent implementation for
xai-oauth. - X Search is implemented by sending
tools: [{"type":"x_search"}]to/v1/responses, matching Hermes' documented behavior. - xAI's public Responses API documents
/v1/responses, response ids, retrieval, deletion, and server-side response storage. This skill defaults tostore:falsefor data-sovereignty reasons. - If
x_searchreturns a provider/model error, switchsearch_modeltogrok-4.20-reasoningor another model with x_search entitlement.
Troubleshooting
No xAI credentials available: rungrok-cli login, setXAI_API_KEY, or usegrok-cli key set.- Login callback cannot connect on a remote host: forward local port 56121 to the remote host before opening the URL.
state_mismatch: rerun login; do not reuse old authorization URLs.invalid_grantor refresh failure: rungrok-cli loginagain.x_searchnot enabled for this model/account: verify that your SuperGrok account has access and trygrok-cli config set search_model grok-4.20-reasoning.
Source basis
This package is based on public behavior documented by Hermes Agent and xAI docs, not on private credentials or browser-cookie scraping. See docs/sources.md for references.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/grok-cli/SKILL.md
Popularity
- 7-day trend score
- 0
Refreshed 30 Oct 2026, 9 days ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/yrzhe/claude-skills/grok-cli)