Skip to content
A Zsh completion file for the Salesforce CLI (and script for updating it)
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Added argument completions for all commands Jan 7, 2018
LICENSE Initial commit Jan 6, 2018 Add Oh My Zsh support Jan 9, 2018
_sfdx Updated for latest version of CLI Dec 30, 2019 Escape quotes in descriptions and merge other PRs Jul 6, 2019
salesforce-cli-zsh-completion.plugin.zsh Add Oh My Zsh support Jan 9, 2018


Want auto-completion in your shell? Of course you do! You get it with this Zsh completion for the Salesforce CLI.


You also command argument completion.


This repo contains both the Zsh command completion for the Salesforce CLI and a script for generating it.


You only need jq if you plan to run the script to generate the completion file. If not, you only need the CLI. (But jq is pretty awesome, so you probably want it anyway.)


Follow the following steps to use these Salesforce CLI completions in the Zsh.

First, clone the repo locally.

git clone

Update your .zshrc to include the following:

# add custom completion scripts
fpath=({YOURPATH}/salesforce-cli-zsh-completion $fpath)

# compsys initialization
autoload -U compinit

Close and open your terminal.

Update the Zsh completion file

If you want to update the _sfdx completion file, run the following script:


This will create a new _sfdx file.

Run the following command to reload the completion.

unfunction _sfdx && autoload -U _sfdx


Oh My Zsh

Users of Oh My Zsh can import this auto-completion as a plugin. To install it, just clone this repository into the custom plugins folder.

git clone ~/.oh-my-zsh/custom/plugins/salesforce-cli-zsh-completion

Enable it by editing ~/.zshrc. Add salesforce-cli-zsh-completion to the list of extra plugins, like this:

# ~/.zshrc

Reload your shell and enjoy.

You can’t perform that action at this time.