CLI Introduction
Claude Code Router CLI (ccr) is a command-line tool for managing and controlling the Claude Code Router service.
Feature Overview
ccr provides the following functionality:
- Service Management: Start, stop, restart service
- Configuration Management: Interactive model selection configuration
- Status Viewing: View service running status
- Code Execution: Directly execute
claudecommand - Environment Integration: Output environment variables for shell integration
- Web UI: Open Web management interface
- Status Bar: Display customizable session status with
ccr statusline
Installation
npm install -g @musistudio/claude-code-router
Basic Usage
Configuration
Before using Claude Code Router, you need to configure your providers. You can either:
- Edit configuration file directly: Edit
~/.claude-code-router/config.jsonmanually - Use Web UI: Run
ccr uito open the web interface and configure visually
After making configuration changes, restart the service:
ccr restart
Or restart directly through the Web UI.
Start Claude Code
Once configured, you can start Claude Code with:
ccr code
This will launch Claude Code and route your requests through the configured provider.
Service Management
ccr start # Start the router service
ccr status # View service status
ccr stop # Stop the router service
ccr restart # Restart the router service
Web UI
ccr ui # Open Web management interface
Configuration File
ccr uses the configuration file at ~/.claude-code-router/config.json
Configure once, and both CLI and Server will use it.
Next Steps
- Installation Guide - Detailed installation instructions
- Quick Start - Get started in 5 minutes
- Command Reference - Complete command list
- Status Line - Customize your status bar
- Configuration Guide - Configuration file details