Skip to content

Fig adds autocomplete to your terminal.

License

Notifications You must be signed in to change notification settings

vjpr/autocomplete

Repository files navigation


os Signup Documentation Slack Twitter

Fig adds autocomplete to the terminal. As you type, Fig pops up subcommands, options, and contextually relevant arguments in your existing terminal on macOS.

Fig Visual Autocomplete For Your Terminal Demo

Add a completion spec for a CLI tool

Looking to improve autocomplete functionality or add support for your favorite CLI tool? We welcome contributions for new specs!

Completion specs are defined in a declarative schema that specifies subcommands, options and arguments. Suggestions can be generated dynamically by running shell commands or reading local files, in addition to the information in the spec itself.

For more documentation and tutorials, visit withfig.com/docs

To request completions for a CLI tool, open an issue.

Get Started

git clone https://github.com/withfig/autocomplete.git fig-autocomplete
cd fig-autocomplete

# Install packages
npm install

# Go into testing mode
npm run dev

Now start editing specs in the dev/. They will compile to the specs/ folder on save. You can start testing your spec immediately in your terminal.

Note: by default, Fig looks for completion specs in your ~/.fig/autocomplete folder

Auto-linting, formatting, and type-checking

Install the following plugins discussed here: https://forum.withfig.com/t/auto-linting-and-auto-formatting-completion-specs/53

Other available commands

# 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>

Fig Settings

These CLI commands update the ~/.fig/settings.json file. Read more here.

# Turn on Fig developer mode
fig settings autocomplete.developerMode true


# Update the folder Fig uses to look for completion specs. 
# Only works in developer mode. Otherwise, defaults to ~/.fig/autocomplete
fig settings autocomplete.devCompletionsFolder path/to/folder

Note: These settings are updated automatically when starting / stopping npm run dev

FAQ

What terminals does Fig work with?

Fig works with iTerm, the native MacOS Terminal app, Hyper and the integrated terminal in VSCode.

How does Fig work?

Fig has built an API around the terminal that allows you to insert text, position windows, and run local shell commands and render output in a browser.

Does Fig work on Windows or Linux?

Currently, Fig is only available on MacOS.

How can I get access?

Sign up for the waitlist at withfig.com. Fig is currently in a private beta. We are onboarding batches of new users each week.

Can I use this for internal scripts and CLI tools at my company?

Yes! Check out the autocomplete for teams in our docs. Reach out to [email protected] if you need help.

Did we miss something?

Get in touch at [email protected] or chat with us on Slack

About

Fig adds autocomplete to your terminal.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%