The 2ndOpinion CLI

Get instant risk analysis from Claude, Codex, and Gemini on every code change. Auto-fix issues with one command, or run all three models in consensus mode.

$npm install -g 2ndopinion-cli

Free · 5 credits/month · No credit card required

~/my-project
$ 2ndopinion
━━●
━━●
2ndOpinion v0.7.0
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
What would you like to do?
> Analyze my changes (staged + unstaged)
Watch for changes (continuous monitoring)
Fix issues (auto-fix detected risks)
Review a PR (review a GitHub PR)
Account & Settings (status, config, upgrade)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Use arrow keys, then Enter to select.
$ 2ndopinion
━━●
━━●
2ndOpinion v0.7.0
Consensus Analysis
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Model Results
Claude Sonnet 4 Review
Adds user endpoint without rate limiting.
Risks: 1 medium 1 low
Codex Review
New route lacks input validation on body.
Risks: 1 high 1 medium
Gemini 1.5 Pro Accept
Clean implementation, follows conventions.
Risks: 1 low
───────────────────────────────────
Agreements (1)
MEDIUM [Security] Missing input validation — flagged by Claude and GPT
⚠️ Disagreements (1)
HIGH [Security] Only GPT flagged: No rate limiting on new endpoint
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Final: Review (worst-case across all models)
Usage: 3/500 credits this month · Power
$ 2ndopinion fix
━━●
━━●
2ndOpinion v0.7.0
3 risks found · 3 fixes available
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Fix 1/3 src/api/route.ts
MEDIUM: Missing input validation on request body
───────────────────────────────────
- const data = req.body;
+ const data = schema.parse(req.body);
- await db.insert(data);
+ await db.insert(sanitize(data));
───────────────────────────────────
[Y] Accept [N] Skip [A] All [Q] Quit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Applied 3 fixes · Backup created
Run 2ndopinion undo to revert
$ 2ndopinion review --pr 47 --post
━━●
━━●
2ndOpinion v0.7.0
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PR #47 Add user settings endpoint
feat/user-settings main · 4 files (+89/-12)
───────────────────────────────────
Codex Review
New route lacks rate limiting and input validation.
Risks: 1 high 1 medium 1 low
───────────────────────────────────
Risk Score: 5.0/10
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Posted review comment to PR #47
Usage: 4/100 this month · Pro 100
$ 2ndopinion watch
━━●
━━●
2ndOpinion Watch
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Change detected · 2 files modified
Codex Review
New endpoint missing authentication middleware.
Risks: 1 high 1 medium
───────────────────────────────────
Review recommended
Watching for changes...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Usage: 7/100 · LLM: codex · Analyzed: 3 · Risks: 5 · Ctrl+C to stop

All commands

Everything runs from your terminal.

2ndopinionSmart default: analyze if changes exist, or show interactive menu
2ndopinion menuOpen the interactive command hub
2ndopinion analyzeAnalyze current changes (staged + unstaged)
2ndopinion fixAuto-fix risks with interactive review
2ndopinion undoRevert the last round of auto-fixes
2ndopinion review --pr <N>Review a GitHub Pull Request
2ndopinion review --postPost review as a PR comment
2ndopinion watchContinuous monitoring on file changes
2ndopinion --llm claude|codex|geminiChoose which LLM to use
2ndopinion --context-depth minimal|standard|fullControl how much context is gathered
2ndopinion --no-contextSkip context gathering (send diff only)
2ndopinion auth githubConnect your GitHub account
2ndopinion signupCreate a new account
2ndopinion loginLog in to your account
2ndopinion statusCheck usage and subscription
2ndopinion upgradeUpgrade your plan
2ndopinion configShow current configuration
2ndopinion config --llm <name>Set default LLM
2ndopinion config --consensusToggle consensus mode (3-model analysis)
2ndopinion logoutLog out of your account
2ndopinion --quietSuppress splash screen (for scripting/CI)
2ndopinion --debugShow debug info (API requests, timing)
PR REVIEW

PR Review Agent

Review any GitHub Pull Request from your terminal. Fetches the PR diff, runs it through AI analysis, and optionally posts a formatted review comment with risk scores directly on the PR.

Auto-detect PR from branch
Post review to GitHub
Risk score thresholds for CI

Connect with 2ndopinion auth github — available on the Agent plan.

$ 2ndopinion review --post
────────────────────────────
PR #47 Add user settings
feat/settings main · 4 files
────────────────────────────
Codex Review
Missing rate limiting
────────────────────────────
Risk Score: 5.0/10
────────────────────────────
Posted to PR #47
AUTO-FIX

Auto-Fix Mode

Don't just find risks — fix them. Run 2ndopinion fix to analyze your changes, generate concrete patches, and review each one interactively before it touches your code.

Interactive Y/N/A review
Automatic file backups
One-command undo

Available on the Agent plan. Undo anytime with 2ndopinion undo.

$ 2ndopinion fix
────────────────────────────
Fix 1/3 api/route.ts
MEDIUM: Missing validation
────────────────────────────
- const data = body;
+ const data = schema.parse(body);
────────────────────────────
[Y] Accept [N] Skip [A] All
CONSENSUS

Consensus Mode

Query all three models in parallel and get a unified verdict. See where Claude, Codex, and Gemini agree on risks — and where they disagree. Agreements are high-confidence findings. Disagreements highlight edge cases worth investigating.

3 models, 1 request
Agreement & disagreement analysis
Worst-case recommendation

Enable with 2ndopinion config --consensus — available on the Power plan.

Claude Review
Codex Reject
Gemini Review
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2 agreements
⚠️ 1 disagreement
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Final: Reject

Built for developers who ship fast

Interactive Hub

Just run 2ndopinion — one command surfaces everything. Analyze, watch, fix, review PRs, or manage settings. No subcommands to memorize.

Multi-LLM Choice

Pick from Claude, Codex, or Gemini per request. Set a default or switch on the fly with --llm.

Watch Mode

Run 2ndopinion watch in a second terminal. Get automatic analysis every time your files change.

5-Category Risk Analysis

Risks are grouped into Security, Data Integrity, Error Handling, Performance, and Breaking Changes — with file references and fix suggestions.

PR Review Agent

Review any GitHub PR from your terminal with 2ndopinion review. Post risk scores as comments, set thresholds for CI, and auto-detect PRs from your branch.

Deep Context Gathering

Automatically gathers full file content, type definitions, test files, and project config alongside your diff. The LLM sees what your code actually does, not just what changed.

Auto-Fix Mode

Run 2ndopinion fix to generate and apply patches for detected risks. Review each fix interactively, with automatic backups and one-command undo.

Start catching bugs in 30 seconds

$npm install -g 2ndopinion-cli

Works with any language, any AI assistant, any git repo.