@dbhost-app/cli
v0.3.0
Published
Cross-platform CLI for DBHost
Maintainers
Readme
DBHost CLI
Cross-platform CLI for DBHost on macOS and Linux.
The published CLI uses DBHost API keys and therefore requires a Pro or Business account.
See CHANGELOG.md for release history.
Install
Run the CLI directly with npx:
npx @dbhost-app/cli@latest --helpOr install it globally:
npm install -g @dbhost-app/cli
dbhost --helpAuth
Create an API key from Settings in the dashboard, then log in:
dbhost auth login --api-key dbh_...Paid plans support two API key scopes:
Selected databaseslimits the key to only the databases you chooseFull account accesscan create and manage every database in your account
Selected databases is the recommended default. A Full account access key is required for database creation, collaborator/member/invitation administration, and webhook administration.
Selected-database keys only list the databases they can access. If you use a database-specific command against an out-of-scope database, the API responds as if the resource were missing.
If you prefer environment variables:
export DBHOST_API_KEY=dbh_...
export DBHOST_API_URL=https://dbhost.app/api/v1Mutating local tests and smoke runs must set DBHOST_API_URL to an explicit
local test server. They must never fall back to the production base URL.
Common usage
dbhost databases list
dbhost databases create analytics-v2 --display-name "Analytics V2"
dbhost databases create analytics-v2 "Analytics V2"
dbhost backups trigger <database-id>
dbhost backups download <database-id> 20260326_222551.sql.gz
dbhost backups delete <database-id> 20260326_222551.sql.gz --yes
dbhost databases reset-password <database-id>
dbhost operations wait <operation-id>
dbhost databases environment <database-id> stagingAdd --json to any command for machine-readable output.
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.
Commands
dbhost auth login [--api-key KEY] [--base-url URL]dbhost auth logoutdbhost databases list [--json]dbhost databases get <id> [--json]dbhost databases create <name> [display-name] [--display-name "My App"] [--json]dbhost databases start|stop|restart <id> [--json]dbhost databases environment <id> <production|staging|development|other|none> [--json]dbhost databases reset-password <id> [--json]dbhost databases repair-ownership <id> [--json]dbhost backups list <database-id> [--json]dbhost backups trigger <database-id> [--no-wait] [--json]dbhost backups download <database-id> <filename> [--output PATH] [--json]dbhost backups delete <database-id> <filename> [--yes] [--json]dbhost operations get|wait <operation-id> [--timeout SECONDS] [--json]dbhost network list <database-id> [--json]dbhost network add <database-id> <cidr> [label] [--json]dbhost network remove <database-id> <entry-id> [--json]dbhost members list <database-id> [--json]dbhost members add <database-id> <email> <admin|developer|viewer> [--json]dbhost members update <database-id> <membership-id> <role> [--json]dbhost members remove <database-id> <membership-id> [--json]dbhost invitations list <database-id> [--json]dbhost invitations resend|revoke <database-id> <invitation-id> [--json]dbhost webhooks list [--json]dbhost webhooks create <https-url> [database-id] [--json]dbhost webhooks rotate|disable <webhook-id> [--json]
When you run dbhost databases list, selected-database API keys only show the databases they can access.
Local development
From the repo root:
node ./packages/dbhost-cli/bin/dbhost.js --help