2ndopinion-cli
v0.9.0
Published
The first platform where Claude, Codex, and Gemini communicate with each other to review your code
Downloads
332
Maintainers
Readme
●━━●
└━━● 2ndOpinionThe first platform where Claude, Codex, and Gemini communicate with each other to review your code. 10+ AI-powered tools via MCP, REST API, and CLI.
Three Ways to Use
MCP Server (for Claude Code, Cursor, etc.)
Add to your claude_desktop_config.json:
{
"mcpServers": {
"2ndopinion": {
"command": "npx",
"args": ["-y", "2ndopinion-cli", "mcp"]
}
}
}Or with an API key (no CLI login required):
{
"mcpServers": {
"2ndopinion": {
"command": "npx",
"args": ["-y", "2ndopinion-cli", "mcp"],
"env": {
"SECONDOPINION_API_KEY": "sk_2op_your_key_here"
}
}
}
}Get your API key at get2ndopinion.dev/dashboard/keys.
All tools appear natively in your AI assistant's context.
CLI
npm install -g 2ndopinion-cli
2ndopinion signup # Create an account
2ndopinion # Analyze current git changes
2ndopinion fix # Auto-fix detected risks
2ndopinion watch # Continuous monitoringREST API
curl -X POST https://get2ndopinion.dev/api/gateway/opinion \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"diff": "...", "llm": "codex"}'Generate API keys with 2ndopinion keys create.
Tools
| Tool | Tier | Credits | Description | |------|------|---------|-------------| | Opinion | Free | 1 | Get a second AI opinion on any diff | | Review | Free | 1 | Code review with accept/review/reject verdicts | | Ask | Free | 1 | Ask any model a question about your code | | Explain | Free | 1 | Explain changes in plain language | | Status | Free | 0 | Check usage, limits, and feature access | | Feedback | Free | 0 | Rate findings to improve model accuracy | | Generate Tests | Pro+ | 1 | Generate test suites for your changes | | Consensus | Power+ | 3 | 3-model parallel review with agreement analysis | | Bug Hunt | Power+ | 3 | 3-model bug hunting with deduplication | | Security Audit | Power+ | 1–3 | OWASP security scan with CWE references | | Auto-Fix | Agent | 1 | AI-generated fixes for identified risks | | Debate | Agent | 5–7 | Multi-round AI debate between 2 models |
Every tool works across MCP, API, and CLI.
What Makes It Different
Confidence-Weighted Consensus — When 3 models review your code, they're not weighted equally. 2ndOpinion tracks which model is most accurate for each language and issue type, then weights the consensus by proven performance.
Smart Model Routing — Use --llm auto and the system picks the best model for your language based on real accuracy data. No guessing.
Pattern Memory — Known bug patterns are flagged instantly before the LLMs even run. When a pattern has been seen hundreds of times across the platform, you get an instant heads-up.
Regression Tracking — See what changed since your last analysis: "2 new issues introduced, 1 resolved." Your review has memory.
Project Context — Save your project's framework, dependencies, and structure once. Every subsequent analysis is tailored to YOUR codebase.
Custom Rules — Define rules in plain language ("Always flag eval()") and they're enforced on every analysis. Team rules are shared across all members.
Skills Marketplace
Build and sell custom AI tools. Encode your expertise as a reusable skill, set a price (1–20 credits per run), and earn 70% of every execution.
| Skill | Category | Credits | |-------|----------|---------| | Django Security Audit | Security | 3 | | React Hook Validator | React | 2 | | HIPAA Compliance Check | Compliance | 5 | | API Breaking Change Detector | API | 2 |
Browse and run skills at get2ndopinion.dev/marketplace.
Developer Platform
Build on the 2ndOpinion API with official SDKs, webhooks, batch processing, and streaming.
SDKs:
# JavaScript / TypeScript
npm install @2ndopinion/sdk
# Python
pip install 2ndopinionWebhooks — Real-time events (analysis.completed, skill.purchased, usage.threshold), HMAC-SHA256 signed.
Batch — Analyze up to 20 files per request via POST /api/gateway/batch.
Streaming — Real-time SSE results via POST /api/gateway/opinion/stream, /consensus/stream, /debate/stream.
Build a Skill:
curl -X POST https://get2ndopinion.dev/api/skills \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My Custom Audit",
"slug": "my-custom-audit",
"description": "Checks for common issues in Express.js apps",
"category": "security",
"creditCost": 3,
"executionMode": "consensus",
"systemPrompt": "You are a security auditor specializing in Express.js..."
}'Full developer docs at get2ndopinion.dev/docs/api.
CLI Commands
| Command | Description |
|---------|-------------|
| 2ndopinion | Smart default: analyze if changes exist, or show interactive menu |
| 2ndopinion mcp | Start the MCP server (for AI assistant integration) |
| 2ndopinion menu | Open the interactive command hub |
| 2ndopinion analyze | Analyze current changes (staged + unstaged) |
| 2ndopinion fix | Auto-fix risks with interactive review |
| 2ndopinion undo | Revert the last round of auto-fixes |
| 2ndopinion review --pr <N> | Review a GitHub Pull Request |
| 2ndopinion review --post | Post review as a PR comment |
| 2ndopinion watch | Continuous monitoring on file changes |
| 2ndopinion --llm claude\|codex\|gemini | Choose which LLM to use |
| 2ndopinion --llm auto | Auto-pick the best model for your language |
| 2ndopinion --context-depth minimal\|standard\|full | Control how much context is gathered |
| 2ndopinion auth github | Connect your GitHub account |
| 2ndopinion keys create | Create an API key for MCP/REST access |
| 2ndopinion keys list | List your API keys |
| 2ndopinion signup | Create a new account |
| 2ndopinion login | Log in to your account |
| 2ndopinion status | Check usage and subscription |
| 2ndopinion config --consensus | Toggle consensus mode (3-model analysis) |
| 2ndopinion upgrade | Upgrade your plan |
How It Works
- AI writes code — Write code however you like, with any AI assistant or by hand
- Three AIs cross-check it — Claude, Codex, and Gemini independently review the same diff. 2ndOpinion weights their findings by proven accuracy, checks against known bug patterns, and shows where they agree and disagree
- Ship with confidence — Get accept/review/reject verdicts, auto-fix issues, generate tests, or run a security audit before merging
Pricing
Individual:
| Plan | Credits/month | Price | Highlights | |------|--------------|-------|------------| | Free | 5 | $0 | Opinion, Review, Ask, Explain | | Pro | 100 | $10/mo | + Generate Tests | | Power | 500 | $25/mo | + Consensus, Bug Hunt, Security Audit | | Agent | 1,000 | $49/mo | + Debate, Auto-Fix, PR Review |
Teams:
| Plan | Credits/month | Price | Seats | Highlights | |------|--------------|-------|-------|------------| | Team | 2,500 | $99/mo | Up to 10 | Shared pool, team rules, all Agent tools | | Team Pro | 6,000 | $199/mo | Up to 25 | Everything in Team + priority support |
Teams share a credit pool. Every member's analysis makes the team's reviews smarter through collective pattern memory and shared rules.
Need more? Buy credit packs anytime: Starter (100 credits / $5), Builder (500 / $20), Scale (2,500 / $100).
All plans include access to Claude Sonnet 4, Codex, and Gemini 1.5 Pro via MCP, API, and CLI. Tools cost 1–7 credits depending on complexity.
FAQ
Is my code stored? No. Diffs are sent to the chosen LLM for analysis and discarded. We never store your source code.
Which LLMs are supported? Claude Sonnet 4 (Anthropic), Codex (OpenAI), and Gemini 1.5 Pro (Google).
Does it work with any language? Yes. If git can diff it, 2ndOpinion can review it.
Can I use it with Claude Code / Cursor / Copilot? Yes — add the MCP server config above, or run 2ndopinion watch in a separate terminal.
What's the difference between single-model and consensus? Single-model (1 credit) sends your diff to one LLM. Consensus (3 credits) sends it to all three and shows where they agree and disagree — with confidence weighting based on each model's historical accuracy.
What does "auto" do for --llm? It picks the best model for your language based on real performance data from thousands of analyses. If we don't have enough data for your language yet, it defaults to Claude.
Do teams share credits? Yes. Team plans have a shared credit pool. Any member can use credits and it deducts from the team total. You can see per-member usage in the team dashboard.
Full docs at get2ndopinion.dev
License
Proprietary. All rights reserved.
