All of Fig's completion specs are open source and driven by the community.
If you're interested in improving existing autocomplete functionality or adding support for a new CLI tool, we welcome contributions!
Create your own copy of withfig/autocomplete by forking the repository.
Once you have created your own fork, clone the repo to your local machine.
Make sure to replace
YOUR_GITHUB_USERNAME with your actual username.
git clone https://github.com/YOUR_GITHUB_USERNAME/autocomplete.git fig-autocomplete
Finally, link your fork back to the upstream repo so you can pull the latest updates and contribute changes back.
cd fig-autocomplete git remote add upstream https://github.com/withfig/autocomplete.git
- Edit an existing completion spec inside the
src/folder or create a new one
npm run devto start Fig's local development server.
- Test your edits in your terminal like you do normally.
Tip 1: You can pull the most up to date version of the withfig/autocomplete repo by running
git pull upstream masteror from your fork's Github page.
Tip 2: You can view the logs from your spec by right clicking autocomplete popup window and selecting "Inspect element."
If you are adding autocomplete to a new CLI tool, make sure the CLI Skeleton is mapped out correctly.
Before creating a Pull Request:
npm run testto validate that your completion spec is well-typed.
git pull upstream masterto merge the most up to date version of the withfig/autocomplete repo into your local
npm run lint:fixto ensure your completion spec has the correct formatting.
Commit and push your changes.
git add . git commit -m "feat: add git completion spec" git push origin master
Open your fork on Github. You should see a banner, like the one below.
Click the "Contribute" button, then "Open pull request"
You're done! 🎉
The Fig Core team will review your PR as quickly as possible!