deno completions
You can use the output script to configure autocompletion for deno commands. For example: deno un -> Tab -> deno uninstall.
If you installed Deno with Homebrew, shell completions are installed and kept up to date for you, as long as your shell is configured to load completions from Homebrew's completions directory. In that case you do not need to run deno completions manually.
Examples
Configure Bash shell completion
deno completions bash > deno.bash
if [ -d "/usr/local/etc/bash_completion.d/" ]; then
sudo mv deno.bash /usr/local/etc/bash_completion.d/
source /usr/local/etc/bash_completion.d/deno.bash
elif [ -d "/usr/share/bash-completion/completions/" ]; then
sudo mv deno.bash /usr/share/bash-completion/completions/
source /usr/share/bash-completion/completions/deno.bash
else
echo "Please move deno.bash to the appropriate bash completions directory"
fi
Configure PowerShell shell completion
deno completions powershell | Out-String | Invoke-Expression
Configure zsh shell completion
First add the following to your .zshrc file:
fpath=(~/.zsh/completion $fpath)
autoload -U compinit
compinit
Then run the following commands:
deno completions zsh > _deno
mv _deno ~/.zsh/completion/_deno
autoload -U compinit && compinit
Configure fish shell completion
deno completions fish > completions.fish
chmod +x ./completions.fish
deno completions [OPTIONS] [shell]Output shell completion script to standard output.
deno completions bash > /usr/local/etc/bash_completion.d/deno.bash
source /usr/local/etc/bash_completion.d/deno.bash
Options
--dynamicGenerate dynamic completions for the given shell (unstable), currently this only provides available tasks for deno task.
Last updated on
© 2018–2025 the Deno authors
Licensed under the MIT License.
https://docs.deno.com/runtime/reference/cli/completions