Description
gh devlake configure connection add --plugin github --token <PAT> --name "My Connection" still prompts interactively for "Organization slug (optional, press Enter to skip)" even though all required flags are provided and the github plugin has NeedsOrg: false.
This prevents fully non-interactive/scripted usage of connection creation for the github plugin.
Steps to Reproduce
- Have a DevLake instance running (
gh devlake deploy local)
- Run:
gh devlake configure connection add --plugin github --token ghp_xxx --name "GitHub"
- The CLI prompts:
Organization slug (optional, press Enter to skip):
...and blocks waiting for input.
Expected Behavior
When --plugin and --token flags are provided, and the plugin does not require an org (NeedsOrg: false), the command should skip the org prompt entirely and create the connection non-interactively.
Actual Behavior
The org prompt appears regardless, blocking automation scripts like setup-demo.ps1 from running unattended.
Impact
This affects any scripted/automated setup that uses gh devlake configure connection add for plugins where org is optional (e.g., github, gitlab, circleci). The gh-copilot plugin works correctly since --org is passed explicitly and NeedsOrgOrEnt: true.
Workaround
Use the DevLake REST API directly instead of the CLI for connection creation:
Invoke-RestMethod -Uri "http://localhost:8080/plugins/github/connections" -Method POST -ContentType "application/json" -Body (@{
name = "GitHub"; endpoint = "https://api.github.com/"; authMethod = "AccessToken"
token = "ghp_xxx"; enableGraphql = $true; rateLimitPerHour = 4500
} | ConvertTo-Json)
Suggested Fix
In cmd/configure_connection_add.go, when running in flag mode (i.e., --plugin is set), skip the org/enterprise prompts for plugins where NeedsOrg, NeedsEnterprise, and NeedsOrgOrEnt are all false.
Description
gh devlake configure connection add --plugin github --token <PAT> --name "My Connection"still prompts interactively for "Organization slug (optional, press Enter to skip)" even though all required flags are provided and thegithubplugin hasNeedsOrg: false.This prevents fully non-interactive/scripted usage of connection creation for the
githubplugin.Steps to Reproduce
gh devlake deploy local)gh devlake configure connection add --plugin github --token ghp_xxx --name "GitHub"Expected Behavior
When
--pluginand--tokenflags are provided, and the plugin does not require an org (NeedsOrg: false), the command should skip the org prompt entirely and create the connection non-interactively.Actual Behavior
The org prompt appears regardless, blocking automation scripts like
setup-demo.ps1from running unattended.Impact
This affects any scripted/automated setup that uses
gh devlake configure connection addfor plugins where org is optional (e.g.,github,gitlab,circleci). Thegh-copilotplugin works correctly since--orgis passed explicitly andNeedsOrgOrEnt: true.Workaround
Use the DevLake REST API directly instead of the CLI for connection creation:
Suggested Fix
In
cmd/configure_connection_add.go, when running in flag mode (i.e.,--pluginis set), skip the org/enterprise prompts for plugins whereNeedsOrg,NeedsEnterprise, andNeedsOrgOrEntare allfalse.