cli-serve

SkillDev tools

Start, stop, and restart the AIRoute server from the CLI. Manage daemon mode, port configuration, auto-recovery, system tray integration, and the dashboard open shortcut.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the cli-serve skill

About this capability

AI gateway with enhanced compliance for the domestic (China) market

What this skill tells your AI

The instructions your AI receives, as published by jaccen/airoute in skills/cli-serve/SKILL.md and read by ahel’s review.

Overview

Start, stop, and restart the AIRoute server from the CLI. Manage daemon mode, port configuration, auto-recovery, system tray integration, and the dashboard open shortcut.

Quick install

npm install -g AIRoute   # or: npx AIRoute
AIRoute --version

Subcommands

dashboard

Flags:

  • --url
  • --port <port>
  • --tui

Example:

AIRoute dashboard

restart

Flags:

  • --port <port>

Example:

AIRoute restart

serve

Flags:

  • --port <port>
  • --no-open
  • --daemon
  • --log
  • --no-recovery
  • --max-restarts <n>
  • --tray
  • --no-tray
  • --tls-cert <path>
  • --tls-key <path>

Example:

AIRoute serve

stop

Example:

AIRoute stop

Setup

The AIRoute binary ships with the AIRoute server. It is both the server launcher and a full management CLI with 250+ commands across 39 groups.

Install

npm install -g AIRoute          # npm registry
# or: use the binary bundled with the desktop app

Requires Node.js ≥22.22.2 or ≥24.

Verify:

AIRoute --version   # prints installed version
AIRoute --help      # full command tree

Connection

Every CLI command that talks to the server reads two values:

SourceVariable / Flag
Base URLAIRoute_BASE_URL or --base-url
API keyAIRoute_API_KEY or --api-key

Default base URL: http://localhost:20128

export AIRoute_BASE_URL="http://localhost:20128"
export AIRoute_API_KEY="sk-..."          # from Dashboard → API Manager

For a remote server:

export AIRoute_BASE_URL="https://your-server.com"

Global flags

FlagDescription
--base-url <url>Override server URL for this invocation
--api-key <key>Override API key for this invocation
--output <format>Output format: table (default), json, jsonl, csv
--jsonShorthand for --output json
--non-interactiveDisable prompts — for CI / shell scripts
--no-openDon't auto-open the browser on start
--port <n>Override default port 20128
--help, -hShow help for the current command
--version, -vPrint the installed version

Output formats

All listing commands support --output:

AIRoute combo list                      # human-readable table
AIRoute combo list --output json        # JSON array
AIRoute combo list --output jsonl       # one JSON object per line
AIRoute combo list --output csv         # CSV with header row

Quick start: one-shot server + provider setup

# 1. Start server
AIRoute

# 2. (First run) interactive setup wizard
AIRoute setup

# 3. Verify everything is healthy
AIRoute doctor

CLI capability skills

CapabilitySkill
Server admin + backuphttps://raw.githubusercontent.com/diegosouzapw/AIRoute/main/skills/AIRoute-cli-admin/SKILL.md
Provider & key managementhttps://raw.githubusercontent.com/diegosouzapw/AIRoute/main/skills/AIRoute-cli-providers/SKILL.md
Cloud agents (Codex / Devin / Jules)https://raw.githubusercontent.com/diegosouzapw/AIRoute/main/skills/AIRoute-cli-cloud/SKILL.md
Evals & benchmarkinghttps://raw.githubusercontent.com/diegosouzapw/AIRoute/main/skills/AIRoute-cli-eval/SKILL.md

Errors

  • Connection refused → server not running; run AIRoute or AIRoute serve
  • 401 Unauthorized → wrong or missing API key
  • command not found: AIRoute → not in PATH; check npm root -g or re-install
  • doctor reports SQLite incompatible → npm rebuild better-sqlite3 in the app directory

Admin lifecycle

Requires the AIRoute CLI. See CLI entry-point skill for install + global flags.

Server lifecycle

AIRoute                              # Start server (default port 20128)
AIRoute serve                        # Explicit alias
AIRoute --port 3000                  # Override port
AIRoute --no-open                    # Don't auto-open browser
AIRoute --mcp                        # Start as MCP server (stdio transport)

AIRoute stop                         # Stop the running server
AIRoute restart                      # Restart the server

AIRoute dashboard                    # Open dashboard in browser
AIRoute open                         # Alias for dashboard
AIRoute status                       # Runtime status (uptime, requests, providers)

Setup & provisioning

Interactive wizard
AIRoute setup                        # Step-by-step interactive setup
Non-interactive (CI / Docker)
AIRoute setup --non-interactive \
  --password 'admin-password' \
  --add-provider \
  --provider openai \
  --api-key 'sk-...' \
  --test-provider

Environment variables for non-interactive setup:

VariablePurpose
AIRoute_SETUP_PASSWORDAdmin password (≥8 chars)
AIRoute_PROVIDERProvider id (e.g. openai, anthropic)
AIRoute_PROVIDER_NAMEDisplay name for the connection
AIRoute_PROVIDER_BASE_URLOptional OpenAI-compatible base URL override
AIRoute_API_KEYProvider API key
AIRoute_DEFAULT_MODELOptional default model
DATA_DIROverride AIRoute data directory

Diagnostics

AIRoute doctor                       # Full health check
AIRoute doctor --json                # Machine-readable JSON
AIRoute doctor --no-liveness         # Skip HTTP health probe
AIRoute doctor --host 0.0.0.0        # Override liveness host
AIRoute doctor --liveness-url <url>  # Full URL override

Checks performed: Config, Database, Storage/encryption, Port, Node runtime, Native binary (better-sqlite3), Memory, Server liveness.

Exit code is non-zero if any check fails — useful in CI:

AIRoute doctor --json | jq '.checks[] | select(.status=="fail")'

Backup & restore

AIRoute backup                       # Snapshot config + SQLite DB to ~/.AIRoute/backups/
AIRoute restore                      # Restore from a previous snapshot (interactive picker)

Autostart (system tray / startup)

AIRoute autostart enable             # Register AIRoute as a system startup item
AIRoute autostart disable            # Remove startup registration
AIRoute autostart status             # Show current autostart state

On Linux: creates a systemd user service (~/.config/systemd/user/AIRoute.service) and enables linger so the service can start after reboot without a graphical login; on desktop sessions it also adds an XDG autostart entry with --tray. On macOS: LaunchAgent plist. On Windows: registry startup entry.

Tunnels (public URL)

Expose a local AIRoute instance via a secure tunnel:

AIRoute tunnel list                  # List active tunnels
AIRoute tunnel create cloudflare     # Start a Cloudflare Tunnel (free)
AIRoute tunnel create tailscale      # Start a Tailscale funnel
AIRoute tunnel create ngrok          # Start an ngrok tunnel
AIRoute tunnel stop <id>             # Stop a running tunnel

The tunnel URL is printed and can be used as AIRoute_BASE_URL from remote machines.

Config & environment

AIRoute config show                  # Display current effective configuration
AIRoute env show                     # List all AIRoute environment variables
AIRoute env get <KEY>                # Get a single env var value
AIRoute env set <KEY> <value>        # Set an env var (temporary — until restart)

Recovery

AIRoute reset-password               # Reset the admin password interactively
AIRoute reset-encrypted-columns      # Dry-run: show encrypted credential columns
AIRoute reset-encrypted-columns --force  # Null out encrypted credentials in SQLite

Use reset-encrypted-columns --force only if STORAGE_ENCRYPTION_KEY was lost and you need to re-enter all provider API keys.

Logs

AIRoute logs                         # Stream live request logs
AIRoute logs --json                  # JSON log entries
AIRoute logs --search <term>         # Filter by term
AIRoute logs --follow                # Tail mode (keep streaming)

Update

AIRoute update                       # Check for a newer version and prompt to update

Errors

  • doctor shows STORAGE_ENCRYPTION_KEY missing → set the key in .env or run reset-encrypted-columns --force to wipe and re-enter credentials
  • doctor reports native binary fail → npm rebuild better-sqlite3 in the AIRoute app directory
  • tunnel create cloudflare hangs → ensure cloudflared is installed: brew install cloudflare/cloudflare/cloudflared

Signals

GitHub stars
32
Forks
8
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
cli-serve-jaccen
Source
github.com/jaccen/airoute