Skip to content

Install the CLI using the quickstart. Use pgstack --help or append --help to a command for the full option list.

Command Purpose
pgstack auth login Sign in through the browser and confirm the terminal code
pgstack auth login --no-browser Print the sign-in URL without opening a browser
pgstack auth status Check the current authentication state
pgstack auth logout Remove this computer's saved credentials

Credentials are stored in ~/.config/pgstack/credentials.json. Set PGSTACK_CONFIG_DIR to change that location. Authentication renews during active CLI use and expires after 30 days of inactivity. Logout does not invalidate copied tokens or revoke Access sessions.

Command Purpose
pgstack access start --env production Start a session for a project selected by environment
pgstack access list [project-slug] List your active sessions, optionally for one project
pgstack access extend <session-slug> --duration 15m Add time to an active session
pgstack access revoke <session-slug> --reason "Done" Revoke a session early
Option Purpose
--env <environment> Select by testing, development, staging, or production
--duration <duration> Choose a session duration, up to one hour, for example 30m
--reason <text> Explain the task; required when the project requires a reason
--read-only Enable the read-only guard

When multiple projects share an environment, the CLI asks which project to use. Noninteractive commands require an unambiguous project selection.

Compiled releases connect to the hosted PgStack API. See the public repository for source code and development instructions.