ccNexus

command module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2025 License: MIT Imports: 13 Imported by: 0

README ยถ

ccNexus (Claude Code Nexus)

A smart API endpoint rotation proxy for Claude Code

Build Status Go Version Wails

English | ็ฎ€ไฝ“ไธญๆ–‡

โœจ Features

  • ๐Ÿ”„ Automatic Endpoint Rotation - Seamlessly switches between endpoints on errors
  • ๐ŸŒ Multi-Provider Support - Use official Claude API and third-party providers
  • ๐Ÿ” Smart Retry - Retries on any non-200 response
  • ๐Ÿ“Š Real-time Statistics - Monitor requests, errors, and endpoint usage
  • ๐Ÿ’ฐ Token Usage Tracking - Track input/output tokens for each endpoint
  • ๐ŸŽฏ Endpoint Management - Enable/disable endpoints with toggle switches
  • ๐Ÿ” Secure API Key Display - Shows only last 4 characters of API keys
  • ๐Ÿšฆ Smart Load Balancing - Distributes requests only to enabled endpoints
  • ๐Ÿ–ฅ๏ธ Desktop GUI - Beautiful cross-platform interface built with Wails
  • ๐Ÿš€ Single Binary - No dependencies, just download and run
  • ๐Ÿ”ง Easy Configuration - Manage endpoints through GUI or config file
  • ๐Ÿ’พ Persistent Config - Automatically saves configuration
  • ๐Ÿ”’ Local First - All data stays on your machine

๐Ÿš€ Quick Start

Download

Download the latest release for your platform:

  • Windows: ccNexus-windows-amd64.zip
  • macOS (Intel): ccNexus-darwin-amd64.zip
  • macOS (Apple Silicon): ccNexus-darwin-arm64.zip
  • Linux: ccNexus-linux-amd64.tar.gz

๐Ÿ“ฅ Download Latest Release

Installation
Windows
  1. Extract the ZIP file
  2. Double-click ccNexus.exe
  3. The application will start with a default configuration
macOS
  1. Extract the ZIP file
  2. Move ccNexus.app to Applications folder
  3. Right-click and select "Open" (first time only)
  4. The application will start with a default configuration
Linux
tar -xzf ccNexus-linux-amd64.tar.gz
chmod +x ccNexus
./ccNexus
Configuration
  1. Add Endpoints: Click "Add Endpoint" button
  2. Fill in Details:
    • Name: A friendly name (e.g., "Claude Official")
    • API URL: The API server address (e.g., api.anthropic.com)
    • API Key: Your API key
  3. Save: Click "Save" to add the endpoint
Configure Claude Code

In Claude Code settings:

  • API Base URL: http://localhost:3000
  • API Key: Any value (will be replaced by proxy)

๐Ÿ“– How It Works

Claude Code โ†’ Proxy (localhost:3000) โ†’ Endpoint #1 (non-200 response)
                                     โ†’ Endpoint #2 (success) โœ…
  1. Request Interception: Proxy receives all API requests
  2. Endpoint Selection: Uses current available endpoint
  3. Error Detection: Monitors response status codes
  4. Auto Retry: Switches endpoint and retries on non-200 responses
  5. Round Robin: Cycles through all endpoints

๐ŸŽ‰ What's New in v0.2.0

๐Ÿ” Enhanced Security
  • Masked API Keys: API keys now show only the last 4 characters (e.g., ****ABCD)
  • Better protection when sharing screenshots or during presentations
๐Ÿ“Š Advanced Statistics
  • Per-Endpoint Request Tracking: See request count and error rate for each endpoint
  • Token Usage Monitoring: Track input and output tokens consumed by each endpoint
  • Real-time Updates: Statistics refresh every 5 seconds automatically
๐ŸŽฏ Endpoint Control
  • Toggle Switches: Enable/disable endpoints with a single click
  • Visual Status Indicators: Quickly identify active (โœ…) and disabled (โŒ) endpoints
  • Zero Downtime: Disable problematic endpoints without stopping the proxy
๐Ÿ’ก Usage Example

View detailed statistics for each endpoint:

๐Ÿ“Š Requests: 1,234 | Errors: 5
๐ŸŽฏ Tokens: 45,678 (In: 12,345, Out: 33,333)

Disable expensive or rate-limited endpoints temporarily while keeping others active.

๐Ÿ”ง Configuration File

Configuration is stored at:

  • Windows: %USERPROFILE%\.ccNexus\config.json
  • macOS/Linux: ~/.ccNexus/config.json

Example:

{
  "port": 3000,
  "endpoints": [
    {
      "name": "Claude Official 1",
      "apiUrl": "api.anthropic.com",
      "apiKey": "sk-ant-api03-your-key-1",
      "enabled": true
    },
    {
      "name": "Third Party Provider",
      "apiUrl": "api.example.com",
      "apiKey": "your-key-2",
      "enabled": true
    }
  ]
}

๐Ÿ› ๏ธ Development

Prerequisites
  • Go 1.22+
  • Node.js 18+
  • Wails CLI v2
Setup
# Clone repository
git clone https://github.com/lich0821/ccNexus.git
cd ccNexus

# Install Wails
go install github.com/wailsapp/wails/v2/cmd/wails@latest

# Install dependencies
go mod download
cd frontend && npm install && cd ..

# Run in development mode
wails dev
Build
# Build for current platform
wails build

# Build for specific platform
wails build -platform windows/amd64
wails build -platform darwin/amd64
wails build -platform darwin/arm64
wails build -platform linux/amd64

๐Ÿ“š Project Structure

ccNexus/
โ”œโ”€โ”€ main.go                 # Application entry point
โ”œโ”€โ”€ app.go                  # Wails app logic
โ”œโ”€โ”€ internal/
โ”‚   โ”œโ”€โ”€ proxy/             # Proxy core logic
โ”‚   โ”‚   โ”œโ”€โ”€ proxy.go       # HTTP proxy with retry
โ”‚   โ”‚   โ””โ”€โ”€ stats.go       # Statistics tracking
โ”‚   โ””โ”€โ”€ config/            # Configuration management
โ”‚       โ””โ”€โ”€ config.go      # Config structure
โ”œโ”€โ”€ frontend/              # Frontend UI
โ”‚   โ”œโ”€โ”€ index.html
โ”‚   โ””โ”€โ”€ src/
โ”‚       โ”œโ”€โ”€ main.js        # UI logic
โ”‚       โ””โ”€โ”€ style.css      # Styles
โ””โ”€โ”€ .github/workflows/
    โ””โ”€โ”€ build.yml          # CI/CD pipeline

โ“ FAQ

Q: Proxy won't start?

A: Check if port is in use:

# macOS/Linux
lsof -i :3000

# Windows
netstat -ano | findstr :3000
Q: Claude Code can't connect?

A: Verify:

  1. Proxy application is running
  2. Claude Code Base URL is http://localhost:3000
  3. Firewall isn't blocking the connection
Q: Endpoint switching not working?

A: Check:

  1. Multiple endpoints are configured
  2. API keys are valid
  3. View application logs for switching behavior
Q: How to view detailed logs?

A:

  • macOS: Run app from terminal to see logs
  • Windows: Check log files in app directory
  • Linux: Use ./ccNexus 2>&1 | tee ccNexus.log

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Wails - Amazing Go + Web framework
  • Anthropic - Claude Code
  • All contributors and users

๐Ÿ“ž Support


Made with โค๏ธ by Chuck

Documentation ยถ

The Go Gopher

There is no documentation for this package.

Directories ยถ

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL