Skip to content

Conversation

@NikolayS
Copy link
Contributor

@NikolayS NikolayS commented Dec 26, 2025

Related to https://gitlab.com/postgres-ai/platform/-/issues/346

Summary

  • Reorganize CLI by moving add-key, show-key, and remove-key commands under the auth command group
  • Convert auth from a standalone command to a command group with login as the default subcommand
  • Fix inconsistent help text capitalization ("Prepare" → "prepare")

Changes

Before:

Command Description
auth authenticate via browser (OAuth) or store API key directly
show-key show API key (masked)
remove-key remove API key

After:

Command Description
auth authentication and API key management
auth remove-key remove API key

Usage

  • pgai auth — runs OAuth login flow (default)
  • pgai auth --set-key <key> — store API key directly
  • pgai auth show-key — show masked API key
  • pgai auth remove-key — remove API key

Note

CLI auth reorganization

  • Convert auth into a command group with login as the default subcommand; supports --set-key for direct API key storage
  • Move API key management under auth: add auth show-key and auth remove-key
  • Remove deprecated top-level add-key command

Misc

  • Normalize help text capitalization: prepare-db description now starts with lowercase "prepare"

Written by Cursor Bugbot for commit 64b8756. Configure here.

Related to https://gitlab.com/postgres-ai/platform/-/issues/346

## Summary
- Reorganize CLI by moving `show-key` and `remove-key` commands under the `auth` command group
- Convert `auth` from a standalone command to a command group with `login` as the default subcommand
- Remove deprecated `add-key` command (use `auth --set-key` instead)
- Fix inconsistent help text capitalization ("Prepare" → "prepare")

## Changes

**Before:**

| Command | Description |
|---------|-------------|
| `auth` | authenticate via browser (OAuth) or store API key directly |
| `add-key` | store API key |
| `show-key` | show API key (masked) |
| `remove-key` | remove API key |

**After:**

| Command | Description |
|---------|-------------|
| `auth` | authentication and API key management |
| `auth login` | authenticate via browser (OAuth) or store API key directly |
| `auth show-key` | show API key (masked) |
| `auth remove-key` | remove API key |

## Usage
- `pgai auth` — runs OAuth login flow (default)
- `pgai auth --set-key <key>` — store API key directly
- `pgai auth show-key` — show masked API key
- `pgai auth remove-key` — remove API key
@NikolayS NikolayS force-pushed the claude/setup-postgresai-cli-8gnO2 branch from 50da884 to 64b8756 Compare December 26, 2025 05:25
@NikolayS NikolayS changed the title Set up PostgresAI CLI tool refactor: (CLI) move key auth-related commands under auth group Dec 26, 2025
@NikolayS
Copy link
Contributor Author

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on January 16

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@NikolayS
Copy link
Contributor Author

@cursor review

const auth = program.command("auth").description("authentication and API key management");

auth
.command("login", { isDefault: true })
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Options on subcommand break documented parent command usage

The --set-key, --port, and --debug options are defined on the login subcommand, but the PR description states pgai auth --set-key <key> should work directly. In Commander.js, options on a subcommand are not available when invoking the parent command. Before this change, --set-key was defined directly on auth and worked. Now users must use pgai auth login --set-key <key> instead, breaking the documented usage pattern and backward compatibility with pgai auth --set-key.

Fix in Cursor Fix in Web

@NikolayS NikolayS closed this Jan 2, 2026
@NikolayS NikolayS deleted the claude/setup-postgresai-cli-8gnO2 branch January 2, 2026 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants