Documentation

AI Council Documentation

Everything you need to know to get the most out of AI Council.

Installation

AI Council is distributed as an npm package with pre-compiled binaries for all major platforms.

Terminal
npm install -g @mugzie/ai-council

This automatically installs the correct binary for your platform:

  • macOS - darwin-arm64 (Apple Silicon) or darwin-x64 (Intel)
  • Linux - linux-arm64 or linux-x64
  • Windows - win32-x64
💡
Verify Installation

Run ai-council --help to verify the installation was successful.

License Setup

AI Council requires a valid license key to operate. Purchase your license from our store.

Purchase License

Once you have your license key, set it as an environment variable:

Bash / Zsh
export AI_COUNCIL_LICENSE_KEY="your-license-key"
Add to shell profile (~/.zshrc or ~/.bashrc)
# AI Council License
export AI_COUNCIL_LICENSE_KEY="your-license-key"

Quick Start

Get up and running with AI Council in under a minute.

1

Install the package

npm install -g @mugzie/ai-council
2

Set your license key

export AI_COUNCIL_LICENSE_KEY="your-key"
3

Configure AI provider (at least one required)

# OpenAI (recommended)
export OPENAI_API_KEY="sk-..."

# Or Google Gemini
export GEMINI_API_KEY="..."

# Or both for best results!
4

Run your first review

ai-council review --diff --branch=main --pretty

Basic Usage

AI Council analyzes your git diff and provides recommendations from multiple AI perspectives.

Basic Review
# Review changes against main branch
ai-council review --diff --branch=main --pretty

# Review changes against develop branch
ai-council review --diff --branch=develop --pretty

# Review staged changes only
ai-council review --diff --pretty

Output Formats

Control how results are displayed:

Flag Description
--pretty Human-readable formatted output with colors and emojis
--json JSON output for programmatic use
--ci CI mode - exits with code 1 on REJECT or low confidence

Review Commands

AI Council offers specialized review modes that focus on specific aspects of your code.

ai-council review

Comprehensive code review with all agents: Senior Developer, Security, Performance, Pragmatist, and Gemini.

ai-council review --diff --pretty
ai-council security

Security-focused review examining vulnerabilities, authentication, and secure coding practices.

ai-council security --diff --pretty
ai-council perf

Performance analysis focusing on algorithmic complexity, bottlenecks, and optimization opportunities.

ai-council perf --diff --pretty
ai-council arch

Architecture review evaluating design patterns, scalability, and system structure.

ai-council arch --diff --pretty
ai-council sanity

Quick sanity check with Pragmatist, Senior Dev, and Architect for a balanced perspective.

ai-council sanity --diff --pretty

CI/CD Mode

Integrate AI Council into your continuous integration pipeline to automatically review pull requests.

GitHub Actions Example
name: AI Council Review

on:
  pull_request:
    branches: [main, develop]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
      
      - name: Install AI Council
        run: npm install -g @mugzie/ai-council
      
      - name: Run Code Review
        env:
          AI_COUNCIL_LICENSE_KEY: ${{ secrets.AI_COUNCIL_LICENSE_KEY }}
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
        run: ai-council review --diff --branch=origin/main --ci
⚠️
Exit Codes

In CI mode, AI Council exits with code 1 when the final decision is REJECT or when overall confidence is below 0.5. This can be used to block merges.

MCP Server

AI Council includes a Model Context Protocol (MCP) server for integration with AI assistants like Claude and Cursor.

Start MCP Server
ai-council mcp

The MCP server exposes AI Council's functionality as tools that can be invoked by AI assistants, enabling them to request code reviews during conversations.

Claude Integration

Add AI Council to Claude Code for seamless code review within your Claude conversations.

Add to Claude Code
claude mcp add --transport stdio ai-council -- ai-council mcp

Once configured, Claude can invoke AI Council to review code snippets or git diffs during your conversation.

Cursor Integration

Configure AI Council as an MCP server in Cursor for integrated code review.

.mcp.json
{
  "mcpServers": {
    "ai-council": {
      "command": "ai-council",
      "args": ["mcp"],
      "env": {
        "AI_COUNCIL_LICENSE_KEY": "your-license-key",
        "OPENAI_API_KEY": "your-openai-key",
        "GEMINI_API_KEY": "your-gemini-key",
        "AI_COUNCIL_MODEL": "gpt-4o-mini",
        "AI_COUNCIL_GEMINI_MODEL": "gemini-2.0-flash"
      }
    }
  }
}
💡
Tip

Place the .mcp.json file in your project root or home directory for Cursor to automatically detect it.

Environment Variables

Configure AI Council's behavior through environment variables.

Variable Required Default Description
AI_COUNCIL_LICENSE_KEY Yes - Your license key from the store
OPENAI_API_KEY No* - OpenAI API key for GPT models
GEMINI_API_KEY No* - Google Gemini API key
AI_COUNCIL_MODEL No gpt-4o-mini OpenAI model to use
AI_COUNCIL_GEMINI_MODEL No gemini-2.0-flash Gemini model to use

* At least one of OPENAI_API_KEY or GEMINI_API_KEY is required.

AI Providers

AI Council supports multiple AI providers for diverse perspectives.

OpenAI (Primary)

Used for most agents including Senior Developer, Security, Performance, Architect, and Pragmatist.

export OPENAI_API_KEY="sk-..."

Google Gemini

Powers the Gemini Structural Thinker agent, providing alternative reasoning and challenging assumptions.

export GEMINI_API_KEY="..."
Best Practice

Configure both providers for the most comprehensive reviews. The diversity of AI models leads to better coverage and catches more edge cases.

Model Selection

Customize which AI models power your council.

OpenAI Models

Model Speed Cost Quality
gpt-4o-mini Fast Low Good (default)
gpt-4o Medium High Excellent
gpt-4-turbo Medium High Excellent

Gemini Models

Model Speed Cost Quality
gemini-2.0-flash Fast Low Good (default)
gemini-1.5-pro Medium Medium Excellent

Agents Overview

AI Council assembles a diverse panel of specialized AI agents.

👨‍💻

Senior Developer

Generalist

15+ years of experience. Focuses on maintainability, best practices, readability, testability, and long-term sustainability. Comments on any aspect of the code.

🔒

Security Engineer

Specialist

Identifies security vulnerabilities, authentication issues, SQL injection, XSS, CSRF, and other security concerns. Abstains when code has no security implications.

Performance Engineer

Specialist

Analyzes algorithmic complexity (O(n), O(log n)), memory usage, caching opportunities, and optimization potential. Abstains for code without performance implications.

🏛️

Software Architect

Specialist

Evaluates design patterns, scalability, separation of concerns, system boundaries, and how code fits into the broader system. Abstains for simple changes.

🤖

Gemini Thinker

Challenger

Powered by Google Gemini. Challenges assumptions, reframes problems, identifies edge cases, and provides alternative system-level perspectives.

🛠️

Pragmatist

Generalist

Balances perfectionism with shipping. Considers deadlines, team velocity, and whether the code effectively solves the problem. Sometimes "good enough" is right.

Voting System

Each agent casts a vote with a confidence score. The system uses these to reach a final decision.

Vote Types

APPROVE

Code meets quality standards and can be merged

REVISE

Code needs improvements before merging

REJECT

Code has fundamental issues that must be addressed

ABSTAIN

Agent defers due to low confidence or irrelevant domain

Confidence Scores

Each vote includes a confidence score from 0.0 to 1.0:

  • 0.8-1.0: High confidence - agent is certain about their assessment
  • 0.5-0.8: Moderate confidence - reasonable certainty
  • < 0.5: Low confidence - agent automatically abstains

Abstention Rules

Agents abstain in two scenarios:

  1. Domain Mismatch: Specialist agents (Security, Performance, Architect) abstain when code doesn't match their domain expertise
  2. Low Confidence: Any agent with confidence below 0.5 automatically abstains

Debate System

When Gemini dissents from the majority, AI Council triggers an automated debate to explore the disagreement.

Debate Flow

  1. Detection: System detects Gemini's vote differs from majority
  2. Escalation: Debate is triggered between Gemini and the strongest majority voice
  3. Rebuttal: Majority agent responds to Gemini's concerns
  4. Counter: Gemini provides final response (maintain, partial concede, or full concede)
  5. Judgment: Judge considers the debate when making final decision
Example Debate Output
⚡ Debate escalation: Gemini (REJECT) dissents from majority (APPROVE)

1. senior-dev (DEFEND): The null check on line 42 handles the edge case
   Gemini mentioned. The early return pattern is intentional for...

2. gemini (PARTIAL_CONCEDE): I acknowledge the null check, but maintain
   concern about the async race condition that could still occur when...
💡
Why Gemini?

Gemini uses a different AI model (Google's) than other agents. This intentional diversity helps catch edge cases and provides truly alternative perspectives that might be missed by a single AI provider.

Need Help?

Can't find what you're looking for? Here are some resources: