Looking to build Fig autocomplete for private CLI tools, scripts, or NPM packages? This npx module makes it easy to build Fig autocomplete specs and share them specs with your team.
This repo is similar to a minimal version of our public specs repo,
withfig/autocomplete, except with an empty src/
folder.
Go to the directory that contains your CLI tool, script, or NPM package and run the following
npx @withfig/autocomplete-tools init
This will create initialise a .fig/
folder in your current working directory like the following
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
cd
into the .fig/autocomplete/
folder and run the remaining commands as package.json scripts
# 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
Coming soon
- Building your first autocomplete spec
- Personal shortcut autocomplete
- Autocomplete for teams / internal CLI tools
- Autocomplete for local scripts
Email [email protected]