Skip to content

Add --json output to aegisctl providers #134

Description

@saivedant169

What

aegisctl providers lists the configured providers with their health, as a human table. There is no machine-readable version, so scripting a health check means parsing text.

status, pending, and version already take a --json flag. This does the same for providers.

Scope

  • Add a --json (and -json) flag to the providers command, parsed the same way status and pending do it in cmd/aegisctl/main.go.
  • When set, print the provider list as JSON, including each provider's health/status field so the JSON is as useful as the table.
  • Leave the human table unchanged when the flag is absent.
  • Update the providers line in printUsage() to add (add --json for machine output).

Pointers

  • Target: cmdProviders at cmd/aegisctl/main.go:540.
  • Reference: cmdStatus (line 293) and cmdPending (line 748) show the flag parse and JSON branch to copy.

Acceptance

  • aegisctl providers --json prints valid JSON and nothing else on stdout, health included.
  • aegisctl providers output is unchanged.
  • A small test in the style of cmd/aegisctl/version_test.go covers the JSON path.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions