Rush StackShopBlogEvents
Skip to main content

Configuring tab completion

As of version 5.34.0, Rush supports tab completion so that shell commands can be input more quickly by pressing the TAB key. The setup instructions below are based on the article Tab completion for the .NET Core CLI which provides some additional tips.


To enable tab completion for PowerShell, create or edit the profile stored in the $PROFILE variable. For more information, see How to create your profile and Profiles and execution policy.

Add the following code to your profile:

# PowerShell parameter completion shim for the Rush CLI
Register-ArgumentCompleter -Native -CommandName rush -ScriptBlock {
param($commandName, $commandAst, $cursorPosition)
[string]$value = $commandAst.ToString()
# Handle input like `rush install; rush bui` + Tab
[int]$position = [Math]::Min($cursorPosition, $value.Length)

rush tab-complete --position $position --word "$value" | ForEach-Object {
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)


To enable tab completion for Bash, add the following code to your .bashrc file:

# bash parameter completion for the Rush CLI

local word=${COMP_WORDS[COMP_CWORD]}

local completions
completions="$(rush tab-complete --position "${COMP_POINT}" --word "${COMP_LINE}" 2>/dev/null)"
if [ $? -ne 0 ]; then

COMPREPLY=( $(compgen -W "$completions" -- "$word") )

complete -f -F _rush_bash_complete rush


To enable tab completion for Fish shell, add the following code to the file ~/.config/fish/completions/

# Fish parameter completions for the Rush CLI
complete rush --no-files

function __fish_rush
set -l position (string length (commandline -cp))
set -l word (commandline -opc)
rush tab-complete --word "$word" --position "$position"

complete rush -x -a "(__fish_rush)"


Zsh has slightly different env variables, add the following into ~/.zshrc:

(( ${+commands[rush]} )) && {
_rush_completion() {
compadd -- $(rush tab-complete --position ${CURSOR} --word "${BUFFER}" 2>>/dev/null)
compdef _rush_completion rush

It checks for the existence of rush. This needs to be added after the PATH is properly set (or after nvm is initialized). Otherwise, you will need to remove the first line.