Summary
Add shell tab completion for zsh and bash so users can autocomplete commands, flags, and server names when using the CLI.
Files to modify
scripts/completions/_mcp-observatory (new zsh completion script)
scripts/completions/mcp-observatory.bash (new bash completion script)
package.json — add a postinstall script hint or note in README about sourcing completions
What to change
- Create a zsh completion file at
scripts/completions/_mcp-observatory that:
- Autocompletes top-level commands:
test, scan, report, history, setup-ci, demo
- Autocompletes flags:
--json, --watch, --accessible, --quiet, --timeout, etc.
- Autocompletes
--format values: json, markdown, terminal, html
- Create a bash completion file at
scripts/completions/mcp-observatory.bash with the same completions.
- Add a note to the README installation section:
# zsh
source <(mcp-observatory completion zsh)
# bash
source <(mcp-observatory completion bash)
- Follow the existing command definitions in
src/commands/ to ensure all flags and subcommands are covered.
Reference
Use existing CLI command definitions in src/commands/*.ts for flag names. See similar completions in projects like gh or kubectl for patterns.
Estimated time
~20 minutes
Summary
Add shell tab completion for zsh and bash so users can autocomplete commands, flags, and server names when using the CLI.
Files to modify
scripts/completions/_mcp-observatory(new zsh completion script)scripts/completions/mcp-observatory.bash(new bash completion script)package.json— add apostinstallscript hint or note in README about sourcing completionsWhat to change
scripts/completions/_mcp-observatorythat:test,scan,report,history,setup-ci,demo--json,--watch,--accessible,--quiet,--timeout, etc.--formatvalues:json,markdown,terminal,htmlscripts/completions/mcp-observatory.bashwith the same completions.src/commands/to ensure all flags and subcommands are covered.Reference
Use existing CLI command definitions in
src/commands/*.tsfor flag names. See similar completions in projects likeghorkubectlfor patterns.Estimated time
~20 minutes