Installation

Detailed installation instructions for nexus-agents across all platforms, Docker, and CI/CD environments.

System Requirements

Required

ComponentVersionNotes
Node.js22.x LTSEarlier versions are not supported
npm10.xOr pnpm 9.x (recommended)

Optional

ComponentPurpose
DockerSandboxed code execution
Claude CLIEnhanced Claude model access
Gemini CLIEnhanced Gemini model access
Codex CLIEnhanced OpenAI model access
OpenCode CLIEnhanced OpenCode model access

API Keys

You need at least one model provider API key:

ProviderVariableGet Key
AnthropicANTHROPIC_API_KEYconsole.anthropic.com
OpenAIOPENAI_API_KEYplatform.openai.com
Google AIGOOGLE_AI_API_KEYaistudio.google.com

For local models via Ollama, no API key is required. Ollama support requires configuration of the OLLAMA_HOST environment variable.

Installation Methods

Install globally for CLI access:

npm install -g nexus-agents

After install, you’ll see a hint to run setup. Configure everything:

nexus-agents setup    # Configures MCP, hooks, data dirs, OpenCode, config

Verify installation:

nexus-agents doctor        # Checks CLIs, API keys, sqlite, data dirs
nexus-agents doctor --fix  # Auto-fix missing data dirs and config

pnpm

If you prefer pnpm:

pnpm add -g nexus-agents

npx (No Install)

Run without installing:

npx nexus-agents doctor
npx nexus-agents --help

From Source

For development or customization:

# Clone the repository
git clone https://github.com/williamzujkowski/nexus-agents.git
cd nexus-agents

# Install dependencies
pnpm install

# Build
pnpm build

# Link globally
pnpm link --global

Docker

Run in a container:

# Pull the image
docker pull ghcr.io/williamzujkowski/nexus-agents:latest

# Run with API key
docker run -e ANTHROPIC_API_KEY="sk-ant-..." \
  ghcr.io/williamzujkowski/nexus-agents:latest

Or build locally:

docker build -t nexus-agents .
docker run -e ANTHROPIC_API_KEY="sk-ant-..." nexus-agents

Platform-Specific Instructions

macOS

# Install Node.js 22 via Homebrew
brew install node@22

# Add to PATH
echo 'export PATH="/opt/homebrew/opt/node@22/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

# Install nexus-agents
npm install -g nexus-agents

# Verify
nexus-agents doctor

Linux (Ubuntu/Debian)

# Install Node.js 22 via NodeSource
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs

# Install nexus-agents
npm install -g nexus-agents

# Verify
nexus-agents doctor

Linux (Fedora/RHEL)

# Install Node.js 22
sudo dnf module enable nodejs:22
sudo dnf install nodejs

# Install nexus-agents
npm install -g nexus-agents

# Verify
nexus-agents doctor

Windows

# Install Node.js 22 via winget
winget install OpenJS.NodeJS.LTS

# Or via Chocolatey
choco install nodejs-lts

# Install nexus-agents
npm install -g nexus-agents

# Verify
nexus-agents doctor

Windows (WSL)

Follow the Linux instructions inside WSL. This is the recommended approach for Windows users.

Installing Optional CLIs

The external CLI adapters provide enhanced capabilities:

Claude CLI

npm install -g @anthropic-ai/claude-code
claude auth login

Gemini CLI

npm install -g @google/gemini-cli
gemini auth login

Codex CLI

npm install -g @openai/codex
codex auth login

OpenCode CLI

npm install -g opencode-ai

OpenCode supports custom OpenAI-compatible endpoints, enabling routing to any hosted model that exposes an OpenAI-compatible API.

MCP Client Configuration

Claude Desktop

Add to your MCP configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Linux: ~/.config/claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "nexus-agents": {
      "command": "nexus-agents",
      "args": ["--mode=server"],
      "env": {
        "ANTHROPIC_API_KEY": "sk-ant-your-key-here"
      }
    }
  }
}

Restart Claude Desktop to load the configuration.

Claude CLI

Add to .mcp.json in your project root (or run nexus-agents setup for automatic configuration):

{
  "mcpServers": {
    "nexus-agents": {
      "command": "nexus-agents",
      "args": ["--mode=server"]
    }
  }
}

Data Storage

nexus-agents stores runtime data in ~/.nexus-agents/:

DirectoryPurpose
memory/SQLite databases for agentic, adaptive, typed memory backends
memory/beliefs/Belief memory JSON snapshots
learning/Cross-session task outcomes and distilled rules
sessions/Session journals (JSONL) and sessions.db
audit/JSONL audit logs
voting/Consensus vote correlation data
auth/REST API auth tokens (owner-only permissions)

Run nexus-agents setup to pre-create this structure, or it will be created lazily on first use.

better-sqlite3

Five memory backends (agentic, adaptive, typed, mobimem, decay) use better-sqlite3 for persistent storage. It is included as a regular dependency and installed automatically with pnpm install. If it fails to compile (requires native build tools), basic session and belief memory still work without it.

Run nexus-agents doctor to check if it’s available under “Checking data storage”.

CI/CD Integration

GitHub Actions

name: CI with nexus-agents

on: [push, pull_request]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '22'

      - name: Install nexus-agents
        run: npm install -g nexus-agents

      - name: Run code review
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
        run: |
          nexus-agents orchestrate "Review the changes in this PR" \
            --format json > review.json

GitLab CI

code-review:
  image: node:22
  script:
    - npm install -g nexus-agents
    - nexus-agents orchestrate "Review this merge request"
  variables:
    ANTHROPIC_API_KEY: $ANTHROPIC_API_KEY

Jenkins

pipeline {
    agent {
        docker { image 'node:22' }
    }
    environment {
        ANTHROPIC_API_KEY = credentials('anthropic-api-key')
    }
    stages {
        stage('Review') {
            steps {
                sh 'npm install -g nexus-agents'
                sh 'nexus-agents orchestrate "Review this build"'
            }
        }
    }
}

Docker Compose

For development environments:

version: '3.8'

services:
  nexus-agents:
    image: ghcr.io/williamzujkowski/nexus-agents:latest
    environment:
      - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
      - NEXUS_LOG_LEVEL=debug
    volumes:
      - ./nexus-agents.yaml:/app/nexus-agents.yaml:ro
      - ./workflows:/app/workflows:ro
    ports:
      - '3000:3000' # REST API

Verifying Installation

After installation, run the doctor command:

nexus-agents doctor

Expected output for a complete setup:

Nexus Agents Doctor
===================

Checking CLI installations...

✓ Claude CLI
  Version: 2.0.76 (supported)
  Auth: OAuth
  Capacity: 85% remaining

✓ Gemini CLI
  Version: 0.22.5 (supported)
  Auth: ADC configured

✓ Codex CLI
  Version: 0.77.0 (supported)
  Auth: OAuth

Checking MCP configuration...

✓ MCP Server mode: Ready
✓ MCP Client mode: Ready (Codex mcp-server)

Summary: All systems operational

Updating

npm

npm update -g nexus-agents

pnpm

pnpm update -g nexus-agents

From Source

cd nexus-agents
git pull
pnpm install
pnpm build

Uninstalling

npm

npm uninstall -g nexus-agents

pnpm

pnpm remove -g nexus-agents

Clean Configuration

Remove configuration files:

# Remove config
rm -rf ~/.config/nexus-agents

# Remove MCP entry from Claude Desktop config
# Edit ~/Library/Application Support/Claude/claude_desktop_config.json

Troubleshooting

”Cannot find module” errors

Clear the npm cache and reinstall:

npm cache clean --force
npm install -g nexus-agents

Permission errors on Linux/macOS

Fix npm permissions:

# Option 1: Use a node version manager (recommended)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install 22
nvm use 22

# Option 2: Change npm prefix
npm config set prefix ~/.npm-global
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

PATH not configured

Find and add the npm bin directory:

# Find the directory
npm config get prefix

# Add to PATH (bash)
echo 'export PATH="$(npm config get prefix)/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

# Add to PATH (zsh)
echo 'export PATH="$(npm config get prefix)/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

Docker permission denied

Add your user to the docker group:

sudo usermod -aG docker $USER
# Log out and back in