| name | second-opinion |
| description | Reference for invoking external AI coding CLIs non-interactively (Gemini CLI, OpenAI Codex CLI, Grok CLI, Aider, Warp, vibe-tools/cursor-tools) to gather an independent second opinion, plus install hints and auth requirements. Use when the user wants cross-model review, consensus, an alternative approach, or to "ask another AI". |
Second Opinion — external AI CLI reference
This skill teaches how to drive other AI coding assistants from the shell, in
non-interactive (headless) mode, so Claude Code can collect independent opinions
and synthesize them. The companion /second-opinion command orchestrates the flow;
this file is the per-tool detail.
Golden rules
- Probe before use:
command -v <tool>. Only use what's installed.
- Verify flags live: flags change between versions — run
<tool> --help
before composing the real call. Treat the tables below as the expected form.
- Stay headless: always use the one-shot/print/exec flag so the tool answers
and exits. Never drop into an interactive REPL from within a command.
- Self-contained prompts: external tools don't see this conversation. Put the
question + code/diff + desired output format in the prompt.
- Guard the call: wrap with
timeout, handle missing API keys gracefully, and
never let one tool's failure abort the others.
- Attribute: in the synthesis, say which tool said what, and keep your own
independent judgment.
Tool: Gemini CLI (gemini)
Google's open-source terminal agent for the Gemini models.
- Headless / non-interactive:
gemini -p "PROMPT" (also --prompt). Piping
works: cat diff.txt | gemini -p "Review this diff for bugs".
- Model:
-m gemini-2.5-pro (or -m gemini-2.5-flash for speed/cost).
- Auto-approve tools (use with care):
-y / --yolo.
- Auth:
GEMINI_API_KEY env var (AI Studio key), or an interactive Google
login the user has already done. If unauthenticated it will error — report and
skip.
- Install:
npm install -g @google/gemini-cli then run gemini.
Good for: fast general second opinions, large-context reasoning, and reading files
you point it at.
Tool: OpenAI Codex CLI (codex)
OpenAI's open-source coding agent.
- Headless / non-interactive:
codex exec "PROMPT" (the exec subcommand runs
to completion and prints, no TUI). On older builds the flag was -q/--quiet:
codex -q "PROMPT". Confirm with codex exec --help.
- Model:
-m <model> (e.g. a current GPT/o-series coding model).
- Sandbox/approvals:
exec runs non-interactively; review its --help for
--full-auto / approval and sandbox flags before granting write access.
- Auth:
codex login, or OPENAI_API_KEY in the environment.
- Install:
npm install -g @openai/codex (or brew install codex).
Good for: strong code reasoning and an opinion from a non-Google, non-Anthropic
model — valuable independence for consensus.
Tool: Grok CLI — Grok Build (grok)
xAI's official terminal coding agent, Grok Build
(binary grok), an agentic CLI in the same class as Claude Code / Codex. Prefer
this over third-party Grok CLIs (e.g. @vibe-kit/grok-cli).
- Headless / non-interactive:
grok -p "PROMPT" runs one-shot without the TUI
and prints the result. Add --output-format text|json|streaming-json for
machine-readable output. Verify with grok --help as flags evolve.
- CI-friendly flags:
--no-auto-update (skip background update checks) and
--always-approve (skip interactive approvals) for scripts/CI.
- Model: runs on xAI's purpose-built
grok-build-0.1 by default; a --model
flag may be available — check grok --help.
- Auth: interactive browser sign-in on first
grok launch (SuperGrok / X
Premium+). For headless servers / CI, set GROK_CODE_XAI_API_KEY="xai-..."
(an XAI_API_KEY from the xAI developer console).
- Install:
curl -fsSL https://x.ai/cli/install.sh | bash — puts a grok
binary on your PATH.
- Fallback: if the CLI is absent but
XAI_API_KEY is set, you may call the xAI
REST API with curl (OpenAI-compatible /v1/chat/completions on api.x.ai).
Good for: a third independent model family; Grok often has a distinct style/opinion.
Tool: Aider (aider)
Open-source AI pair programmer that edits files in your git repo.
- Opinion only (no edits) — preferred:
aider --message "PROMPT" --chat-mode ask.
The ask chat mode answers questions and discusses without touching files, and
--message runs once and exits. This is the right mode for a second opinion.
- One-shot message:
aider --message "PROMPT" (alias -m) runs once and exits.
Add --yes-always to auto-confirm prompts.
- Model:
--model <name> (Aider supports many providers via LiteLLM).
- ⚠ Aider edits files. Without
--chat-mode ask, even a single --message can
change the working tree and (unless disabled) commit. If you want Aider's actual
proposed implementation as its "opinion":
- add
--no-auto-commits (review with git diff, then revert if unwanted), or
- run it against a throwaway copy of the repo.
- Auth: provider key for the chosen model (
OPENAI_API_KEY,
ANTHROPIC_API_KEY, GEMINI_API_KEY, …).
- Install:
python -m pip install aider-install && aider-install, or
pipx install aider-chat.
Good for: "show me how you would implement/refactor this" — Aider returns an
actual concrete diff as its opinion.
Tool: Warp — Oz CLI (oz)
Warp is an agentic development environment with built-in AI agents. Its headless
command-line interface is the Oz CLI (oz), made for running agents from
scripts, CI, and remote machines.
- Headless / non-interactive:
oz agent run --prompt "PROMPT".
- Output format:
--output-format text or --output-format json for
machine-readable results.
- Remote execution:
oz agent run-cloud --prompt "PROMPT" runs the agent on a
standardized remote machine instead of locally.
- Auth: interactive Warp login, or
WARP_API_KEY="wk-..." in the environment for
headless/CI use.
- Note: the binary is
oz, not warp. If command -v oz fails (older Warp, or
Oz CLI not installed), skip Warp rather than guessing flags.
Good for: a second opinion from Warp's agent, especially when the user already lives
in Warp.
Tool: vibe-tools / cursor-tools (vibe-tools)
vibe-tools (formerly cursor-tools) is purpose-built to let an agent ask other
providers — it's almost tailor-made for second opinions.
- Ask any provider:
vibe-tools ask "PROMPT" --provider openai --model <m>
(providers include openai, anthropic, gemini, perplexity, xai, …).
- Repo-aware (whole-codebase context):
vibe-tools repo "PROMPT" — sends repo
context (commonly via Gemini's large context window) so the opinion is grounded in
real code. Great for "review my architecture" questions.
- Web research:
vibe-tools web "PROMPT" for an internet-grounded answer.
- Plan:
vibe-tools plan "PROMPT" to get an implementation plan from another
model.
- Auth: keys for whichever providers you target (
OPENAI_API_KEY,
GEMINI_API_KEY, PERPLEXITY_API_KEY, XAI_API_KEY, …), configured via its
.vibe-tools.env / cursor-tools.env.
- Install:
npm install -g vibe-tools then vibe-tools install to set up keys.
Good for: one wrapper that fans out to several providers, and for repo-grounded
second opinions without manually pasting code.
Other fallbacks
llm (Simon Willison's CLI): llm -m <model> "PROMPT" — supports many
providers via plugins. Handy generic second-opinion source.
ollama: ollama run <model> "PROMPT" — a local model second opinion, no
API key/network needed (quality depends on the local model).
- Raw API via
curl: if a vendor CLI is missing but its key is present, call the
OpenAI-compatible endpoint directly.
Synthesis checklist
After collecting responses:
- Note each tool + model and its core take.
- Separate agreement (strong signal) from disagreement (investigate).
- Compare against your own analysis — independence is the whole value.
- Give a clear recommendation + confidence, and flag unverifiable claims.