Summary
Generate and install shell completion scripts for bash and zsh to improve command-line user experience.
Features
Completion Support
- Command completion (connect, disconnect, status, etc.)
- Server name completion from cached server list
- Country and city code completion
- Flag and option completion
- Context-aware suggestions
Installation Methods
# Generate completion scripts
mbvpn completion bash > mbvpn-completion.bash
mbvpn completion zsh > mbvpn-completion.zsh
# Install system-wide (requires admin)
mbvpn completion install
# Install for current user
mbvpn completion install --user
Example Completions
$ mbvpn co<TAB>
connect countries
$ mbvpn connect us-<TAB>
us-east-01 us-east-02 us-west-01 us-west-02
$ mbvpn connect --<TAB>
--auto-reconnect --kill-switch --help
Implementation Details
- Use Cobra's built-in completion support
- Dynamic server completion from
~/.config/mbvpn/servers.json
- Completion caching for performance
- Support for both bash and zsh shells
Integration with Package Managers
- Include completion files in deb/rpm packages
- Install to standard locations:
- Bash:
/etc/bash_completion.d/mbvpn
- Zsh:
/usr/share/zsh/site-functions/_mbvpn
Files to Create
cmd/completion.go - Completion command implementation
scripts/install-completion.sh - Installation helper
- Update installation documentation
Priority
🎯 Priority 1 (1-2 weeks)
Labels
- enhancement
- priority-1
- user-experience
- developer-experience
Summary
Generate and install shell completion scripts for bash and zsh to improve command-line user experience.
Features
Completion Support
Installation Methods
Example Completions
Implementation Details
~/.config/mbvpn/servers.jsonIntegration with Package Managers
/etc/bash_completion.d/mbvpn/usr/share/zsh/site-functions/_mbvpnFiles to Create
cmd/completion.go- Completion command implementationscripts/install-completion.sh- Installation helperPriority
🎯 Priority 1 (1-2 weeks)
Labels