Fig adds autocomplete to the terminal. As you type, Fig pops up subcommands, options, and contextually relevant arguments in your existing terminal on macOS.
Looking to improve autocomplete functionality or add support for your favorite CLI tool? We welcome contributions for new specs!
Completion specs are defined in a declarative JSON schema, that specifies subcommands
, options
and arguments
. Suggestions can be generated dynamically by running shell commands or reading local files, in addition to the information in the spec itself.
For more documentation and tutorials, visit withfig.com/docs
To request completions for a CLI tool, open an issue.
To add a new Spec you can start by copying the example.ts
file from the root directory to the dev
folder. You can now rename it to [commandName].ts
and start creating the spec.
This Repository uses TypeScript to verify the types.
You can typecheck the specs using
npm test
In order to get the best developer experience while creating a new spec we added a dev mode.
You will first need to point the specs
folder of this repo to fig.
You can do that by running
fig settings devAutocompleteFolder $(pwd)/specs
Now you will need to toggle fig`s dev mode by invoking
fig settings developerMode true
This command disabled spec caching and will load the specs from the devAutocompleteFolder
instead of .fig/autocomplete
.
Now you only need to run
npm run watch
which will compile the scripts from the dev
folder as you change them.
In order to use the the specs locally you first need to compile them. You can do that by running
npm run build
after that you need to copy them into your local .fig
folder.
You can do that by running
npm run autocomplete
Fig works with iTerm, the native MacOS Terminal app, Hyper and the integrated terminal in VSCode.
Fig uses the Accessibility API on Mac to insert text on your behalf and read the current keybuffer.
Currently, Fig is only available on MacOS.
Sign up for the waitlist at withfig.com. Fig is currently in a private beta. We are onboarding batches of new users each week.
Yes! Check out the autocomplete for teams in our docs. Reach out to [email protected] if you need help.
Get in touch at [email protected] or chat with us on Slack