{"id":"e9369aa9-daaa-4cac-a9df-3a9971f1626d","shortId":"bThmUC","kind":"skill","title":"ask-opencli","tagline":"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 ","description":"# Ask via OpenCLI (Grok / Gemini)\n\nUse `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.\n\n> **opencli 项目**：https://github.com/jackwener/opencli\n> **安装**：`npm install -g @jackwener/opencli`（需要 Node ≥20）\n> **首次运行**：`opencli doctor` 会自动引导安装 Chrome Browser Bridge 扩展\n> **登录**：用装了扩展的 Chrome profile 打开 grok.com 和 gemini.google.com 登录一次\n> **必须环境变量**：`export OPENCLI_BROWSER_COMMAND_TIMEOUT=300`（写进 shell rc）\n> **更深度的多 AI 并行调研工作流**：use the `multi-ai-research` skill instead\n\n**When to trigger**:\n- User explicitly asks to query Grok or Gemini (\"问一下 grok\", \"用 gemini 查\", \"让 grok 看看\")\n- User wants a second opinion / external advisor from Grok or Gemini\n- User says \"ask grok\"/\"ask gemini\" or mentions these two as the information source\n\n**When NOT to trigger**:\n- User wants to use native Gemini CLI (`gemini -p`) → use `ask-gemini` skill instead\n- User wants Claude's own opinion → answer directly\n- User wants other AI (Doubao, Yuanbao, ChatGPT, etc.) → use other tools\n\n## Model selection\n\nIf 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.\n\nIf still ambiguous, ask the user which one to use before sending.\n\n## ⚠️ 常见错误命令（直接 fail fast）\n\n| ❌ 错误 | ✅ 正确 | 原因 |\n|---|---|---|\n| `opencli gemini chat \"...\"` | `opencli gemini ask \"...\"` | 没有 `chat` 子命令 |\n| `opencli grok chat \"...\"` | `opencli grok ask \"...\"` | 只有 `ask` 子命令 |\n| `opencli grok new` | `opencli grok ask \"...\" --new true` | grok 的\"新对话\"是 `ask` 的参数 |\n| `opencli gemini query \"...\"` | `opencli gemini ask \"...\"` | 没有 `query` 子命令 |\n\n**完整子命令速查**（运行 `opencli grok --help` 或 `opencli gemini --help` 查看）：\n\n```\nGrok:\n  ask <prompt>                    # 唯一命令\n\nGemini:\n  ask <prompt>                    # 最常用\n  new                             # 开新对话\n  deep-research <prompt>          # Deep Research 模式\n  deep-research-result [query]    # 取 Deep Research 结果\n  image <prompt>                  # 图片生成\n```\n\n## ⚠️ Critical: Two-layer timeout (from 2026-04-08 debugging)\n\nopencli has **two independent timeout layers**, both must be set for grok to wait long enough:\n\n1. **Inner**: `--timeout 300` — grok.com web response wait time\n2. **Outer**: `OPENCLI_BROWSER_COMMAND_TIMEOUT=300` environment variable — entire browser command execution timeout (**default 60s**, hardcoded in `runtime.js:25`)\n\nThe outer takes **priority over** the inner. Setting only `--timeout 300` still gets killed at 60s. You MUST set both.\n\nSource code: `.omx/reference/opencli/dist/src/runtime.js:25`:\n```js\nexport const DEFAULT_BROWSER_COMMAND_TIMEOUT = parseEnvTimeout('OPENCLI_BROWSER_COMMAND_TIMEOUT', 60);\n```\n\n**Recommended**: add `export OPENCLI_BROWSER_COMMAND_TIMEOUT=300` to `~/.zshrc` so every grok/gemini call has room to breathe.\n\n## Commands\n\n### Grok (MANDATORY env var)\n\n```bash\nOPENCLI_BROWSER_COMMAND_TIMEOUT=300 opencli grok ask \"{{PROMPT}}\" --timeout 300 -f json\n```\n\nOr if env var already exported in shell:\n```bash\nopencli grok ask \"{{PROMPT}}\" --timeout 300 -f json\n```\n\nFlags:\n- `--new true` — start a fresh chat (avoids polluting prior conversation context)\n- `--web true` — use the hardened grok.com consumer web flow (better error messages)\n- `--timeout 300` — MUST match or be lower than `OPENCLI_BROWSER_COMMAND_TIMEOUT`\n- `-f json` — structured output (recommended over `--format plain` for parsing)\n\n### Gemini\n\n```bash\nopencli gemini ask \"{{PROMPT}}\" --format plain\n```\n\nGemini is more stable than grok and usually doesn't hit the 60s timeout. No env var required but adding it doesn't hurt:\n\n```bash\nOPENCLI_BROWSER_COMMAND_TIMEOUT=300 opencli gemini ask \"{{PROMPT}}\" --format plain\n```\n\nFlags:\n- `--new true` — start a fresh chat\n- `--timeout 90` — extend timeout for long answers (default 60s)\n\n### Parallel dispatch (for multi-AI workflows)\n\nTo 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.\n\nFor 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.\n\n## Prerequisites (check before running)\n\n1. **opencli installed**: `opencli --version` should print a version.\n2. **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.\n3. **Logged in to the target site**:\n   - Grok: `grok.com` must be logged in\n   - Gemini: `gemini.google.com` must be logged in\n4. **Daemon connectivity**: run `opencli doctor` once per session if unsure.\n\nIf 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).\n\n## Execution protocol\n\n1. Decide which model to use (Grok vs Gemini). If unclear, ask.\n2. Build the prompt. Be explicit — these browser UIs have no system prompt so the full question must be self-contained.\n3. Run the opencli command with `--format plain`.\n4. 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.\n5. Save an artifact (see below).\n6. Report back to the user: model used, summary of response, and path to the artifact.\n\n## Error handling\n\nopencli will emit specific errors like:\n- \"Not logged in to grok.com\" → ask user to log in\n- \"Composer not found\" → DOM changed, ask user to open the site manually and retry\n- \"Session gated / challenge\" → user needs to solve the challenge in Chrome manually\n- Timeout → offer to retry with a longer `--timeout`\n\nDo not swallow these. Report verbatim with the fix action.\n\n## Artifact requirement\n\nAfter every successful call, save a markdown artifact to:\n\n```\n.omx/artifacts/ask-opencli-<grok|gemini>-<slug>-<YYYYMMDD-HHMMSS>.md\n```\n\nMinimum sections:\n1. **Original user task** — what the user asked you\n2. **Model** — grok or gemini, plus any flags used (--new, --web, --timeout)\n3. **Final prompt sent** — the exact string passed to `opencli ... ask`\n4. **Raw response** — the full output from opencli\n5. **Summary** — 2-3 bullets distilling the key points\n6. **Action items / next steps** — what to do with this information\n\nKeep the artifact even when the response is low quality — it documents that the query was made.\n\n## Examples\n\n```bash\n# Quick factual question, Grok default path\nopencli grok ask \"最新的 Claude 4.6 定价和 4.5 有什么差别？\" --format plain\n\n# Long reasoning task, Gemini with extended timeout + fresh chat\nopencli gemini ask \"分析这段 Rust 代码的并发安全问题：...\" --new true --timeout 120 --format plain\n\n# Grok hardened web path with new chat\nopencli grok ask \"X 上这两天关于 agent framework 的讨论焦点是什么？\" --web true --new true --format plain\n```\n\nTask: {{ARGUMENTS}}","tags":["ask","opencli","claude","arsenal","majiayu000","agent-skills","ai-agents","ai-coding-assistant","automation","claude-code","code-review","developer-tools"],"capabilities":["skill","source-majiayu000","skill-ask-opencli","topic-agent-skills","topic-ai-agents","topic-ai-coding-assistant","topic-automation","topic-claude","topic-claude-code","topic-code-review","topic-developer-tools","topic-devops","topic-productivity","topic-prompt-engineering","topic-python"],"categories":["claude-arsenal"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/majiayu000/claude-arsenal/ask-opencli","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add majiayu000/claude-arsenal","source_repo":"https://github.com/majiayu000/claude-arsenal","install_from":"skills.sh"}},"qualityScore":"0.464","qualityRationale":"deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 29 github stars · SKILL.md body (7,112 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-01T07:01:12.245Z","embedding":null,"createdAt":"2026-04-18T22:23:59.290Z","updatedAt":"2026-05-01T07:01:12.245Z","lastSeenAt":"2026-05-01T07:01:12.245Z","tsv":"'-04':356 '-08':357 '-23':777 '-3':995 '/.zshrc':449 '/desktop/code/ai/tools/opencli/extension':705 '/jackwener/opencli':90 '1':375,683,785,952 '120':1066 '2':384,658,692,797,961,994 '20':98 '2026':355 '25':426 '3':722,819,973 '300':122,378,390,413,447,468,474,491,519,577 '4':741,827,984 '4.5':1044 '4.6':1042 '5':851,992 '6':857,1001 '60':439 '60s':399,418,560,599 '90':592 'action':934,1002 'ad':567 'add':441 'advisor':162 'agent':657,1081 'ai':127,133,211,605,660,669 'alreadi':71,481 'already-logged-in':70 'ambigu':256 'analysi':253 'anoth':761 'answer':206,597 'api':15,47,77 'argument':1091 'artifact':854,872,935,944,1014 'ask':2,4,26,28,54,142,169,171,196,257,278,287,289,296,303,310,325,328,471,488,544,580,769,796,886,896,959,983,1039,1059,1078 'ask-gemini':195 'ask-openc':1 'assist':632 'avoid':501 'back':759,859 'background':624 'base':13 'bash':463,485,541,572,619,1030 'better':515 'blind':850 'breath':457 'bridg':105,697 'browser':11,84,104,119,387,394,431,436,444,465,527,574,696,804 'browser-sess':10 'build':798 'bullet':996 'call':453,608,628,940 'captur':828 'challeng':907,913 'chang':895 'chat':275,280,284,500,590,1056,1075 'chatgpt':214 'check':680,754 'chrome':74,103,109,693,915 'claud':202,615,634,1041 'cli':191 'code':250,424,616,635 'command':120,388,395,432,437,445,458,466,528,575,823,833 'complet':645 'compos':891 'concurr':639 'confid':662 'confidence-ti':661 'connect':743 'const':429 'consum':512 'contain':818 'context':505 'convers':504 'cost':16,78 'cover':674 'critic':349 'cross':650 'cross-valid':649 'daemon':742 'debug':358 'decid':786 'deep':333,335,339,344,648 'deep-research':332 'deep-research-result':338 'default':229,398,430,598,1035 'degrad':781 'develop':708 'direct':207 'dispatch':601 'distil':997 'doctor':101,718,746 'document':252,1023 'doesn':224,556,569 'dom':894 'doubao':212 'drive':53 'driven':80 'emit':877 'enough':374 'entir':393 'env':461,479,563 'environ':391 'error':516,843,873,879 'etc':215 'even':1015 'everi':451,938 'exact':978 'exampl':1029 'execut':396,783 'exist':83 'explicit':141,802 'export':117,428,442,482 'extend':593,1053 'extens':698,701,707,714 'extern':161,659 'f':475,492,530 'factual':1032 'fail':268,755,834 'fall':758 'fast':269 'final':974 'fix':773,933 'flag':494,584,720,968 'flow':514 'form':247 'format':536,546,582,825,1046,1067,1088 'found':893 'framework':1082 'fresh':499,589,1055 'full':676,812,988 'fulli':79 'g':94 'gate':906 'gemini':7,25,29,36,58,65,147,151,166,172,190,192,197,243,274,277,306,309,321,327,540,543,548,579,611,735,793,948,965,1051,1058 'gemini.google.com':114,736 'get':415 'github.com':89 'github.com/jackwener/opencli':88 'grok':5,23,27,31,33,57,63,145,149,154,164,170,231,283,286,292,295,299,317,324,370,459,470,487,553,609,729,791,947,963,1034,1038,1069,1077 'grok.com':112,379,511,730,885 'grok/gemini':44,452 'handl':874 'hardcod':400 'harden':510,1070 'help':318,322 'hit':558 'hurt':571 'imag':347 'independ':362 'inform':179,1011 'inner':376,409 'instal':93,685,703 'instead':136,199,672 'intern':654 'item':1003 'jackwener/opencli':95 'js':427 'json':476,493,531 'keep':1012 'key':999 'kill':416 'launch':637 'layer':352,364 'like':880 'load':699,710 'log':72,723,733,739,882,889 'long':246,373,596,1048 'long-form':245 'longer':923 'low':1020 'lower':524 'made':1028 'mandatori':460 'manual':902,916 'markdown':943 'match':521 'md':949 'mention':174 'messag':517,838 'minimum':950 'miss':716,766 'mode':709 'model':219,228,788,863,962 'multi':132,604,668 'multi-ai':603 'multi-ai-research':131,667 'must':366,420,520,731,737,814 'n':653 'nativ':189 'need':909 'new':293,297,330,495,585,970,1063,1074,1086 'news':237 'next':1004 'no-silent-degrad':778 'node':97 'notif':646 'npm':92 'offer':918 'omx/artifacts/ask-opencli-':946 'omx/reference/opencli/dist/src/runtime.js':425 'one':261 'open':899 'openc':3,9,51,56,60,86,100,118,273,276,282,285,291,294,305,308,316,320,359,386,435,443,464,469,486,526,542,573,578,684,686,717,745,822,875,982,991,1037,1057,1076 'opinion':42,160,205 'orchestr':677 'origin':953 'outer':385,404 'output':533,989 'p':193 'parallel':600,613 'pars':539 'parseenvtimeout':434 'pass':980 'path':869,1036,1072 'pattern':678 'pay':46 'per':748,775 'plain':537,547,583,826,1047,1068,1089 'plus':966 'point':1000 'pollut':502 'prerequisit':679,767 'print':689 'prior':503 'prioriti':406 'profil':110 'prompt':472,489,545,581,800,809,975 'protocol':784 'qualiti':1021 'queri':62,144,307,312,342,1026 'question':241,813,1033 'quick':1031 'raw':985 'rc':125 'real':234 'real-tim':233 'reason':248,1049 'recommend':440,534 'report':764,858,929 'requir':565,936 'research':134,249,334,336,340,345,670 'respons':381,830,867,986,1018 'result':341 'retri':849,904,920 'room':455 'rout':49 'rule':782 'run':622,682,694,744,820 'runtime.js:25':402 'rust':1061 'save':852,941 'say':21,168 'second':41,159 'section':951 'see':855 'select':220 'self':817 'self-contain':816 'send':265 'sent':976 'session':12,75,85,749,905 'session/auth/challenge':837 'set':368,410,421 'shell':124,484 'silent':763,780 'site':728,901 'skill':135,198,671 'skill-ask-opencli' 'social':236 'solv':911 'sourc':180,423 'source-majiayu000' 'specif':878 'specifi':226 'stabl':551 'start':497,587 'step':1005 'still':255,414 'stop':839 'string':979 'structur':532 'sub':656 'sub-ag':655 'success':939 'summari':865,993 'surfac':841 'swallow':927 'synthesi':664 'system':808 'take':405 'target':727 'task':644,955,1050,1090 'task-complet':643 'tech':239 'tech-trend':238 'tier':663 'time':235,383 'timeout':121,353,363,377,389,397,412,433,438,446,467,473,490,518,529,561,576,591,594,917,924,972,1054,1065 'token':48 'tool':218,620,762 'topic-agent-skills' 'topic-ai-agents' 'topic-ai-coding-assistant' 'topic-automation' 'topic-claude' 'topic-claude-code' 'topic-code-review' 'topic-developer-tools' 'topic-devops' 'topic-productivity' 'topic-prompt-engineering' 'topic-python' 'trend':240 'trigger':139,184 'true':298,496,507,586,625,1064,1085,1087 'turn':633 'two':176,351,361 'two-lay':350 'u':776 'ui':805 'unclear':795 'unpack':711 'unsur':751 'use':17,59,129,188,194,216,263,508,617,665,790,864,969 'user':20,68,140,156,167,185,200,208,223,259,771,846,862,887,897,908,954,958 'usual':555 'valid':651 'var':462,480,564 'variabl':392 'verbatim':930 'version':687,691 'via':8,55,706 'vs':792 'wait':372,382,641 'want':39,157,186,201,209 'web':380,506,513,971,1071,1084 'without':45 'workflow':606,652 'x':1079 'yuanbao':213 'zero':76 '上这两天关于':1080 '代码的并发安全问题':1062 '会自动引导安装':102 '写进':123 '分析':37 '分析这段':1060 '原因':272 '取':343 '只有':288 '和':113 '唯一命令':326 '图片生成':348 '子命令':281,290,313 '安装':91 '完整子命令速查':314 '定价和':1043 '常见错误命令':266 '并行调研工作流':128 '开新对话':331 '必须环境变量':116 '怎么看':34 '或':319 '打开':111 '扩展':106 '新对话':301 '是':302 '更深度的多':126 '最常用':329 '最新的':1040 '有什么差别':1045 '查':32,152 '查看':323 '模式':337 '正确':271 '没有':279,311 '用':30,150 '用装了扩展的':108 '登录':107 '登录一次':115 '的':300 '的参数':304 '的讨论焦点是什么':1083 '直接':267 '看看':155 '结果':346 '让':35,153 '运行':315 '错误':270 '问':22,24 '问一下':148 '需要':96 '项目':87 '首次运行':99","prices":[{"id":"453b0954-e200-446c-bfd7-16fcd966de9e","listingId":"e9369aa9-daaa-4cac-a9df-3a9971f1626d","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"majiayu000","category":"claude-arsenal","install_from":"skills.sh"},"createdAt":"2026-04-18T22:23:59.290Z"}],"sources":[{"listingId":"e9369aa9-daaa-4cac-a9df-3a9971f1626d","source":"github","sourceId":"majiayu000/claude-arsenal/ask-opencli","sourceUrl":"https://github.com/majiayu000/claude-arsenal/tree/main/skills/ask-opencli","isPrimary":false,"firstSeenAt":"2026-04-18T22:23:59.290Z","lastSeenAt":"2026-05-01T07:01:12.245Z"}],"details":{"listingId":"e9369aa9-daaa-4cac-a9df-3a9971f1626d","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"majiayu000","slug":"ask-opencli","github":{"repo":"majiayu000/claude-arsenal","stars":29,"topics":["agent-skills","ai-agents","ai-coding-assistant","automation","claude","claude-code","code-review","developer-tools","devops","productivity","prompt-engineering","python","software-development","typescript","workflows"],"license":"mit","html_url":"https://github.com/majiayu000/claude-arsenal","pushed_at":"2026-04-29T04:12:22Z","description":"52 production-ready Claude Code skills and 7 specialized agents for software development, DevOps, product workflows, and automation.","skill_md_sha":"94ec712e938c38659836dd9d46361816a2396812","skill_md_path":"skills/ask-opencli/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/majiayu000/claude-arsenal/tree/main/skills/ask-opencli"},"layout":"multi","source":"github","category":"claude-arsenal","frontmatter":{"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."},"skills_sh_url":"https://skills.sh/majiayu000/claude-arsenal/ask-opencli"},"updatedAt":"2026-05-01T07:01:12.245Z"}}