Skip to content

feat: add grant list command for programmatic target discovery#33

Closed
aaearon wants to merge 1 commit intofeat/output-jsonfrom
feat/list-command
Closed

feat: add grant list command for programmatic target discovery#33
aaearon wants to merge 1 commit intofeat/output-jsonfrom
feat/list-command

Conversation

@aaearon
Copy link
Owner

@aaearon aaearon commented Feb 21, 2026

Summary

  • New grant list command that lists eligible cloud targets and Entra ID groups without triggering elevation
  • Supports --provider (filter by CSP), --groups (groups only), --refresh (bypass cache)
  • Text and JSON output via --output json
  • Reuses existing fetchEligibility() and fetchGroupsEligibility() shared helpers
  • Registered in commands.go

Motivation

Enables LLM agents to discover available targets programmatically (grant list --output json), then construct direct elevation commands (grant --target "..." --role "..." --output json). Without this, there is no non-interactive way to discover eligible targets.

Depends on

Test plan

  • TestListCommand — table-driven: not authenticated, cloud text, cloud JSON, groups only, provider filter, no targets, merged cloud+groups
  • TestListCommand_JSONOutput — verifies listOutput JSON structure with cloud and group targets
  • TestListCommand_GroupsOnlyJSON — verifies --groups excludes cloud targets from JSON
  • TestListCommand_MutualExclusivity — verifies --groups and --provider are mutually exclusive
  • All existing tests pass (make test)
  • Lint clean (make lint)

New command lists eligible cloud targets and Entra ID groups without
triggering elevation. Supports --provider, --groups, --refresh flags
and --output json for machine-readable output.

Enables LLM agents to discover available targets non-interactively,
then construct direct elevation commands with --target/--role flags.
@aaearon aaearon deleted the branch feat/output-json February 21, 2026 08:32
@aaearon aaearon closed this Feb 21, 2026
@aaearon aaearon deleted the feat/list-command branch February 21, 2026 08:32
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