Skip to content

Add shell autocomplete (bash/zsh) for aegisctl #81

@saivedant169

Description

@saivedant169

Problem

aegisctl has a growing list of subcommands (pending, approve, deny, verify, evidence, simulate, why, diff-policy, manifest, supply-chain, policy-pack, test-action, plugin). Typing them without tab completion is a drag.

Acceptance criteria

  • New command: aegisctl completion bash prints a bash completion script to stdout
  • New command: aegisctl completion zsh prints a zsh completion script to stdout
  • Completion covers top-level subcommands (not every nested flag, that would be a lot)
  • Short instructions for installing it live in starter-kit/QUICKSTART_PR_WRITER.md or a new docs/aegisctl-completion.md
  • Unit test verifies the output contains the expected subcommand names

Files to touch

  • cmd/aegisctl/completion.go (new)
  • cmd/aegisctl/main.go (wire the new subcommand)
  • cmd/aegisctl/completion_test.go (new)
  • Optional: docs/aegisctl-completion.md for installation instructions

How to test locally

./bin/aegisctl completion bash > /tmp/aegisctl-completion.bash
source /tmp/aegisctl-completion.bash
# Now type "aegisctl " and press TAB

Notes

No need to use a fancy library for this. A hand-written bash function is fine for a project this size. Look at how gh, kubectl, or docker handle their completion scripts for inspiration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions