Skip to content

rameshworsht/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 JSON 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.

Adding a Spec

To add a new Spec you can start by copying the example.ts file from the root directory to the dev folder. You can now rename it to [commandName].ts and start creating the spec.

Typechecking Your Spec

This Repository uses TypeScript to verify the types.

You can typecheck the specs using

npm test

Developing a Spec

In order to get the best developer experience while creating a new spec we added a dev mode. You will first need to point the specs folder of this repo to fig. You can do that by running

fig settings devAutocompleteFolder $(pwd)/specs

Now you will need to toggle fig`s dev mode by invoking

fig settings developerMode true

This command disabled spec caching and will load the specs from the devAutocompleteFolder instead of .fig/autocomplete.

Now you only need to run

npm run watch

which will compile the scripts from the dev folder as you change them.

Using the specs locally

In order to use the the specs locally you first need to compile them. You can do that by running

npm run build

after that you need to copy them into your local .fig folder. You can do that by running

npm run autocomplete

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 uses the Accessibility API on Mac to insert text on your behalf and read the current keybuffer.

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%