The command-line client

apg acts through the management API only, as you. Install it with either:

pipx install agentic-postgres-cli
uv tool install agentic-postgres-cli

It needs Python 3.11 or newer and nothing else. apg --version names the release it was built for.

Signing in

apg login password --endpoint https://control.agenticpostgresql.com/api/v1 --username NAME --totp-code-stdin

It asks for your password, and reads the six-digit code from standard input when your account has a second factor. A password, a key or a code is read from a prompt or a file only you can read, never from an argument. apg logout ends the session.

The families

CommandWhat it does
apg login password, key, accept, totp-enroll, totp-confirmsign in, accept an invitation, set up the second factor
apg context showthe endpoint, organisation and project the next command uses
apg org list, create, use, members, invite, set-role, remove, keys, key-create, key-revokeorganisations, members, invitations and keys
apg project list, use, show, create, claim, status, sleep, wake, delete, export, backups, idle-sleepprojects
apg compute get, seta project's compute size
apg endpoint show, credential, connectthe two doors and their passwords
apg operation show, list, wait, cancelfollow what you started
apg branch create, reset, delete, list, showbranches and restores
apg plan list, show, notify-meplans
apg usage showusage readings
apg notifications listnotifications
apg insights showQuery Insights
apg monitoring showmonitoring readings

Most commands take --json for a machine-readable answer. A command that starts an operation prints its id; apg operation wait --operation ID follows it to the end.

Exit codes

CodeMeans
0done
2the command line is wrong; nothing was sent
3something the command needs is missing: a session, a chosen organisation, a file only you can read
5the server refused; the refusal's word is printed
6the server could not be reached, or a reading could not be determined
7wait stopped at its own timeout; the operation continues

Something here wrong or missing? Write to invite@agenticpostgresql.com.