@dbhost-app/cli
v0.2.3
Published
Cross-platform CLI for DBHost
Maintainers
Readme
DBHost CLI
Cross-platform CLI for DBHost on macOS and Linux.
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_...DBHost supports two API key scopes for paid plans:
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. Use Full account access only for trusted automation that needs to provision databases.
Selected-database keys only list the databases they can access. If you try a database-specific command against an out-of-scope database, the API responds the same way it would for a missing resource.
If you prefer environment variables:
export DBHOST_API_KEY=dbh_...
export DBHOST_API_URL=https://dbhost.app/api/v1Common 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>Add --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 logindbhost auth logoutdbhost databases listdbhost databases get <id>dbhost databases create <name> [display-name]dbhost databases create <name> --display-name "My App"dbhost databases delete <id> --yesdbhost 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> --yesdbhost backups restore <database-id> <filename> [--yes] [--json]dbhost backups restore-upload <database-id> <file-path> [--yes] [--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