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 except the dev/
and specs/
folders are empty (they will appear after you run npm run create-boilerplate
)
- Main docs: fig.io/docs
- Autocomplete for personal shortcuts: fig.io/docs/tutorials/visual-shortcuts
- Autocomplete for teams: fig.io/docs/tutorials/building-internal-clis
Build your first spec in < 3 min: fig.io/docs/getting-started
-
Click "Use this Template" above. Name it
fig-autocomplete-private
-
Clone your forked repo and create an example spec
# 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
- Now go to your terminal and type
abc[space]
. Your example spec will appear. 😊
- 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
Compile your spec then save it to your ~/.fig/autocomplete
folder
# 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 <spec-name>
Compile your spec(s) to the specs/
folder
# 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.
# 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 <spec-name>
Email hello@fig.io