1
0
Форкнуть 0
A Zsh completion file for the Salesforce CLI (and script for updating it)
Перейти к файлу
Wade Wegner 87a5bebd60 Updated for latest version of CLI 2019-12-30 07:33:26 -08:00
.gitignore Added argument completions for all commands 2018-01-07 13:26:38 -08:00
LICENSE Initial commit 2018-01-06 05:56:51 -08:00
README.md Add Oh My Zsh support 2018-01-09 12:44:25 +01:00
_sfdx Updated for latest version of CLI 2019-12-30 07:33:26 -08:00
generate.sh Escape quotes in descriptions and merge other PRs 2019-07-06 01:32:48 -05:00
salesforce-cli-zsh-completion.plugin.zsh Add Oh My Zsh support 2018-01-09 12:44:25 +01:00

README.md

salesforce-cli-zsh-completion

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

sfdx-cli-automation

You also command argument completion.

sfdx-cli-automation

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

Dependencies

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.)

Usage

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

First, clone the repo locally.

git clone git@github.com:wadewegner/salesforce-cli-zsh-completion.git

Update your .zshrc to include the following:

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

# compsys initialization
autoload -U compinit
compinit

Close and open your terminal.

Update the Zsh completion file

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

./generate.sh

This will create a new _sfdx file.

Run the following command to reload the completion.

unfunction _sfdx && autoload -U _sfdx

Enjoy!

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 git@github.com:wadewegner/salesforce-cli-zsh-completion.git ~/.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
plugins=(salesforce-cli-zsh-completion)

Reload your shell and enjoy.