Open-source
/advisorslash command for any AI CLI — consult ChatGPT, Claude, Kimi, Qwen, Claude Code, Codex, Gemini, or any OpenRouter model without leaving your terminal.
Runs as a plugin inside Qwen CLI, Claude Code, Codex CLI, Gemini CLI, or OpenCode. Pick your host with --ai <name> at install time (speckit-style).
The advisor you consult can be any of: ChatGPT, Claude, Kimi, Qwen (web — Playwright), Claude Code, Codex CLI, Gemini CLI (local — child process), or any model on OpenRouter (HTTP — OpenAI-compatible API).
/advisor.select claude-code
/advisor Should I use StateFlow or SharedFlow for this ViewModel?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Claude Code says:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ Claude Code responded (1247 chars)
Preview: Use StateFlow when the UI always needs the latest value (e.g. screen state).
Use SharedFlow for events that should be consumed once (e.g. navigation, toasts)…
Full response saved to: ~/.claude/advisor-last-response.md
Say "show advisor response" to load the full reply.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The full reply stays out of your main chat context unless you explicitly ask for it — keeps your session lean during long tasks.
- 8 advisors total, three transports:
- Web (ChatGPT, Claude, Kimi, Qwen) — Playwright drives a real Chrome instance with a persistent profile; one login per advisor, sessions persist
- CLI (Claude Code, Codex, Gemini) —
child_process.spawnSyncruns the local binary; uses each tool's existing credentials - HTTP (OpenRouter) — direct call to
openrouter.ai/api/v1/chat/completions; pick any model OpenRouter exposes
- Switch any time with
/advisor.select - Every response is saved to
<host-dir>/advisor-last-response.md; only a 200-char preview is shown inline
- Node.js 18+
- One of the supported host CLIs (Qwen, Claude Code, Codex, Gemini, or OpenCode)
- Google Chrome installed (web advisors only — Playwright launches Chrome via
channel: 'chrome'; bundled Chromium and other browsers are not used) - An account on at least one advisor service
Should work on macOS, Linux, and Windows 11; the install flow is verified on Windows 11.
Only needed if you want to consult one of these as your advisor (you don't need them just to host the plugin):
| Advisor | Install command | Auth |
|---|---|---|
| Claude Code | npm i -g @anthropic-ai/claude-code |
Anthropic subscription |
| Codex CLI | npm i -g @openai/codex |
OpenAI API key |
| Gemini CLI | npm i -g @google/gemini-cli |
Google account |
git clone https://github.com/mohitsoni48/open-advisor.git
cd open-advisor
node install.mjs --ai <host><host> is one of:
--ai |
Install dir | Commands subdir | Context file |
|---|---|---|---|
qwen |
~/.qwen/ |
commands/ |
QWEN.md |
claude |
~/.claude/ |
commands/ |
CLAUDE.md |
codex |
~/.codex/ |
prompts/ |
AGENTS.md |
gemini |
~/.gemini/ |
commands/ |
GEMINI.md |
opencode |
~/.config/opencode/ |
command/ |
AGENTS.md |
all |
every dir above | — | — |
For each selected host the installer:
- Renders and copies
/advisor,/advisor.select,/advisor.setupinto the host's commands subdir - Copies
advisor-runner.jsandadvisor-context.mdinto the host dir - Writes the host's context file from the template, or appends an
## Advisorsection if one already exists - For
--ai qwenonly: also installs MCP packages globally and wires them into~/.qwen/settings.json(filesystem,sequential-thinking,memory,context7,web-search,browser,sqlite,github,code-runner)
The runner derives its host dir from __dirname at runtime — no path strings baked into source, no escape-character pitfalls on Windows.
--openrouter-key <KEY> # save OpenRouter API key for the `openrouter` advisor
--openrouter-model <ID> # e.g. anthropic/claude-3.5-sonnet (default openai/gpt-4o-mini)
--tavily-key <KEY> # Tavily API key, Qwen MCP only
--github-token <TOKEN> # GitHub token, Qwen MCP onlynode install.mjs --help for the full list. Anything skipped can be set later by editing the host dir.
After the installer finishes, restart your CLI host, then:
/advisor.select <name> # chatgpt | claude | kimi | qwen | claude-code | codex | gemini | openrouter
/advisor.setup # web advisors: browser login. CLI/HTTP: nothing to do.
What /advisor.setup does, by advisor type:
- Web (chatgpt/claude/kimi/qwen): opens Chrome at the advisor's URL so you can log in. Run
/advisor.setupagain afterward to confirm. The session is saved in<host-dir>/playwright-profile/and reused on every subsequent call. - CLI (claude-code/codex/gemini): verifies the binary is on your
PATH. No login needed. - HTTP (openrouter): no setup — the runner reads
OPENROUTER_API_KEYfrom your env, or<host-dir>/advisor-openrouter.jsonif you used--openrouter-keyat install time.
/advisor.select <name>
/advisor <your question>
Examples:
/advisor.select claude
/advisor In my Android ViewModel I need to combine a Room Flow with a SharedFlow from a Service. Should I use combine() or collectLatest?
/advisor Is it better to use a single Activity with multiple Fragments or multiple Activities for this flow?
/advisor I've been getting a NullPointerException in onResume but only on cold start. What should I check first?
Type "show advisor response" afterward to load the full reply into the chat (otherwise only the preview is shown).
- Before choosing between two non-obvious technical approaches
- When stuck on a bug after 2+ attempts
- Before a change that affects 5+ files or introduces a new pattern
- When the user asks "what do you think?" / "which is better?"
Skip it for trivial tasks (renames, formatting, single log lines) and for back-to-back turns on the same decision.
| Path (relative to host dir) | Purpose |
|---|---|
commands/advisor.md (or prompts/, command/) |
The /advisor slash command |
commands/advisor.select.md |
The /advisor.select slash command |
commands/advisor.setup.md |
The /advisor.setup slash command |
advisor-runner.js |
Standalone Playwright + spawn + HTTP script — handles every advisor type |
advisor-context.md |
Advisor guidance appended to the host's context file during setup |
advisor-active |
Plain-text file: name of the currently-selected advisor |
advisor-ready-<name> |
Empty marker file: this advisor is set up and ready |
advisor-last-response.md |
Full text of the most recent response (rewritten each call) |
advisor-openrouter.json |
OpenRouter API key + model (only if you configured one; chmod 0600 on POSIX) |
playwright-profile/ |
Shared persistent Chrome profile for web advisors |
| Name | Service | Endpoint | Type | Notes |
|---|---|---|---|---|
chatgpt |
OpenAI ChatGPT | chatgpt.com | Web | Uses temporary chat (not saved to history) |
claude |
Anthropic Claude | claude.ai/new | Web | Conversations saved to your history |
kimi |
Moonshot AI Kimi | kimi.com | Web | Conversations saved to your history |
qwen |
Alibaba Qwen | chat.qwen.ai | Web | Conversations saved to your history |
claude-code |
Anthropic Claude Code | claude -p <q> |
CLI | Requires subscription; runs locally |
codex |
OpenAI Codex CLI | codex exec <q> |
CLI | Requires API key; runs locally |
gemini |
Google Gemini CLI | gemini -p <q> |
CLI | Requires Google account; runs locally |
openrouter |
Any model via OpenRouter | openrouter.ai/api/v1 |
HTTP | OpenAI-compatible; usage is billed |
- Web advisors: Chrome opens minimized in the taskbar during each call (~2–3 second overhead). Headless mode is blocked by Cloudflare. Only ChatGPT supports temporary (unsaved) chats. If an advisor's DOM changes, the selectors in
advisor-runner.jswill need updating. - CLI advisors: Run synchronously via
child_process.spawnSyncwith a 90-second timeout. On Windows the runner usesshell: trueto invoke npm-installed.cmdshims; arguments are still passed as an array (no string interpolation, so questions with quotes/spaces are safe). - OpenRouter: Requires network + a valid API key. The runner does not stream — you wait for the full response (also bounded by the 90s timeout).
- Profile sharing: All web advisors share one Playwright profile (
<host-dir>/playwright-profile/). Cookies are domain-scoped, so they don't interfere — but logging out of one advisor in that profile won't affect others.