Skip to content

Add --json output to connection list, scope list, and project list #99

@ewega

Description

@ewega

Problem

Only status honors the global --json flag. The list commands (connection list, scope list, project list) output formatted tables to stderr but have no structured output mode.

The plumbing already exists:

  • outputJSON bool in root.go:12
  • printJSON() helper in helpers.go:65-73

These just need to be wired into the three list commands.

Scope of Changes

configure_connection_list.go

When outputJSON is true, collect connections into a []statusConnection (or similar struct) and call printJSON() instead of writing the formatted table.

configure_scope_list.go

When outputJSON is true, output scope entries as JSON array.

configure_project_list.go

When outputJSON is true, output project entries as JSON array.

Acceptance Criteria

  • gh devlake configure connection list --json outputs valid JSON to stdout
  • gh devlake configure scope list --plugin github --connection-id 1 --json outputs valid JSON to stdout
  • gh devlake configure project list --json outputs valid JSON to stdout
  • Without --json, all three commands still output human-readable tables (no behavior change)
  • go build ./... and go test ./... pass

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions