Overview

UnifyRoute provides a comprehensive CLI for managing the gateway, providers, tokens, and configuration.

Usage: ./unifyroute [COMMAND] [OPTIONS]

Global Options

1
2
3
4
--help, -h          Show help message
--version, -v       Show version information
--config, -c PATH   Path to config file (default: config.yaml)
--debug             Enable debug output

Setup & Services

setup

Initialize UnifyRoute with interactive configuration wizard.

1
./unifyroute setup [OPTIONS]

Options:

  • --skip-wizard - Skip interactive prompts and use defaults
  • --force - Overwrite existing configuration

Example:

1
2
./unifyroute setup
# Interactive wizard for providers, tokens, and routing

start

Start all UnifyRoute services.

1
./unifyroute start [OPTIONS]

Options:

  • --port - HTTP port (default: 6565)
  • --host - Bind host (default: localhost)
  • --foreground - Run in foreground (don’t daemonize)
  • --workers - Number of API workers (default: 4)

Example:

1
./unifyroute start --port 8080

stop

Stop all running UnifyRoute services.

1
./unifyroute stop [OPTIONS]

Options:

  • --timeout - Timeout for graceful shutdown (default: 30s)

restart

Restart all services.

1
./unifyroute restart

status

Check status of all services.

1
./unifyroute status

Output:

API Gateway:        running (PID: 1234)
Router:            running (PID: 1235)
Quota Poller:      running (PID: 1236)
Dashboard:         running (PID: 1237)

Token Management

tokens list

List all API tokens.

1
./unifyroute tokens list [OPTIONS]

Options:

  • --format - Output format (json, table, default: table)
  • --active-only - Show only active tokens
  • --user - Filter by user

Example:

1
./unifyroute tokens list --format json

tokens create

Create a new API token.

1
./unifyroute tokens create [OPTIONS]

Options:

  • --name - Token name (required)
  • --user - User ID
  • --permissions - Comma-separated permissions
  • --expires-in - Expiration duration (e.g., 30d, 1y)
  • --quota - Token quota (requests/month)
  • --rate-limit - Rate limit (requests/minute)

Example:

1
2
3
4
5
./unifyroute tokens create \
  --name "production-token" \
  --permissions "read:models,write:chat" \
  --expires-in 90d \
  --quota 100000

tokens revoke

Revoke an API token.

1
./unifyroute tokens revoke TOKEN_ID

Example:

1
./unifyroute tokens revoke sk-abc123def456

tokens info

Show detailed token information.

1
./unifyroute tokens info TOKEN_ID

Provider Management

providers list

List configured providers.

1
./unifyroute providers list [OPTIONS]

Options:

  • --format - Output format (json, table)
  • --with-credentials - Include credentials (masked)

Example:

1
./unifyroute providers list --format json

providers add

Add a new provider.

1
./unifyroute providers add [OPTIONS]

Options:

  • --name - Provider name (required)
  • --type - Provider type: openai, anthropic, together (required)
  • --api-key - API key
  • --api-base - API base URL

Example:

1
2
3
4
5
./unifyroute providers add \
  --name my-openai \
  --type openai \
  --api-key sk-... \
  --api-base https://api.openai.com/v1

providers remove

Remove a provider.

1
./unifyroute providers remove PROVIDER_NAME

providers test

Test provider connectivity.

1
./unifyroute providers test PROVIDER_NAME

Output:

Testing provider 'openai'...
✓ Authentication successful
✓ Models endpoint responding
✓ Chat completions test request OK
✓ Model list: 5 models available

Configuration

config show

Display current configuration.

1
./unifyroute config show [OPTIONS]

Options:

  • --format - Output format (yaml, json)
  • --section - Show specific section only

Example:

1
./unifyroute config show --section routing

config edit

Edit configuration interactively.

1
./unifyroute config edit [PATH]

Example:

1
./unifyroute config edit routing.providers

config validate

Validate configuration syntax.

1
./unifyroute config validate [FILE]

Monitoring & Diagnostics

health

Check system health.

1
./unifyroute health [OPTIONS]

Options:

  • --check - Specific health check (database, redis, providers)

Example:

1
./unifyroute health --check providers

logs

View service logs.

1
./unifyroute logs [OPTIONS]

Options:

  • --service - Service name (api, router, dashboard)
  • --since - View logs since (e.g., 1h, 30m)
  • --follow, -f - Follow logs in real-time
  • --lines - Number of lines to show

Example:

1
./unifyroute logs --service api --follow --since 1h

stats

Show usage statistics.

1
./unifyroute stats [OPTIONS]

Options:

  • --period - Time period (today, week, month)
  • --by - Group by (provider, token, model)
  • --format - Output format (table, json)

Example:

1
./unifyroute stats --period month --by provider

Maintenance

backup

Create a backup of configuration and data.

1
./unifyroute backup [PATH]

restore

Restore from backup.

1
./unifyroute restore BACKUP_FILE

migration

Database migration commands.

1
2
3
./unifyroute migration migrate    # Run pending migrations
./unifyroute migration rollback   # Rollback last migration
./unifyroute migration status     # Show migration status

Help & Documentation

help

Show help for any command.

1
2
./unifyroute help [COMMAND]
./unifyroute [COMMAND] --help

Example:

1
2
./unifyroute help tokens create
./unifyroute start --help

Examples

Complete Setup Workflow

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# 1. Initialize
./unifyroute setup

# 2. Check status
./unifyroute status

# 3. Create production token
./unifyroute tokens create \
  --name "production-api" \
  --expires-in 180d \
  --quota 1000000

# 4. Add provider
./unifyroute providers add \
  --name openai-prod \
  --type openai \
  --api-key sk-...

# 5. Test provider
./unifyroute providers test openai-prod

# 6. View configuration
./unifyroute config show

# 7. Start services
./unifyroute start

# 8. Check health
./unifyroute health

Monitoring Workflow

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# View real-time logs
./unifyroute logs --follow

# Check system health
./unifyroute health

# View provider status
./unifyroute providers list

# Check statistics
./unifyroute stats --period today
Last updated: January 1, 0001