1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
<p align="center">
<img width="300" src="https://github.com/withfig/fig/blob/main/static/FigBanner.png?raw=true"/>
</p>
---

[](https://fig.io?ref=github_autocomplete)
[](https://fig.io/docs/)
[](https://fig.io/community)
[](https://twitter.com/intent/follow?screen_name=fig)
# Fig Autocomplete Boilerplate Repo
Looking to build [Fig](https://fig.io) autocomplete for private CLI tools, scripts, or NPM packages? This npx module makes it easy to **build** [Fig autocomplete specs](https://fig.io/docs) and **share** them specs with your team.
This repo is similar to a minimal version of our public specs repo,
[withfig/autocomplete](https://github.com/withfig/autocomplete), except with an empty `src/` folder.
## Usage
### Init the .fig folder
Go to the directory that contains your CLI tool, script, or NPM package and run the following
```bash
npx @withfig/autocomplete-tools init
```
This will create initialise a `.fig/` folder in your current working directory like the following
```bash
cli/
├── .fig/
│ └── autocomplete/
│ ├── src/ # where you edit your completion specs
│ ├── build/ # where your specs compile to
│ ├── .eslintrc.js
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ └── tsconfig.json
├── node_mod/
└── my_cli_tool.sh
```
### Create, test, and compile specs
`cd` into the `.fig/autocomplete/` folder and run the remaining commands as package.json scripts
```bash
# Make a new empty completion spec object in src/
npm run create-spec
# Start dev mode to see live updates to your spec in your terminal as you edit.
npm run dev
# Compile your specs from the src/ folder to build/
npm run build
```
### Push Specs to Fig's Cloud
Coming soon
## Documentation
- [Building your first autocomplete spec](https://fig.io/docs/)
- [Personal shortcut autocomplete](https://fig.io/docs/tutorials/visual-shortcuts)
- [Autocomplete for teams / internal CLI tools](https://fig.io/docs/tutorials/building-internal-clis)
- [Autocomplete for local scripts](https://fig.io/docs/tutorials/autocomplete-for-internal-scripts)
## 😊 Need Help?
Email [hello@fig.io](mailto:hello@fig.io)
<p align="center">
Join our community
<br/>
<a href="https://fig.io/community">
<img src="http://fig.io/icons/discord-logo-square.png" width="80px" height="80px" />
</a>
</p>
|