Git Product home page Git Product logo

salesforce-cli-zsh-completion's Introduction

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 [email protected]: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 [email protected]: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.

salesforce-cli-zsh-completion's People

Contributors

douglascayers avatar wadewegner avatar xoob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

salesforce-cli-zsh-completion's Issues

Fatal Error after update cli into sfdx-cli/7.1.4

After update to : sfdx-cli/7.1.4 and run ./generate.sh
completion stop working with this error :

sfdx fo
_sfdx:139: parse error near `<'
_sfdx:139: parse error near `<'
_sfdx:139: parse error near `<'

Permission denied

Hey Wade, I'm excited to start using this! I'm following the installation instructions but I'm getting a fatal error when I'm cloning your git.
`Cloning into 'salesforce-cli-zsh-completion'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.`

Did I miss something in the instructions?

file path autocompletion not working

Hi Wade,

This is a cool one, but it seems that invalidate the standard autocomplete to folders and files after typing DX commands.
For example, this plugin will autocomplete from sfdx force:so to sfdx force:source: if I press tab button.
But after that, if I'm trying the following
sfdx force:source:retrieve -p force-app/ma and pre tab
it won't use the standard autocomplete what will turn that into
sfdx force:source:retrieve -p force-app/main/

Am I missing any configuration?

Thanks

documentation clarification.

Wade,

First, Fantastic Work.

One quibble, if you're using oh-my-zsh, you'll need to explicitly set {YOURPATH}

zsh looks broken with sfdx-cli/7.37.1

Hi Wade,

Not 100% sure, but this looks to be broken with latest sfdx-cli build

Completions for AWS and Heroku are working fine on my machine, but it could be this machine (brand new mac)

My old machine is running sfdx-cli/7.30.0 (mac) - is working fine. I will dig a little deeper, just heads up

auto-completion not reacting after oh-my-zh upgrade

I'm trying to get sfdx completions working on my oh-my-zh installation.

Steps done:
plugins=(git sfdx) in my ~/.zshrc

upgrade_oh_my_zsh run

I can see two files, _sfdx and README.md in ~/.oh-my-zsh/plugins/sfdx

I open a new terminal window

when I type sfdx fo and then press tab, nothing happens.

Updated autocompletion system is now included in sfdx

Just stumbled across your plugin, and noticed the commands are slightly out of date. (They don't include the new legacy/beta commands/aliases)

Went to update them myself, but it looks like the sfdx force:doc:commands:list has been replaced with sfdx commands...

I was working on a new PR to update it- but sfdx --help indicates there's now zsh autocompletion built into the sfdx plugin for both commands and flags!

parse error near `<' on sfdx TAB

I installed everything according to the doc but when I type and press tab I always get those parse errors:

 robert@Roberts-MacBook-Pro  ~  sfdx for
_sfdx:139: parse error near `<'
_sfdx:139: parse error near `<'
_sfdx:139: parse error near `<'
 robert@Roberts-MacBook-Pro  ~  sfdx for

Clone error

git clone [email protected]:wadewegner/salesforce-cli-zsh-completion.git

Cloning into 'salesforce-cli-zsh-completion'...
Warning: Permanently added the RSA host key for IP address '192.30.253.112' to the list of known hosts.
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.