dfx completion
Reference
Generate a shell completion script for dfx.
Basic usage
dfx completion [option] SHELL
The command takes installed extensions into account when generating the completion script, so you should regenerate it after installing or removing extensions.
The values supported for SHELL are bash, elvish, fish, powershell,
and zsh. The default value is bash.
Options
You can use the following option with the dfx completion command.
| Option | Description - |
|---|---|
--bin-name <name> | Name of the command. Only needed if referring to dfx by another name, such as with an alias. Default dfx. |
Examples
Generate a bash completion script:
dfx completion
Generate a zsh completion script:
dfx completion zsh
Enable completion in zsh, e.g. by placing this line in ~/.zshrc:
source <(dfx completion zsh)
Enable completion in bash, e.g. by placing this line in ~/.bashrc:
source <(dfx completion)