Skip to main content

Install

Run the CLI directly with npx:
npx @dbhost-app/cli@latest --help
Or install it globally:
npm install -g @dbhost-app/cli
dbhost --help
DBHost CLI supports macOS and Linux with Node.js 18 or later.

Authenticate

Create an API key from Settings in the dashboard, then log in:
dbhost auth login --api-key dbh_your_api_key_here
The CLI stores the API key locally so you do not need to pass it on every command. If you prefer environment variables:
export DBHOST_API_KEY=dbh_your_api_key_here
export DBHOST_API_URL=https://dbhost.app/api/v1

Common commands

List databases:
dbhost databases list
Use the id column from the list output with dbhost databases get <id>. Create a database:
dbhost databases create analytics-v2 --display-name "Analytics V2"
Or pass the display name as the second argument:
dbhost databases create analytics-v2 "Analytics V2"
Trigger a backup:
dbhost backups trigger <database-id>
Reset a database password:
dbhost databases reset-password <database-id>

JSON output

Add --json to any command for machine-readable output:
dbhost databases list --json
dbhost backups list <database-id> --json

Supported commands

  • dbhost auth login
  • dbhost auth logout
  • dbhost databases list
  • dbhost databases get <id>
  • dbhost databases create <name> [display-name]
  • dbhost databases create <name> --display-name "My App"
  • dbhost databases delete <id> --yes
  • dbhost databases reset-password <id>
  • dbhost backups list <database-id>
  • dbhost backups trigger <database-id>