refactor: (CLI) move key auth-related commands under auth group#17
refactor: (CLI) move key auth-related commands under auth group#17NikolayS wants to merge 1 commit into
Conversation
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
50da884 to
64b8756
Compare
|
@cursor review |
There was a problem hiding this comment.
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.
|
@cursor review |
| const auth = program.command("auth").description("authentication and API key management"); | ||
|
|
||
| auth | ||
| .command("login", { isDefault: true }) |
There was a problem hiding this comment.
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.
Related to https://gitlab.com/postgres-ai/platform/-/issues/346
Summary
add-key,show-key, andremove-keycommands under theauthcommand groupauthfrom a standalone command to a command group withloginas the default subcommandChanges
Before:
authshow-keyremove-keyAfter:
authauth remove-keyUsage
pgai auth— runs OAuth login flow (default)pgai auth --set-key <key>— store API key directlypgai auth show-key— show masked API keypgai auth remove-key— remove API keyNote
CLI auth reorganization
authinto a command group withloginas the default subcommand; supports--set-keyfor direct API key storageauth: addauth show-keyandauth remove-keyadd-keycommandMisc
prepare-dbdescription now starts with lowercase "prepare"Written by Cursor Bugbot for commit 64b8756. Configure here.