Skip to main content
View rawEdit

PostgresAI CLI

Reference​

Install (optional)​

You can run postgresai commands without installing, using npx or bunx. If you prefer to install it globally:

npm install -g postgresai

Authenticate​

Authenticate via browser and store the API key locally:

postgresai login

In the browser, pick one organization, or All my organizations to get a global token that works across all of them. With a global token, add --org <alias> or --org-id <id> (or set PGAI_ORG) to organization-specific commands, and run postgresai orgs to list the organizations it can reach. See organization selection.

Install MCP (Cursor, Claude Code, Windsurf, Codex)​

Install MCP integration for your AI coding tool:

postgresai mcp install

Work with issues​

List open issues (pass --status closed or --status all for the rest):

postgresai issues list

View a specific issue:

postgresai issues view <issue_id>

Post a comment:

postgresai issues post-comment <issue_id> "<comment>"