Skip to content

fix(pgcli): Fix error when initializing pgcli command#31

Open
rgoomar wants to merge 1 commit intorender-oss:mainfrom
rgoomar:fix-pgcli
Open

fix(pgcli): Fix error when initializing pgcli command#31
rgoomar wants to merge 1 commit intorender-oss:mainfrom
rgoomar:fix-pgcli

Conversation

@rgoomar
Copy link

@rgoomar rgoomar commented Mar 18, 2026

Summary

Fix render pgcli failing with Error: flag accessed but not defined: command by bypassing ParseCommand for pgcli's arg parsing. This gets it into a working state.

Motivation

render pgcli is broken — any invocation hits the error because ParseCommand reflects over all cli struct tags on PSQLInput, including Command (tagged cli:"command"), which maps to a --command flag that only psql registers. pgcli is interactive-only and doesn't need that flag.

How to verify

  1. render pgcli --help — should show help without error
  2. render pgcli — should launch interactive database selection
  3. render pgcli <postgres-id-or-name> — should connect directly
  4. render pgcli <postgres-id-or-name> -- --some-pgcli-flag — should pass extra args through
  5. render psql — should still work as before (no regression)

I ran all of these locally with

go build
./cli pgcli

Release notes

Fix `render pgcli` command failing with "flag accessed but not defined: command"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant