Agent skill

Ask Opencli

by majiayu000 in majiayu000/spellbook

Ask Grok or Gemini via opencli (browser-session based, no API cost).

MITAuto-check passed

Install Ask Opencli

skills CLI
$ npx skills add majiayu000/spellbook --skill ask-opencli -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install majiayu000/spellbook ask-opencli --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/majiayu000/spellbook.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/ask-opencli .claude/skills/ask-opencli && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
ask-opencli
GitHub stars
286
Token cost
~1.9k tokens
SKILL.md length
817 words
Files
1
Skills in repo
97
Repo updated
First seen
Licence
MIT

At a glance

Ask Grok or Gemini via opencli (browser-session based, no API cost).

  • Works in 2 steps: Inner: --timeout 300 — grok.com web… → Outer:…
  • The user says 问 grok
  • SKILL.md covers Model selection, ⚠️ 常见错误命令(直接 fail fast), ⚠️ Critical: Two-layer timeout… and Commands, plus 5 more sections
  • Calls npm and gemini

What it does

Ask Opencli is an agent skill from majiayu000/spellbook. Ask Grok or Gemini via opencli (browser-session based, no API cost). Use when the user says "问 grok", "问 gemini", "ask grok", "ask gemini", "用 grok 查", "grok 怎么看", "让 gemini 分析", or wants a second opinion from Grok/Gemini without paying API tokens. Routes to opencli which drives the already-logged-in Chrome session.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: Cross-runtime skills for Claude Code, Codex, and multi-agent workflows. The licence is MIT.

When your agent uses it

  • The user says 问 grok
  • Wants a second opinion from Grok/Gemini without paying API tokens

Example prompts

  • “问 grok”
  • “问 gemini”
  • “ask grok”
  • “/ask-opencli”

Requirements

  • Node.js

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. Inner: --timeout 300 — grok.com web response wait time
  2. Outer: OPENCLI_BROWSER_COMMAND_TIMEOUT=300 environment variable — entire browser command execution timeout (default 60s, hardcoded in…

What it can do on your machine

Read from SKILL.md and the folder at commit 6310f81. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm
    • gemini

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Ask Opencli loads about 1.9k tokens when it runs. Until then it costs about 82 tokens; SKILL.md has 817 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~82
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from majiayu000/spellbook at commit 6310f81, republished under its MIT licence (© majiayu000). 817 words, ~1,868 tokens.

Download SKILL.mdSave it as .claude/skills/ask-opencli/SKILL.md (or your agent's skills folder).
name
ask-opencli
description
Ask Grok or Gemini via opencli (browser-session based, no API cost). Use when the user says "问 grok", "问 gemini", "ask grok", "ask gemini", "用 grok 查", "grok 怎么看", "让 gemini 分析", or wants a second opinion from Grok/Gemini without paying API tokens. Routes to opencli which drives the already-logged-in Chrome session.

Ask via OpenCLI (Grok / Gemini)

Use opencli to query Grok or Gemini through the user's already-logged-in Chrome session. Zero API cost, fully driven by the existing browser session.

opencli 项目:https://github.com/jackwener/opencli 安装:npm install -g @jackwener/opencli(需要 Node ≥20) 首次运行:opencli doctor 会自动引导安装 Chrome Browser Bridge 扩展 登录:用装了扩展的 Chrome profile 打开 grok.com 和 gemini.google.com 登录一次 必须环境变量:export OPENCLI_BROWSER_COMMAND_TIMEOUT=300(写进 shell rc) 更深度的多 AI 并行调研工作流:use the multi-ai-research skill instead

When to trigger:

  • User explicitly asks to query Grok or Gemini ("问一下 grok", "用 gemini 查", "让 grok 看看")
  • User wants a second opinion / external advisor from Grok or Gemini
  • User says "ask grok"/"ask gemini" or mentions these two as the information source

When NOT to trigger:

  • User wants to use native Gemini CLI (gemini -p) → use ask-gemini skill instead
  • User wants Claude's own opinion → answer directly
  • User wants other AI (Doubao, Yuanbao, ChatGPT, etc.) → use other tools

Model selection

If the user doesn't specify which model, default to Grok for real-time / social / news / tech-trend questions, and Gemini for long-form reasoning, research, coding, and document analysis.

If still ambiguous, ask the user which one to use before sending.

⚠️ 常见错误命令(直接 fail fast)

❌ 错误✅ 正确原因
opencli gemini chat "..."opencli gemini ask "..."没有 chat 子命令
opencli grok chat "..."opencli grok ask "..."只有 ask 子命令
opencli grok newopencli grok ask "..." --new truegrok 的"新对话"是 ask 的参数
opencli gemini query "..."opencli gemini ask "..."没有 query 子命令

完整子命令速查(运行 opencli grok --help 或 opencli gemini --help 查看):

Grok:
  ask <prompt>                    # 唯一命令

Gemini:
  ask <prompt>                    # 最常用
  new                             # 开新对话
  deep-research <prompt>          # Deep Research 模式
  deep-research-result [query]    # 取 Deep Research 结果
  image <prompt>                  # 图片生成

⚠️ Critical: Two-layer timeout (from 2026-04-08 debugging)

opencli has two independent timeout layers, both must be set for grok to wait long enough:

  1. Inner: --timeout 300 — grok.com web response wait time
  2. Outer: OPENCLI_BROWSER_COMMAND_TIMEOUT=300 environment variable — entire browser command execution timeout (default 60s, hardcoded in runtime.js:25)

The outer takes priority over the inner. Setting only --timeout 300 still gets killed at 60s. You MUST set both.

Source code: .omx/reference/opencli/dist/src/runtime.js:25:

js
export const DEFAULT_BROWSER_COMMAND_TIMEOUT = parseEnvTimeout('OPENCLI_BROWSER_COMMAND_TIMEOUT', 60);

Recommended: add export OPENCLI_BROWSER_COMMAND_TIMEOUT=300 to ~/.zshrc so every grok/gemini call has room to breathe.

Commands

Grok (MANDATORY env var)
bash
OPENCLI_BROWSER_COMMAND_TIMEOUT=300 opencli grok ask "{{PROMPT}}" --timeout 300 -f json

Or if env var already exported in shell:

bash
opencli grok ask "{{PROMPT}}" --timeout 300 -f json

Flags:

  • --new true — start a fresh chat (avoids polluting prior conversation context)
  • --web true — use the hardened grok.com consumer web flow (better error messages)
  • --timeout 300 — MUST match or be lower than OPENCLI_BROWSER_COMMAND_TIMEOUT
  • -f json — structured output (recommended over --format plain for parsing)
Gemini
bash
opencli gemini ask "{{PROMPT}}" --format plain

Gemini is more stable than grok and usually doesn't hit the 60s timeout. No env var required but adding it doesn't hurt:

bash
OPENCLI_BROWSER_COMMAND_TIMEOUT=300 opencli gemini ask "{{PROMPT}}" --format plain

Flags:

  • --new true — start a fresh chat
  • --timeout 90 — extend timeout for long answers (default 60s)
Parallel dispatch (for multi-AI workflows)

To call grok and gemini in parallel from Claude Code, use the Bash tool with run_in_background=true for both calls in the same assistant turn. Claude Code will launch them concurrently and wait for task-completion notifications.

For deep cross-validation workflows (N internal sub-agents + 2 external AIs, confidence-tiered synthesis), use the multi-ai-research skill instead — it covers the full orchestration pattern.

Show full SKILL.md (342 more words)Show less

Prerequisites (check before running)

  1. opencli installed: opencli --version should print a version.
  2. Chrome running with Browser Bridge extension loaded — the extension is installed from ~/Desktop/code/AI/tools/opencli/extension/ via chrome://extensions → Developer mode → Load unpacked. If the extension is missing, opencli doctor will flag it.
  3. Logged in to the target site:
    • Grok: grok.com must be logged in
    • Gemini: gemini.google.com must be logged in
  4. Daemon connectivity: run opencli doctor once per session if unsure.

If any check fails, do not fall back to another tool silently. Report the missing prerequisite and ask the user to fix it (per U-23 no-silent-degradation rule).

Execution protocol

  1. Decide which model to use (Grok vs Gemini). If unclear, ask.
  2. Build the prompt. Be explicit — these browser UIs have no system prompt so the full question must be self-contained.
  3. Run the opencli command with --format plain.
  4. Capture the response. If the command fails with a session/auth/challenge message, stop and surface the error to the user. Do NOT retry blindly.
  5. Save an artifact (see below).
  6. Report back to the user: model used, summary of response, and path to the artifact.

Error handling

opencli will emit specific errors like:

  • "Not logged in to grok.com" → ask user to log in
  • "Composer not found" → DOM changed, ask user to open the site manually and retry
  • "Session gated / challenge" → user needs to solve the challenge in Chrome manually
  • Timeout → offer to retry with a longer --timeout

Do not swallow these. Report verbatim with the fix action.

Artifact requirement

After every successful call, save a markdown artifact to:

.omx/artifacts/ask-opencli-<grok|gemini>-<slug>-<YYYYMMDD-HHMMSS>.md

Minimum sections:

  1. Original user task — what the user asked you
  2. Model — grok or gemini, plus any flags used (--new, --web, --timeout)
  3. Final prompt sent — the exact string passed to opencli ... ask
  4. Raw response — the full output from opencli
  5. Summary — 2-3 bullets distilling the key points
  6. Action items / next steps — what to do with this information

Keep the artifact even when the response is low quality — it documents that the query was made.

Examples

bash
# Quick factual question, Grok default path
opencli grok ask "最新的 Claude 4.6 定价和 4.5 有什么差别?" --format plain

# Long reasoning task, Gemini with extended timeout + fresh chat
opencli gemini ask "分析这段 Rust 代码的并发安全问题:..." --new true --timeout 120 --format plain

# Grok hardened web path with new chat
opencli grok ask "X 上这两天关于 agent framework 的讨论焦点是什么?" --web true --new true --format plain

Task: {{ARGUMENTS}}

© majiayu000, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/ask-opencli of majiayu000/spellbook.

Open the folder on GitHubat commit 6310f81

Compare with similar skills

Ask Opencli next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Ask Opencli compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Ask Opencli this skillmajiayu000/spellbook286—~1.9kAutomated safety check: PassMIT
Grok Mediacalesthio/OpenMontage65k—~950Automated safety check: PassAGPL-3.0
OpenCLI Usage Mapjackwener/OpenCLI30k1 repos~2.3kAutomated safety check: PassApache-2.0
Grok Delegatesickn33/agentic-awesome-skills47k1 repos~2.6kAutomated safety check: PassMIT
Grok Buildsickn33/agentic-awesome-skills47k1 repos~1.8kAutomated safety check: PassApache-2.0
OpenCLI Adapter Autofixjackwener/OpenCLI30k1 repos~3.2kAutomated safety check: PassApache-2.0

Similar skills

  • Grok Media

    calesthio/OpenMontage

    xAI Grok image and video generation guide covering authentication, endpoints, prompt structure, image editing, reference-image video, and async polling.

    65k GitHub stars~950 tokensUpdated 5 days ago
    Media & CreativeAuto-check passed
  • OpenCLI Usage Map

    jackwener/OpenCLI

    Orients an agent on OpenCLI, which turns websites and Electron apps into opencli site-command calls, covering adapters, strategies, install and which skill to load next.

    30k GitHub starsUsed in 1 repo~2.3k tokens
    Productivity & AutomationAuto-check passed
  • Grok Delegate

    sickn33/agentic-awesome-skills

    Delegate coding tasks to the Grok Build CLI only when the user explicitly requests it, while the orchestrator retains review and landing responsibility.

    47k GitHub starsUsed in 1 repo~2.6k tokens
    Auto-check passed
  • Grok Build

    sickn33/agentic-awesome-skills

    Delegate well-specified implementation tasks to xAI's Grok Build CLI running headlessly while the orchestrating agent plans, writes task specs, reviews every diff, and owns the result.

    47k GitHub starsUsed in 1 repo~1.8k tokens
    Agent WorkflowsAuto-check passed
  • OpenCLI Adapter Autofix

    jackwener/OpenCLI

    Repairs a broken OpenCLI site adapter after a command fails: collects a trace, patches only the adapter, retries, and files an upstream GitHub issue once fixed.

    30k GitHub starsUsed in 1 repo~3.2k tokens
    DevelopmentAuto-check passed
  • OpenCLI Browser Control

    jackwener/OpenCLI

    Drives a real Chrome window through the opencli CLI to inspect pages, fill forms, click through logged-in flows and extract data from structured command responses.

    30k GitHub starsUsed in 2 repos~7.3k tokens
    Productivity & AutomationAuto-check passed

More from majiayu000/spellbook

All 97 skills in this repo
  • Skill Ecosystem Doctor

    majiayu000/spellbook

    Audits and repairs how coding-agent Skills are owned, copied and exposed across runtimes, from canonical sources to quarantine and retirement.

    286 GitHub stars~3k tokensUpdated today
    Auto-check passed
  • AGENTS.md Scaffold

    majiayu000/spellbook

    Scans a repository for real evidence and proposes, or on request writes, a small stack of root and scoped AGENTS.md files with validation commands and generated-file boundaries.

    286 GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Product Demo Builder

    majiayu000/spellbook

    Plans, produces or diagnoses evidence-backed product demo videos: script, capture plan, pacing checks and verified final media built on real product behavior.

    286 GitHub stars~3.3k tokensUpdated today
    Auto-check passed
  • Flowguard Task Guard

    majiayu000/spellbook

    Single entry point that routes long or ambiguous agent tasks, checks live state, bounds autonomous loops and leaves a resumable handoff.

    286 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • npm Supply Chain Check

    majiayu000/spellbook

    Scans a repository, its lockfiles and node_modules for known malicious npm package versions and install-time indicators, using a read-only Python scanner.

    286 GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Product Manager Toolkit

    majiayu000/spellbook

    Product management helpers: a RICE scoring script, an interview transcript analyzer and PRD templates for prioritizing features, synthesizing research and writing requirements.

    286 GitHub stars~2.2k tokensUpdated today
    Auto-check passed

Questions about Ask Opencli

What does Ask Opencli do?

Ask Grok or Gemini via opencli (browser-session based, no API cost). Ask Opencli is an agent skill from majiayu000/spellbook. Ask Grok or Gemini via opencli (browser-session based, no API cost).

When should I use Ask Opencli?

Ask Opencli fits situations like: the user says 问 grok; wants a second opinion from Grok/Gemini without paying API tokens.

How do I install Ask Opencli in Claude Code?

Run `npx skills add majiayu000/spellbook --skill ask-opencli -a claude-code`. Or copy the skill folder (skills/ask-opencli in majiayu000/spellbook) into .claude/skills/ask-opencli in your project. Claude Code loads it when a task matches its description.

How do I install Ask Opencli in Codex?

Run `npx skills add majiayu000/spellbook --skill ask-opencli -a codex`. Or copy the skill folder (skills/ask-opencli in majiayu000/spellbook) into .agents/skills/ask-opencli in your project. Codex loads it when a task matches its description.

Can I use Ask Opencli in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add majiayu000/spellbook --skill ask-opencli -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ask-opencli, .gemini/skills/ask-opencli, .github/skills/ask-opencli and .opencode/skills/ask-opencli in your project.

What does Ask Opencli need to run?

Going by SKILL.md and its folder, Ask Opencli needs the command-line tools its instructions call (npm and gemini). Our summary lists: Node.js.

Does Ask Opencli access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Ask Opencli safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Ask Opencli use?

Ask Opencli is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Ask Opencli use?

About 1.9k tokens (SKILL.md is roughly 7.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Ask Opencli?

Skills that share tags, products or a category with Ask Opencli: Grok Media (calesthio/OpenMontage, 65k stars), OpenCLI Usage Map (jackwener/OpenCLI, 30k stars), Grok Delegate (sickn33/agentic-awesome-skills, 47k stars) and Grok Build (sickn33/agentic-awesome-skills, 47k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Ask Opencli?

majiayu000 (a GitHub user) maintains it in majiayu000/spellbook, which has 286 GitHub stars. The repository holds 97 skills in this directory. The repository was last updated on October 8, 2026.

Source: majiayu000/spellbook on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.