https://github.com/withfig/autocomplete-boilerplate
Boilerplate for private CLIs
https://github.com/withfig/autocomplete-boilerplate
Last synced: about 1 year ago
JSON representation
Boilerplate for private CLIs
- Host: GitHub
- URL: https://github.com/withfig/autocomplete-boilerplate
- Owner: withfig
- License: mit
- Created: 2021-04-06T12:55:16.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2022-01-27T20:33:12.000Z (over 4 years ago)
- Last Synced: 2025-03-21T03:34:41.513Z (over 1 year ago)
- Language: JavaScript
- Size: 104 KB
- Stars: 5
- Watchers: 4
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
---

[](https://fig.io?ref=github_autocomplete)
[](https://fig.io/docs/)

[](https://twitter.com/intent/follow?screen_name=fig)
# Autocompletion Boilerplate
This repository is a template for **individuals / teams looking to build autocomplete specs for private CLIs and scripts** (ie scripts that they do not want to make public).
This repo is almost exactly the same as [withfig/autocomplete](https://github.com/withfig/autocomplete) except the `dev/` and `specs/` folders are empty (they will appear after you run `npm run create-boilerplate`)
## Documentation
- Main docs: [fig.io/docs](https://fig.io/docs/)
- Autocomplete for personal shortcuts: [fig.io/docs/tutorials/visual-shortcuts](https://fig.io/docs/tutorials/visual-shortcuts)
- Autocomplete for teams: [fig.io/docs/tutorials/building-internal-clis](https://fig.io/docs/tutorials/building-internal-clis)
## Using this repo
Build your first spec in < 3 min: [fig.io/docs/getting-started](https://fig.io/docs/getting-started)
1. Click "**Use this Template**" above. Name it `fig-autocomplete-private`
2. Clone your forked repo and create an example spec
```bash
# Replace `YOUR_GITHUB_USERNAME` with your own github username
git clone https://github.com/YOUR_GITHUB_USERNAME/fig-autocomplete-private.git fig-autocomplete-private
cd fig-autocomplete-private
# Add withfig/autocomplete as a remote
git remote add upstream https://github.com/withfig/autocomplete-boilerplate.git
# Install packages
npm install
# Create an example spec (call it "abc")
npm run create-example
# Turn on "dev mode"
npm run dev
```
3. Now go to your terminal and type `abc[space]`. Your example spec will appear. 😊
#### Other things to know
- Edit your spec in typescript in the `dev/` folder
- On save, specs are compiled to the `specs/` folder
- In **dev mode** specs are read from the `specs` folders. Otherwise they are read from `~/.fig/autocomplete`
## Save My Spec for Personal use
Compile your spec then save it to your `~/.fig/autocomplete` folder
```bash
# Compile your spec(s) to the specs/ folder
npm run build
# Copy your spec from the specs/ folder to the ~/.fig/autocomplete folder
npm run copy
```
## Share my Spec with My Team
Compile your spec(s) to the `specs/` folder
```bash
# Compile your spec
npm run build
# Commit your changes and push to your repo
git add .
git commit -m "my message"
git push origin master
```
Now have your team clone your repo and then copy all the specs over to their ~/.fig/autocomplete folder
```
git clone https://github.com/YOUR_GITHUB_USERNAME/fig-autocomplete-private.git fig-autocomplete-private
cd fig-autocomplete-private
# Copy all specs from the specs/ folder to the ~/.fig/autocomplete folder
npm run copy:all
```
**Alternatively**, you can simply share your compiled `.js` file with anyone (e.g. through email or Slack). Once they put the file in their `~/.fig/autocomplete` folder, it will start working!
> **Note**: Fig is working on providing a much better experience for sharing specs with your team. We are hoping to launch it very soon.
## Other available package.json commands
```bash
# Create a new spec from a boilerplate template
npm run create-boilerplate
# Typecheck all specs in the dev/ folder
npm test
# Compile typescripts specs from dev/ folder to specs/ folder
npm run build
# Copy all specs from the specs/ folder to the ~/.fig/autocomplete folder
npm run copy:all
# Copy an individual spec from the specs/ folder to the ~/.fig/autocomplete folder
npm run copy
```
## 😊 Need Help?
Email [hello@fig.io](mailto:hello@fig.io)