sklp completion — shell completion
Every serious CLI ships shell completion. `sklp completion <shell>` emits a script you source from your shell init file — verbs, flags, enum values, and task names from `.sklp/tasks/` all light up under Tab.
Install
Bash
echo 'source <(sklp completion bash)' >> ~/.bashrc
Requires the bash-completion package on most distros. Open a new shell to pick it up.
Zsh
echo 'source <(sklp completion zsh)' >> ~/.zshrc
Or, if you prefer the $fpath route (works with zinit, antidote, etc.):
sklp completion zsh > "${fpath[1]}/_sklp"
Make sure autoload -U compinit && compinit runs after the file lands. The script declares #compdef sklp at the top so it works in both modes.
Fish
sklp completion fish > ~/.config/fish/completions/sklp.fish
Fish picks it up automatically — no shell restart needed.
What gets completed
- Verbs after
sklp:init,run,dev,diagnose,investigate,auth,issue,cache,version,completion. - Subcommands for
auth,issue,cache,completion. - Flags per verb (
-jobs,-no-cache,-resume,-base-ref,-output,-quiet, ...). - Enum values:
-output→text,json(andmarkdownfordiagnose/investigate)-provider→ovh,mistral,anthropic,openai,openai-compat--status→backlog,in_progress,done,wontfix--type→bug,feature,task,other-only→ci,dev
- Task names after
sklp run: scanned from.sklp/tasks/*.yamlin the current directory. Files prefixed with_are templates and are hidden, matching the runner's behaviour. - File paths for path-typed flags (
-task,-repo,-file,-base-ref,-attach).
Troubleshooting
- Tab does nothing in bash. Check that
bash-completionis installed and sourced.complete -p sklpshould print acomplete -F _sklp sklpline after you source the script. - Zsh complains about
_sklpredefinition. You sourced the script and also have an_sklpfile in$fpath. Pick one. - Task names don't show up. They are read from
.sklp/tasks/relative to your current directory.cdto the repo root first.
Where it lives in the codebase
The script sources live next to the Go entry point under cmd/sklp/:
completion.go— verb dispatcher (sklp completion <shell>)completion_bash.shcompletion_zsh.shcompletion_fish.fish
Verb and flag lists in the scripts are duplicated from the Go source by hand — they run in the shell, not in Go, so there is no auto-generation. If you add or rename a verb / flag, update all three scripts.