completion
The completion command generates shell completion scripts for bash, zsh, and fish shells.
nextdns-blocker completion SHELLWhere SHELL is one of: bash, zsh, or fish.
Shells Supported
Section titled “Shells Supported”| Shell | Command |
|---|---|
| Bash | nextdns-blocker completion bash |
| Zsh | nextdns-blocker completion zsh |
| Fish | nextdns-blocker completion fish |
Installation
Section titled “Installation”Add to your ~/.bashrc:
eval "$(nextdns-blocker completion bash)"Then reload:
source ~/.bashrcAdd to your ~/.zshrc:
eval "$(nextdns-blocker completion zsh)"Then reload:
source ~/.zshrcSave to the completions directory:
nextdns-blocker completion fish > ~/.config/fish/completions/nextdns-blocker.fishThe completions will be available in new Fish sessions.
What Gets Completed
Section titled “What Gets Completed”Shell completion works for:
- Commands:
nextdns-blocker <TAB>shows all available commands - Subcommands:
nextdns-blocker config <TAB>shows config subcommands - Options:
nextdns-blocker config push --<TAB>shows available flags - Domains:
nextdns-blocker unblock <TAB>shows domains from your blocklist - Allowlist:
nextdns-blocker disallow <TAB>shows domains from your allowlist
Examples
Section titled “Examples”Command Completion
Section titled “Command Completion”$ nextdns-blocker <TAB>allow completion fix nextdns pending status updatecategory config health panic stats test-notifications watchdogdisallow initSubcommand Completion
Section titled “Subcommand Completion”$ nextdns-blocker config <TAB>edit set show push validateOption Completion
Section titled “Option Completion”$ nextdns-blocker config push --<TAB>--config-dir --dry-run --help --verboseDomain Completion
Section titled “Domain Completion”$ nextdns-blocker unblock <TAB>facebook.com instagram.com reddit.com twitter.comAutomatic Installation
Section titled “Automatic Installation”The fix command can automatically install completions:
nextdns-blocker fixThis will detect your shell and install completions if not already present.
Troubleshooting
Section titled “Troubleshooting”Completions Not Working
Section titled “Completions Not Working”- Ensure the eval line is in your shell config file
- Open a new terminal or source the config file
- Verify the completion is loaded:
Terminal window type _nextdns-blocker # For bash/zsh
“Command not found” Error
Section titled ““Command not found” Error”Ensure nextdns-blocker is in your PATH:
which nextdns-blockerIf not found, you may need to add the installation directory to your PATH.
Slow Completion
Section titled “Slow Completion”Domain completion queries your config file. If you have many domains, there may be a slight delay. This is normal.
Related
Section titled “Related”- Shell Completion Feature - Detailed feature documentation
- fix Command - Auto-install completions