`init --non-interactive` does not populate the database or branch in credentials file
- Gel Version: 6.9+69ad2a3
- Gel CLI Version: Gel CLI 7.4.0+bb0c441
- OS Version: MacOS 15.5
Steps to Reproduce:
-
gel init --server-instance example --database main --non-interactive - cat "
/edgedb/credentials/example.json" - See that
"database": null, "branch": null,
This is breaking the gel-go client since after a non-interactive install the client cannot connect to the gel instance because it can't build the DSN:
2025/07/16 13:15:17 Error creating Gel client: gel.ConfigurationError: cannot read credentials for instance "example": gel.ConfigurationError: cannot parse credentials in "/Users/redacted/Library/Application Support/edgedb/credentials/example.json": `database` must be a string
exit status 1
Workaround is to manually build the DSN from the credentials file json first and set GEL_DSN before launching.
It looks like this is something we are not testing for explicitly in our shared client test cases, but if gel works to connect, the go client is supposed to be able to connect in the same manner, so I'll work with the Go binding folks to get this working.
gel still works to connect. Not sure if there is some logic that if the branch is null use main baked into the CLI and other clients or not.
Probably still a minor bug as the output claims the branch is set and the behaviour of --non-interactive should likely populate the fields.
Yeah, I confirmed locally that accepting the default in the --interactive mode sets the branch key in the credentials JSON explicitly to main, but when run non-interactively, it ends up as null and the Go client refuses to use it with:
gel.ConfigurationError: cannot read credentials for instance "tmp": gel.ConfigurationError: cannot parse credentials in "/home/strinh/.config/edgedb/credentials/tmp.json": `database` must be a string
exit status 1