Catalog npm
PACKAGE EXPLORERView in registry

2ndopinion-cli

npm

The first platform where Claude, Codex, and Gemini communicate with each other to review your code

aiclaudeclicode-reviewcodexdeveloper-toolsgeminigitllmmcp
Versions collected16
Direct dependencies20From release 0.12.0
Last observed20 Oct, 19:15 UTC

README

Current package documentation
  ●━━●
  └━━●  2ndOpinion

The 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.

npm version TypeScript Node.js


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 monitoring

REST API

curl -X POST https://get2ndopinion.dev/api/gateway/opinion \
  -H "X-2ndOpinion-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"diff": "...", "llm": "codex"}'

Generate API keys with 2ndopinion keys create.


Tools

ToolTierCreditsDescription
OpinionFree1Get a second AI opinion on any diff
ReviewFree1Code review with accept/review/reject verdicts
AskFree1Ask any model a question about your code
ExplainFree1Explain changes in plain language
StatusFree0Check usage, limits, and feature access
FeedbackFree0Rate findings to improve model accuracy
Generate TestsPro+1Generate test suites for your changes
ConsensusPower+33-model parallel review with agreement analysis
Bug HuntPower+33-model bug hunting with deduplication
Security AuditPower+1–3OWASP security scan with CWE references
Auto-FixAgent1AI-generated fixes for identified risks
DebateAgent5–7Multi-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.

SkillCategoryCredits
Django Security AuditSecurity3
React Hook ValidatorReact2
HIPAA Compliance CheckCompliance5
API Breaking Change DetectorAPI2

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 secondopinion-sdk

Webhooks — Real-time events (analysis.completed, analysis.high_risk, credits.low, skill.run.completed), 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

CommandDescription
2ndopinionSmart default: analyze if changes exist, or show interactive menu
2ndopinion mcpStart the MCP server (for AI assistant integration)
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 auth githubConnect your GitHub account
2ndopinion keys createCreate an API key for MCP/REST access
2ndopinion keys listList your API keys
2ndopinion signupCreate a new account
2ndopinion loginLog in to your account
2ndopinion statusCheck usage and subscription
2ndopinion config --consensusToggle consensus mode (3-model analysis)
2ndopinion upgradeUpgrade your plan

How It Works

  1. AI writes code — Write code however you like, with any AI assistant or by hand
  2. 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
  3. Ship with confidence — Get accept/review/reject verdicts, auto-fix issues, generate tests, or run a security audit before merging

Pricing

Individual:

PlanCredits/monthPriceHighlights
Free5$0Opinion, Review, Ask, Explain
Pro100$10/mo+ Generate Tests
Power500$25/mo+ Consensus, Bug Hunt, Security Audit
Agent1,000$49/mo+ Debate, Auto-Fix, PR Review

Teams:

PlanCredits/monthPriceSeatsHighlights
Team2,500$99/moUp to 10Shared pool, team rules, all Agent tools
Team Pro6,000$199/moUp to 25Everything 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.



CI/CD & Scripting

Use --ci (or --json) to get structured JSON output with no interactive UI. Use --plain for human-readable text output without ANSI formatting.

Flags

FlagDescription
--ciOutput structured JSON to stdout, skip Ink UI
--jsonAlias for --ci
--plainOutput human-readable text without formatting

Exit Codes

CodeMeaning
0Success / Accept
1Review needed
2Reject
3Error

Examples

# JSON analysis
2ndopinion analyze --ci
2ndopinion analyze --ci --llm claude
2ndopinion status --ci

# Parse with jq
2ndopinion analyze --ci | jq '.verdict'
2ndopinion status --ci | jq '.credits.remaining'

# Plain text (no ANSI)
2ndopinion analyze --plain
2ndopinion status --plain

# Use exit code in scripts
2ndopinion analyze --ci
if [ $? -eq 2 ]; then echo "Code rejected!"; fi

GitHub Actions

- name: AI Code Review
  run: |
    npx 2ndopinion analyze --ci --llm codex > review.json
    VERDICT=$(jq -r '.verdict' review.json)
    if [ "$VERDICT" = "reject" ]; then
      echo "::error::Code review failed"
      exit 1
    fi
  env:
    SECONDOPINION_API_KEY: ${{ secrets.SECONDOPINION_API_KEY }}

GitLab CI

code-review:
  script:
    - npx 2ndopinion analyze --ci --llm codex > review.json
    - cat review.json | jq '.summary'
  artifacts:
    paths:
      - review.json

JSON Output Format

analyze --ci:

{
  "verdict": "review",
  "model": "codex",
  "findings": [
    {
      "severity": "HIGH",
      "category": "security",
      "title": "SQL injection via string interpolation",
      "description": "The query builds SQL unsafely",
      "file": "auth.js",
      "line": 9,
      "suggestion": "Use parameterized queries"
    }
  ],
  "summary": "Found 1 issue: 1 HIGH",
  "creditsUsed": 1,
  "creditsRemaining": 4
}

status --ci:

{
  "tier": "free",
  "email": "dev@example.com",
  "credits": { "used": 3, "limit": 5, "remaining": 2, "bonus": 0 },
  "defaultLlm": "codex",
  "resetsAt": "2026-05-01T00:00:00.000Z"
}

Full docs at get2ndopinion.dev

License

Proprietary. All rights reserved.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 16

Collected releases
VersionPublishedDirect dependenciesOpen version
0.12.0Registry latest15 Apr 202620
0.11.014 Apr 202620
0.10.19 Apr 202620
0.10.03 Apr 202620
0.9.015 Mar 202620
0.8.224 Feb 202620
0.8.121 Feb 202620
0.8.021 Feb 202620
0.7.016 Feb 202617
0.6.016 Feb 202617
0.5.016 Feb 202617
0.4.015 Feb 202617
0.3.015 Feb 202616
0.2.214 Feb 202616
0.2.014 Feb 202616
0.1.014 Feb 202616

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
brianmello8/2ndopinion

Shared repository data · GitHub

License detected in repository
Not collected

Repository

PENDING
bdubtronux/2ndopinion

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:15 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:fb559fff17bd2ee0d9dd1cba9f58d1835269bfa41c99fa4f7286048e8eb3d472