Use the management CLI

Approve an account-scoped CLI session, list databases, and retrieve connection coordinates.

Markdown

Use the account ID from the console URL. Set the project certificate as the trusted CA for this CLI invocation. Approval runs in your browser, and the CLI exchanges a PKCE code over HTTPS for an account-scoped grant.

export DURAPOST_CA_FILE="$PWD/.local/dev/console.crt"
cli/durapost --profile local login --account "$ACCOUNT_ID"
cli/durapost --json --profile local whoami
cli/durapost --json --profile local databases

Profiles keep account sessions separate. A script can select a profile with --profile and parse the output with --json.

Follow provisioning and connect

Use the operation ID returned when a database is created to wait for a terminal state. The database ID identifies the database after it is ready.

cli/durapost --json --profile local operation "$OPERATION_ID" --wait 20
cli/durapost --json --profile local connect "$DATABASE_ID"

The connection command returns coordinates. Issue or rotate the SQL password separately through the authorized console flow. A CLI grant does not authenticate a PostgreSQL session.

Sign out

cli/durapost --profile local logout
cli/durapost --help

The local CLI profile is owner-readable. Removing account membership also denies subsequent access with that account grant. See Accounts, roles, and passwords for the difference between an account role and a SQL role.