pacificdb-cli
v0.2.6
Published
PacificDB command-line interface for the control plane and data-plane shell
Readme
pacificdb-cli
Command-line interface for the PacificDB control plane. Runs anywhere Node.js ≥ 18 runs — Linux, macOS, and Windows.
Install
Linux / macOS
npm install -g pacificdb-cli
pacificdb shellWindows (PowerShell or CMD)
npm install -g pacificdb-cli
pacificdb shellnpm creates the pacificdb / pacificdb.cmd shims automatically; no PATH edits needed.
Config and the login token are stored per-OS at:
| OS | Location |
| --- | --- |
| Linux | ~/.pacificdb/config.json |
| macOS | /Users/<you>/.pacificdb/config.json |
| Windows | C:\Users\<you>\.pacificdb\config.json |
Override with PACIFICDB_CONFIG=<path> or pass --api-url / PACIFICDB_API_URL per call.
By default, CLI commands use the hosted backend API:
https://api.pacificdb.qzz.ioIf you install locally inside a project, run the binary through npm:
npx pacificdb-cli shell
# or:
./node_modules/.bin/pacificdb shellCommands
pacificdb login # prompts for email/password; token stored in ~/.pacificdb/config.json (0600)
pacificdb logout
pacificdb org list
pacificdb project create --name demo [--org org_id]
pacificdb project list
pacificdb cluster create --name c1 --project prj_id [--tier free]
pacificdb cluster list [--project prj_id]
pacificdb cluster status --cluster cl_id
pacificdb database create --name appdb --cluster cl_id
pacificdb database list --cluster cl_id
pacificdb dbuser create --database db_id --username app
pacificdb dbuser rotate --database db_id --dbuser dbu_id
pacificdb connection-string generate --database db_id --dbuser dbu_id
pacificdb backup create --cluster cl_id
pacificdb backup list
pacificdb restore create --backup bk_id [--cluster cl_id]
pacificdb metrics cluster --cluster cl_id
pacificdb shell # opens the Enterprise Shell
pacificdb shell "pacificdb://app:[email protected]/appdb?orgId=...&projectId=...&clusterId=...&databaseId=..."
pacificdb benchmark run # runs the local artifact-backed quick suite (repo checkout required)
pacificdb benchmark report # prints the public-safe benchmark reportEnterprise shell
pacificdb shell opens the Enterprise Shell against:
https://api.pacificdb.qzz.ioUse it for control-plane work such as signup, login, organizations, projects, clusters, and status checks. Override the backend when needed:
pacificdb shell --api-url https://api.pacificdb.qzz.ioData-plane shell
pacificdb shell "$PACIFICDB_URI" opens a MongoDB-style interactive data shell
over the PacificDB gateway. It supports:
show collections
use users
db.users.insertOne({ name: 'Hitesh', city: 'Hyderabad' })
db.users.find({ city: 'Hyderabad' }, { limit: 20 })
db.users.findOne({ name: 'Hitesh' })
db.users.updateOne({ name: 'Hitesh' }, { $set: { plan: 'pro' } })
db.users.deleteOne({ name: 'Hitesh' })
db.users.countDocuments({})The data shell talks to the PacificDB backend API (https://api.pacificdb.qzz.io)
by default. A connection string may also carry an explicit backend:
pacificdb shell "pacificdb://app:...@cluster/appdb?orgId=...&projectId=...&clusterId=...&databaseId=...&apiUrl=https%3A%2F%2Fapi.pacificdb.qzz.io"For local development with an HTTP backend:
pacificdb shell "$PACIFICDB_URI" --api-url http://localhost:3000If the connection string host itself is a backend endpoint like
10.0.0.4:3000, the shell uses http://10.0.0.4:3000 for the gateway.
Global flags
| Flag | Meaning |
| --- | --- |
| --api-url URL | Control-plane URL (or PACIFICDB_API_URL) |
| --format json\|table | Output format (default table) |
| --no-color | Disable ANSI colors |
| --org / --project / --cluster / --database | Scope ids (defaults come from config) |
Security
- The session token is stored in
~/.pacificdb/config.jsonwith0600permissions; override the location withPACIFICDB_CONFIGor inject the token viaPACIFICDB_TOKEN(CI). - Secrets (tokens, passwords, connection strings) are redacted from all output except the one-time display when a database user is created or rotated — that is the only time the server can show the credential.
--passwordon the command line is supported for automation but warns, since it exposes the secret to shell history; prefer the interactive prompt.
Exit codes
| Code | Meaning | | --- | --- | | 0 | Success | | 1 | Generic failure | | 2 | Usage error | | 3 | Not authenticated | | 4 | Not found / permission denied | | 5 | Server or network error |
