completion
Generate shell completion scripts for Prompter CLI.
Usage
prompter completion [shell]Supported shells:
bashzshfishpowershell
Installation
Bash
# Generate completion scriptprompter completion bash > /usr/local/etc/bash_completion.d/prompter
# Or for user-only installationprompter completion bash > ~/.local/share/bash-completion/completions/prompterThen reload your shell or source the completion file:
source ~/.local/share/bash-completion/completions/prompterZsh
# Generate completion scriptprompter completion zsh > "${fpath[1]}/_prompter"
# Or add to your .zshrcecho 'source <(prompter completion zsh)' >> ~/.zshrcThen reload your shell:
source ~/.zshrcFish
# Generate completion scriptprompter completion fish > ~/.config/fish/completions/prompter.fishCompletions will be available in new shell sessions.
PowerShell
# Add to your PowerShell profileprompter completion powershell | Out-String | Invoke-Expression
# Or save to profileprompter completion powershell >> $PROFILEWhat Gets Completed
Shell completion provides suggestions for:
- Commands:
add,edit,list,history,config,completion - Flags: All built-in flags like
--file,--directory,--template - Template flags: Custom flags defined in your templates
- Template names: When using
--templateflag - File paths: When using
--fileflag - Config options: When editing config files
Troubleshooting
Completions Not Working
- Ensure the completion script is in the correct location
- Reload your shell or source the completion file
- Check that the completion system is enabled in your shell
Bash Completion Not Loading
Ensure bash-completion is installed:
# macOSbrew install bash-completion@2
# Ubuntu/Debiansudo apt install bash-completion
# Fedorasudo dnf install bash-completionZsh Completion Not Loading
Ensure completion system is initialized in your .zshrc:
autoload -Uz compinitcompinit