| 1 | <p align="center"> |
| 2 | <img width="300" src="https://github.com/withfig/fig/blob/main/static/FigBanner.png?raw=true"/> |
| 3 | </p> |
| 4 | |
| 5 | --- |
| 6 | |
| 7 |  |
| 8 | [](https://fig.io?ref=github_autocomplete) |
| 9 | [](https://fig.io/docs/) |
| 10 | [](https://fig.io/community) |
| 11 | [](https://twitter.com/intent/follow?screen_name=fig) |
| 12 | |
| 13 | |
| 14 | # Fig Autocomplete Boilerplate Repo |
| 15 | |
| 16 | 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. |
| 17 | |
| 18 | This repo is similar to a minimal version of our public specs repo, |
| 19 | [withfig/autocomplete](https://github.com/withfig/autocomplete), except with an empty `src/` folder. |
| 20 | |
| 21 | |
| 22 | |
| 23 | ## Usage |
| 24 | |
| 25 | ### Init the .fig folder |
| 26 | |
| 27 | Go to the directory that contains your CLI tool, script, or NPM package and run the following |
| 28 | |
| 29 | ```bash |
| 30 | npx @withfig/autocomplete-tools init |
| 31 | ``` |
| 32 | This will create initialise a `.fig/` folder in your current working directory like the following |
| 33 | ```bash |
| 34 | cli/ |
| 35 | ├── .fig/ |
| 36 | │ └── autocomplete/ |
| 37 | │ ├── src/ # where you edit your completion specs |
| 38 | │ ├── build/ # where your specs compile to |
| 39 | │ ├── .eslintrc.js |
| 40 | │ ├── README.md |
| 41 | │ ├── package-lock.json |
| 42 | │ ├── package.json |
| 43 | │ └── tsconfig.json |
| 44 | ├── node_mod/ |
| 45 | └── my_cli_tool.sh |
| 46 | ``` |
| 47 | |
| 48 | ### Create, test, and compile specs |
| 49 | |
| 50 | `cd` into the `.fig/autocomplete/` folder and run the remaining commands as package.json scripts |
| 51 | |
| 52 | ```bash |
| 53 | # Make a new empty completion spec object in src/ |
| 54 | npm run create-spec |
| 55 | |
| 56 | # Start dev mode to see live updates to your spec in your terminal as you edit. |
| 57 | npm run dev |
| 58 | |
| 59 | # Compile your specs from the src/ folder to build/ |
| 60 | npm run build |
| 61 | ``` |
| 62 | |
| 63 | ### Push Specs to Fig's Cloud |
| 64 | Coming soon |
| 65 | |
| 66 | ## Documentation |
| 67 | |
| 68 | - [Building your first autocomplete spec](https://fig.io/docs/) |
| 69 | - [Personal shortcut autocomplete](https://fig.io/docs/tutorials/visual-shortcuts) |
| 70 | - [Autocomplete for teams / internal CLI tools](https://fig.io/docs/tutorials/building-internal-clis) |
| 71 | - [Autocomplete for local scripts](https://fig.io/docs/tutorials/autocomplete-for-internal-scripts) |
| 72 | |
| 73 | |
| 74 | ## 😊 Need Help? |
| 75 | |
| 76 | Email [[email protected]](mailto:[email protected]) |
| 77 | |
| 78 | <p align="center"> |
| 79 | Join our community |
| 80 | <br/> |
| 81 | <a href="https://fig.io/community"> |
| 82 | <img src="http://fig.io/icons/discord-logo-square.png" width="80px" height="80px" /> |
| 83 | </a> |
| 84 | </p> |