A Salesforce CLI plugin to use fzf's custom fuzzy completion.
fuzzy-completion-demo.webm
Note
The video was recorded using , as the completion trigger (export FZF_COMPLETION_TRIGGER=',')
See: https://github.com/junegunn/fzf/#custom-fuzzy-completion
fzf's custom completion only supports zsh and bash but due to a (bug?) in the bash implementation this plugin only works in zsh (for now, I plan to support bash).
fzfand fuzzy completion for your shell installed.jq(used for command completion)
See fzf's install instructions: https://github.com/junegunn/fzf/#installation
If you already have the fzf binary installed and want to install the fuzzy completion for your shell you can clone the fzf repo and source the completion script in your bashrc/zshrc:
https://github.com/junegunn/fzf/tree/master/shell
sf plugins install @cristiand391/sf-plugin-fzf-cmp
Then run sf fzf-cmp and follow the instructions to source the completion function for sf in your shell.
The following completion scenarios are supported:
sf, sf helpand sf which support command completion.
--target-org | -o: org username completion
This will suggest all auth'd orgs (even hubs), except in cases where the required org type can be derived from a command name, e.g.
sf org delete scratch --target-org will only suggest scratch org usernames ;).
--target-dev-hub | -v: devhub username completion
sf config (set|get|unset): config variables completion.
If trying to set, get or unset target-org or target-dev-hub it will suggest org usernames.
sf project deploy (start|validate) (--metadata | -m): metadata component names in "type:name" format in your current project.
sf plugins (inspect|uninstall): suggest all plugins (except uninstall, which will only get user plugins (installed or linked).