Skip to content

CLI Overview

The rack-gateway CLI is the primary way developers interact with Convox racks protected by Rack Gateway. It handles authentication, wraps Convox commands, and manages multi-rack configurations.

The standard Convox CLI authenticates directly using the rack’s primary API token. With Rack Gateway, authentication goes through OAuth instead:

Standard Convox: convox → Rack API (primary token)
With Gateway: rack-gateway → Gateway (OAuth session) → Rack API

The rack-gateway CLI:

  • Handles OAuth authentication flow (opens browser, gateway receives callback, CLI polls for completion)
  • Stores session tokens securely per-rack
  • Wraps Convox commands
  • Manages MFA verification when required
  • Supports multiple rack configurations
Terminal window
# Login to a gateway (opens browser for OAuth)
rack-gateway login production https://gateway.example.com
# Run Convox commands through the gateway
rack-gateway apps
rack-gateway ps -a myapp
rack-gateway logs -a myapp
# Set up a convenient alias
alias cg="rack-gateway"
cg apps
cg deploy

Authentication

login, logout, test-auth - Manage your gateway sessions

Rack Management

rack, racks, switch - Configure and switch between racks

Convox Commands

apps, deploy, ps, logs, etc. - All standard Convox operations

Gateway Features

api-token, deploy-approval, gateway - Gateway-specific features

When you run a command like rack-gateway apps:

  1. CLI loads your session token from ~/.config/rack-gateway/config.json
  2. CLI sends the request to the gateway with your session token
  3. Gateway validates your session and checks RBAC permissions
  4. Gateway proxies the request to the Convox rack
  5. Response flows back through the gateway to your terminal

The CLI stores configuration in ~/.config/rack-gateway/:

~/.config/rack-gateway/
└── config.json # Rack URLs, session tokens, current rack

You can override this with the --config flag or GATEWAY_CLI_CONFIG_DIR environment variable.

CommandDescription
login <rack> <url>Login to a gateway via OAuth
logoutLogout from the current rack
test-authTest authentication (optionally with MFA)
CommandDescription
rackShow current rack configuration
racksList all configured racks
switch <rack>Switch to a different rack
CommandDescription
appsList applications
buildCreate a build
buildsList builds
deployDeploy an application
envManage environment variables
execExecute command in a container
instancesList instances
logsView application logs
psList app processes
releasesList releases
resourcesList resources
restartRestart an application
runRun a one-off process
scaleScale app processes
CommandDescription
api-tokenManage API tokens
deploy-approvalManage deploy approvals
gatewayShow gateway server information
versionShow CLI, gateway, and rack versions
webOpen the gateway web UI in browser
FlagDescription
--rack, -rOverride the current rack for this command
--configOverride the config directory
--api-tokenUse an API token instead of session
--mfa-codeProvide MFA code for step-up auth
--mfa-methodSpecify MFA method (totp or webauthn)