Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.dbhost.app/llms.txt

Use this file to discover all available pages before exploring further.

DBHost CLI is published as @dbhost-app/cli.

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. Paid plans support two API key scopes:
  • Selected databases limits the key to only the databases you choose
  • Full account access can create and manage every database in your account
Selected databases is the recommended default. The CLI reflects the server-side scope automatically: selected-database keys list only the databases they can access, and creating databases requires a full-access key. If you try to use a selected-database key against a database outside its scope, database-specific commands fail the same way as a missing resource. 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>
Download a backup file:
dbhost backups download <database-id> 20260326_222551.sql.gz
Delete a backup file:
dbhost backups delete <database-id> 20260326_222551.sql.gz --yes
Restore from an existing backup:
dbhost backups restore <database-id> 20260326_222551.sql.gz --yes
Import a database dump from a local file:
dbhost backups restore-upload <database-id> ./mybackup.sql.gz --yes
Reset a database password:
dbhost databases reset-password <database-id>
Repair ownership after a pg_dump restore (fixes permission denied from the app role):
dbhost databases repair-ownership <database-id>
Use dbhost backups list <database-id> to discover the filename value before you download or delete a specific backup. Downloads save to ./<filename> by default; pass --output to write the file somewhere else.

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 databases repair-ownership <id>
  • dbhost backups list <database-id>
  • dbhost backups trigger <database-id>
  • dbhost backups download <database-id> <filename> [--output PATH]
  • dbhost backups delete <database-id> <filename> --yes
  • dbhost backups restore <database-id> <filename> [--yes] [--json]
  • dbhost backups restore-upload <database-id> <file-path> [--yes] [--json]