Last updated Jun 23, 2025

How to enable shell autocompletion

Atlassian CLI includes a shell completion feature that allows you to use the Tab key to finish typing a command. When you start typing a command and press the Tab key, it suggests a list of possible commands to complete what you've started.

Shell completion is supported in the following shells:

  • Bash
  • Zsh
  • Fish
  • PowerShell

Zsh completion

  1. Enable shell completion in your environment (if not already enabled), execute the following command in your terminal:
1
2
echo "autoload -U compinit; compinit" >> ~/.zshrc
  1. To enable autocomplete in your current session, execute the following command in your terminal:
1
2
source <(acli completion zsh)

To enable autocomplete in your new session, execute the following commands in your terminal:

Linux

1
2
acli completion zsh > "${fpath[1]}/_acli"

macOS

1
2
acli completion zsh > $(brew --prefix)/share/zsh/site-functions/_acli

Bash Completion

Prerequisites

Ensure you have the bash-completion package installed on your system.

Linux

On most Linux distributions, you can install bash-completion through the package manager. Execute the following command in your terminal

Ubuntu:

1
2
sudo apt update
sudo apt install bash-completion

macOS

On macOS, you can install bash-completion using Homebrew:

  1. Install bash-completion@2:
1
2
brew install bash-completion@2
  1. Configure bash-completion and add the following line to your ~/.bash_profile or ~/.bashrc to load bash-completion:
1
2
if [ -f $(brew --prefix)/etc/bash_completion ]; then
  . $(brew --prefix)/etc/bash_completion
fi
  1. Reload Your shell:
1
2
source ~/.bash_profile  # or source ~/.bashrc

Use Bash Completion

  1. To enable autocomplete in your current session, execute the following command in your terminal:
1
2
source <(acli completion bash)
  1. To enable autocomplete in your new session, execute the following command in your terminal:

Linux

1
2
acli completion bash > /etc/bash_completion.d/acli

macOS

1
2
acli completion bash > $(brew --prefix)/etc/bash_completion.d/acli

Fish Completion

  1. To enable autocomplete in your current session, execute the following command in your terminal:
1
2
acli completion fish | source
  1. To enable autocomplete in your new session, execute the following command in your terminal:
1
2
acli completion fish > ~/.config/fish/completions/acli.fish

PowerShell Completion

  1. To enable autocomplete in your current session, execute the following command in your terminal:
1
2
acli completion powershell | Out-String | Invoke-Expression
  1. To enable autocomplete in every new session, add the above command to your PowerShell profile by following the procedure outlined below:

Windows

  1. Check and Create the profile file:

    • Check if the profile exists:
    1
    2
    Test-Path $PROFILE
    
    • If the profile does not exist (returns False), you can create it with the following command:
    1
    2
    New-Item -Path $PROFILE -ItemType File -Force
    
  2. Edit the profile:

1
2
notepad $PROFILE
  1. Add the following line to the profile file:
1
2
acli completion powershell | Out-String | Invoke-Expression
  1. Save the file and close Notepad.
  2. Restart PowerShell

macOS/Linux

  1. Check and Create the profile file:

    • Check if the profile exists:
    1
    2
    pwsh -c 'Test-Path $PROFILE'
    
    • If the profile does not exist (returns False), create it with the following command:
    1
    2
    pwsh -c 'New-Item -Path $PROFILE -ItemType File -Force'
    
  2. Edit the profile:

    • Open the profile in a text editor like nano
    1
    2
    nano $PROFILE
    
    • Or use Visual Studio Code
    1
    2
    code $PROFILE
    
  3. Add the Autocomplete command and the following line to the profile file:

1
2
acli completion powershell | Out-String | Invoke-Expression
  1. Save and Close
  2. Restart PowerShell

Rate this page: