CLI Reference
The axm CLI provides terminal-first access to every AxiomDB feature — projects, branches, network rules, credentials, monitoring, and backups.
Installation
# macOS / Linux (Homebrew)
brew install squareexp/tap/axm
# macOS / Linux (curl)
curl -fsSL https://install.axiomdb.squareexp.com | sh
# Windows
winget install SquareExp.axmVerify:
axm --versionAuthentication
# Login with Square SSO (opens browser)
axm login
# Login with email + password
axm login --email you@example.com --password
# Login with magic link
axm login --magic-link you@example.com
# Check current login status
axm whoami
# Logout
axm logoutThe CLI stores tokens in ~/.config/axm/tokens.json.
Projects
Create a project
axm projects create \
--name "Servers API" \
--app-key servers \
--env prodList all projects
axm projects list
axm projects list --format jsonGet a project
axm projects get <project-id>
axm projects get --name servers-prodDelete a project
axm projects delete <project-id>
axm projects delete <project-id> --yes # skip confirmationGet credentials
axm projects credentials <project-id>
# Outputs DATABASE_URL and DIRECT_URL to stdout
axm projects credentials <project-id> --copy
# Copies DATABASE_URL to clipboardGet usage
axm projects usage <project-id>Branches
List branches
axm branches list <project-id>Create a branch
axm branches create <project-id> \
--name feature-auth \
--lifespan 7d
# Branch from a specific parent
axm branches create <project-id> \
--name feature-auth \
--from staging \
--lifespan 30dGet branch credentials
axm branches credentials <project-id> <branch-name-or-id>Get branch metrics
axm branches metrics <project-id> <branch-name-or-id>Delete a branch
axm branches delete <project-id> <branch-id>
axm branches delete <project-id> <branch-id> --yesNetwork
Check your current IP
axm network my-ipList network rules
axm network list <project-id>
axm network list <project-id> --branch feature-authAdd an allowlist rule
# Allow current machine (auto-detects your IP)
axm network allow <project-id> --label "My laptop"
# Specify a CIDR explicitly
axm network allow <project-id> \
--cidr "203.0.113.10/32" \
--label "Office IP" \
--ports both \
--expires 30d
# Branch-scoped rule
axm network allow <project-id> \
--branch feature-auth \
--scope branch \
--label "Feature branch access"Update a rule
axm network update <project-id> <rule-id> \
--label "Updated label" \
--expires 7dRemove a rule
axm network remove <project-id> <rule-id>Enable public mode
axm network public <project-id> # open port 6432 to all IPs
axm network restrict <project-id> # revert to restricted modeSecrets and Credentials
View credentials
axm secrets get <project-id>
axm secrets get <project-id> --branch feature-authRotate credentials
axm secrets rotate <project-id> --role runtime
axm secrets rotate <project-id> --role direct --yesGenerate framework snippet
axm secrets snippet <project-id> --framework prisma
axm secrets snippet <project-id> --framework drizzle
axm secrets snippet <project-id> --framework sqlalchemyAvailable frameworks: prisma, drizzle, kysely, pg, sqlalchemy, django, laravel, pgx, sqlx
Monitoring
Project metrics
axm metrics <project-id>Branch metrics
axm metrics <project-id> --branch feature-authWatch metrics (live refresh every 10s)
axm metrics <project-id> --watchJobs
Get job status
axm jobs get <job-id>Watch a job until completion
axm jobs watch <job-id>Backups
List backups
axm backups list <project-id>Generate restore plan
axm backups plan <project-id> --target "2025-07-03T02:00:00Z"
axm backups plan <project-id> --target "20250702-120000F" --type labelRestore
axm backups restore <project-id> --target "2025-07-03T02:00:00Z"
axm backups restore <project-id> --target "2025-07-03T02:00:00Z" --yesAudit
View audit log
axm audit <project-id>
axm audit <project-id> --action branch.created
axm audit <project-id> --limit 100 --format jsonGlobal flags
| Flag | Description |
|---|---|
--format json | Output as JSON instead of table |
--quiet / -q | Suppress output, exit code only |
--yes / -y | Skip confirmation prompts |
--api-url <url> | Override the API base URL |
--token <token> | Provide a PASETO token directly (skip stored credentials) |
Environment variables
| Variable | Description |
|---|---|
AXIOMDB_API_URL | Override default API URL |
AXIOMDB_TOKEN | Use a specific Bearer token instead of stored credentials |
AXIOMDB_NO_COLOR | Disable colored output |
AXIOMDB_FORMAT | Default output format (table, json) |
Configuration file
The CLI stores config in ~/.config/axm/config.json:
{
"api_url": "https://api.axiomdb.squareexp.com",
"default_format": "table",
"active_profile": "default",
"profiles": {
"default": {
"email": "ajmal@squareexp.com",
"tenant_id": "..."
}
}
}The CLI supports multiple profiles for managing multiple AxiomDB tenants. Switch profiles with axm profile use name.
How is this guide?
API Reference
Complete REST API reference for the AxiomDB Gateway. All endpoints require a valid PASETO v4 Bearer token unless noted as public.
Architecture
Deep-dive into the AxiomDB system design — the gateway, the data plane, tenant isolation, the Redis job queue, the circuit breaker, and the VPS topology.
