refactor: improve CLI commands and authentication flow
This pull request refactors the CLI commands and improves the authentication flow for the PostgresAI tool.
- Renames the
initcommand toprepare-dbfor clarity. This change better reflects the command's purpose of setting up the database for monitoring. - Renames the
quickstartcommand tolocal-installto provide a more accurate description of its functionality, which involves installing a local monitoring stack. - Introduces
auth --set-keyoption, allowing users to directly input their API key without using the browser-based OAuth flow.
postgres-ai|postgresai|pgai [global options] <command> [command options] [args]
Global options:
--api-key <key>
--api-base-url <url>
--ui-base-url <url>
Commands:
prepare-db [conn] [options]
--db-url <url> (deprecated; use positional conn)
-h, --host <host>
-p, --port <port>
-U, --username <username>
-d, --dbname <dbname>
--admin-password <password>
--monitoring-user <name>
--password <password>
--skip-optional-permissions
--verify
--reset-password
--print-sql
--print-password
mon <subcommand>
local-install [options]
--demo
--api-key <key>
--db-url <url>
--tag <tag>
-y, --yes
start
stop
restart [service]
status
logs [service]
-f, --follow
--tail <lines>
health
--wait <seconds>
config
update-config
update
reset [service]
clean
shell <service>
check
targets <subcommand>
list
add [connStr] [name]
remove <name>
test <name>
generate-grafana-password
show-grafana-credentials
auth [options]
--set-key <key> (сохранить API key без OAuth)
--port <port>
--debug
add-key <apiKey> (deprecated; use "auth --set-key")
show-key
remove-key
issues <subcommand>
list
--debug
--json
view <issueId>
--debug
--json
post_comment <issueId> <content>
--parent <uuid>
--debug
--json
mcp <subcommand>
start
--debug
install [client] (cursor|claude-code|windsurf|codex)
help
Closes #66 (closed)
Edited by Bogdan Tsechoev