Shell completion support
Why it matters
Shell completions turn mytool dep<TAB> into mytool deploy and mytool deploy --en<TAB> into mytool deploy --environment. Power users depend on them; new users discover commands through them. A CLI with twelve subcommands and no completion support forces users to consult --help for every invocation. Completion scripts are cheap to generate (one line in cobra, one crate in clap, built into oclif) and disproportionately improve daily use.
Severity rationale
Info because completions are a usability enhancement, not a correctness or availability concern.
Remediation
Add a completions subcommand that emits bash/zsh/fish scripts to stdout, and document the install one-liner in README. For cobra in cmd/completion.go:
var completionCmd = &cobra.Command{
Use: "completion [bash|zsh|fish]",
RunE: func(cmd *cobra.Command, args []string) error {
return rootCmd.GenBashCompletion(os.Stdout)
},
}
Users install with mytool completion bash > /etc/bash_completion.d/mytool.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the CLI Quality Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
Taxons
History
- 2026-04-18·v1.0.0·Initial import from cli-quality·automated