mkunit completions
Generate shell completions for mkunit.
mkunit completions <shell>
Description
The completions command generates shell completion scripts for
bash, zsh, fish, or PowerShell. Completions provide tab-completion for
commands, flags, and unit names.
Arguments
| Argument | Description |
|---|---|
<shell> |
Target shell: bash, zsh, fish, powershell |
Setup Instructions
Bash
# Add to ~/.bashrc
eval "$(mkunit completions bash)"
# Or save to a file (recommended for faster shell startup)
mkunit completions bash > ~/.local/share/bash-completion/completions/mkunit
Zsh
# Add to ~/.zshrc (before compinit)
eval "$(mkunit completions zsh)"
# Or save to a file in your fpath
mkunit completions zsh > ~/.zsh/completions/_mkunit
# Make sure completions directory is in fpath (add to ~/.zshrc before compinit)
fpath=(~/.zsh/completions $fpath)
Fish
# Save to fish completions directory
mkunit completions fish > ~/.config/fish/completions/mkunit.fish
PowerShell
# Add to your PowerShell profile ($PROFILE)
mkunit completions powershell | Out-String | Invoke-Expression
What Gets Completed
The completions provide suggestions for:
- Commands:
mkunit ser<TAB>→mkunit service - Flags:
mkunit service --re<TAB>→--restart,--requires - Flag values:
mkunit service --restart <TAB>→always,on-failure, etc. - Unit names:
mkunit status my<TAB>→myapp.service - File paths: For flags that accept paths
Examples
Generate and test (Bash)
# Source completions for current session
source <(mkunit completions bash)
# Test it
mkunit ser # completes to 'service'
mkunit service --rest # completes to '--restart'
Generate and test (Zsh)
# Source completions for current session
source <(mkunit completions zsh)
# Test it
mkunit sta # shows 'status', 'start' options
Verify installation
# Bash
complete -p mkunit
# Zsh
which _mkunit
Tip
If you installed mkunit via Homebrew, completions may be set up automatically.
Check with brew info mkunit.
See Also
- Installation Guide - Complete setup instructions