Completion
dkit completion <shell>
Prints a tab-completion script for your shell, so that pressing Tab after dkit offers its commands and options. The shell is one of bash, zsh, fish, powershell or elvish.
It only prints. No file is written and your shell’s startup files are never edited: where the script goes is up to you.
Setting it up
Pick the line for your shell. Each loads the script from the dkit you have installed, so it stays in step when you update.
zsh: add to ~/.zshrc, after the line that runs compinit:
source <(dkit completion zsh)
bash: add to ~/.bashrc (on macOS, ~/.bash_profile):
eval "$(dkit completion bash)"
fish: run once. Fish reads the file by itself from then on:
dkit completion fish > ~/.config/fish/completions/dkit.fish
PowerShell: add to your profile ($PROFILE):
dkit completion powershell | Out-String | Invoke-Expression
elvish: add to ~/.config/elvish/rc.elv:
eval (dkit completion elvish | slurp)
Open a new shell afterwards. To stop, remove the line, or for fish delete the file.
What is offered
Every command and option that dkit --help lists. dkit mcp is left out, as it is from the help text: an assistant starts it, not you.
Values are not completed: a run id for dkit undo or an app name for dkit uninstall still has to be typed or pasted.
Known limits
- The zsh and bash lines above were tried on macOS. The fish, PowerShell and elvish scripts are generated the same way but have not been loaded in those shells yet.
- With the fish line, run it again after updating Deskit to pick up new commands.
From docs/commands/completion.md at v0.1.0-alpha.2.