Loading Specs
Fig loads completion specs for CLI tools and scripts in different orders.
- A CLI tool is like
git
,docker
, orkubectl
that is an executable stored in your$PATH
- A script is an executable
main.py
,deploy.sh
that you reference by its path as the first token e.g../deploy.sh
ornode_modules/.bin/cowsay
Fig will assume you are referring to a CLI tool unless:
- The token contains a
/
- The arg in the completion spec uses the
isScript
prop
CLI tools
Fig looks to load completion specs for CLI tools in the following order
- Private specs (exclusive associated with your personal account or team)
- Public specs (in the src folder of withfig/autocomplete)
- The
~/.fig/autocomplete/build
on your device
Finally, we check ~/fig/user/autocomplete/build/
for mixins
Example
If you create a completion spec for your internal CLI tool called cargo
and deploy this spec to your team account, then Fig would load up this spec when you type cargo[space]
rather than the public cargo
spec
Local Scripts
Fig looks to load completion specs for your local scripts in the following order:
- Specs in the
.fig/autocomplete/build
folder relative to the location of the script e.g. if you type~/desktop/deploy.sh[space]
Fig will search~/desktop/.fig/autocomplete/build
for a completion spec calleddeploy.sh.js
Fig will also check the .fig/user/autocomplete/build/
for mixins. e.g. in the above example, Fig will check ~/desktop/.fig/user/autocomplete/build
for a mixin called deploy.sh.js
Note: Fig will also follow symlinks. e.g. if you do ./bootstrap
and the bootstrap executable is a symlink to ~/my/path/bootstrap
, we will look in ~/my/path/.fig/autocomplete/build
for a completion spec, not ./.fig/autocomplete/build