unbound-cli
v0.2.0
Published
CLI tool for Unbound - AI Gateway management
Maintainers
Readme
Unbound CLI
Command-line tool for managing your Unbound AI Gateway. Configure policies, manage users and groups, connect AI coding tools, and set up tools like Cursor, Claude Code, Gemini CLI, and more.
Installation
npm install -g unbound-cliQuick Start
# Login via browser
unbound login
# Or login with an API key (for CI/CD or headless environments)
unbound login --api-key <your-api-key>
# Check who you are
unbound whoami
# List policies
unbound policy list
# Set up multiple tools interactively
unbound setup
# Set up a single tool
unbound setup cursorCommands
Authentication
| Command | Description |
|---------|-------------|
| unbound login | Sign in via browser |
| unbound login --api-key <key> | Sign in with an API key (non-interactive) |
| unbound login --domain <domain> | Sign in via a custom domain |
| unbound logout | Remove stored credentials |
| unbound whoami | Show current user, org, and role |
| unbound status | Show CLI status and API connectivity |
Tool Setup
Interactive batch setup:
| Command | Description |
|---------|-------------|
| unbound setup | Select and install multiple tools interactively |
Automated setup (downloads scripts, sets env vars, configures tool):
| Command | Description |
|---------|-------------|
| unbound setup cursor | Download hooks, set env, restart Cursor |
| unbound setup claude-code | Interactive mode selection (subscription or gateway) |
| unbound setup claude-code --subscription | Hooks only (keep your Claude subscription) |
| unbound setup claude-code --gateway | Use Unbound as the AI provider |
| unbound setup gemini-cli | Set GEMINI_API_KEY and base URL |
| unbound setup codex | Set OPENAI_API_KEY and base URL |
Instruction-only (shows API key and base URL to configure manually):
| Command | Description |
|---------|-------------|
| unbound setup roo-code | Show Roo Code config values |
| unbound setup cline | Show Cline config values |
| unbound setup kilo-code | Show Kilo Code config values |
| unbound setup custom-access | Show API key and base URL for direct API access |
Remove configuration:
| Command | Description |
|---------|-------------|
| unbound setup cursor --clear | Remove Unbound config for Cursor |
| unbound setup claude-code --clear | Remove Unbound config for Claude Code |
| unbound setup gemini-cli --clear | Remove Unbound config for Gemini CLI |
| unbound setup codex --clear | Remove Unbound config for Codex |
MDM Setup (Admin)
Configure all users on a device via MDM. Requires root.
| Command | Description |
|---------|-------------|
| sudo unbound setup mdm --admin-api-key KEY --all | Set up all tools |
| sudo unbound setup mdm --admin-api-key KEY cursor codex | Set up specific tools |
| sudo unbound setup mdm --admin-api-key KEY --clear cursor | Remove config for specific tools |
Available tools: cursor, claude-code-subscription, claude-code-gateway, gemini-cli, codex
claude-code-subscription and claude-code-gateway are mutually exclusive. When using --all, claude-code-subscription is used by default.
MDM AI Tools Discovery
Scan a device for installed AI coding tools and report findings to Unbound. Uses a separate discovery-specific API key. --domain defaults to https://backend.getunbound.ai.
| Command | Description |
|---------|-------------|
| sudo unbound discover --api-key KEY | Scan all users on the device (requires root) |
| unbound discover --api-key KEY | Scan current user only |
| sudo unbound discover --api-key KEY --domain URL | Scan with a custom backend URL |
| unbound discover schedule --api-key KEY | Set up 12-hour recurring scan (macOS only) |
| unbound discover unschedule | Remove the scheduled scan |
| unbound discover status | Show scan schedule and log paths |
Policies (Admin only)
| Command | Description |
|---------|-------------|
| unbound policy list | List all policies |
| unbound policy get <id> | Get policy details |
| unbound policy create --name <n> --type <t> | Create a policy |
| unbound policy update <id> | Update a policy |
| unbound policy delete <id> | Delete a policy |
| unbound policy form-data | Get reference data for policy creation |
| unbound policy effective <id> | View effective policies for a user/group |
Policy types: SECURITY, MODEL, COST
Users
| Command | Description |
|---------|-------------|
| unbound users list | List organization members |
| unbound users effective-policies <id> | View effective policies for a user |
User Groups (Admin only)
| Command | Description |
|---------|-------------|
| unbound user-groups list | List all groups |
| unbound user-groups get <id> | Get group details |
| unbound user-groups create --name <n> | Create a group |
| unbound user-groups update <id> | Update a group |
| unbound user-groups delete <id> | Delete a group |
| unbound user-groups effective-policies <id> | View effective policies |
Alias: unbound groups works the same as unbound user-groups.
Tools
| Command | Description |
|---------|-------------|
| unbound tools list | List connected tools |
| unbound tools connect <type> | Connect a tool |
| unbound tools approved | List approved tool types |
Supported tool types: CLAUDE_CODE, CURSOR, COPILOT, ROO_CODE, CLINE, GEMINI_CLI, CODEX, KILO_CODE, CUSTOM_ACCESS
Configuration
Config is stored in ~/.unbound/config.json.
Backend URL priority (highest to lowest):
UNBOUND_API_URLenvironment variablebase_urlin~/.unbound/config.json(set viaunbound config set-url)- Default:
https://backend.getunbound.ai
Frontend URL priority (highest to lowest):
UNBOUND_FRONTEND_URLenvironment variablefrontend_urlin~/.unbound/config.json(set viaunbound config set-frontend-url)- Default:
https://gateway.getunbound.ai
Global Options
All list/get commands support --json for machine-readable JSON output.
unbound policy list --json
unbound users list --json | jq '.members[].email'