Fig Autocomplete & oclif

This tutorial will walk you through setting up Fig's integration with golang CLI framework, oclif.

Create the generate-fig-spec subcommand

Go to your CLI's project and run the following

npm install --save @fig/complete-oclif

Now go to your CLI's package.json and add the following

 "oclif": {
    "plugins": [

Voila. Now you can create a completion spec for your CLI by running ./bin/run generate-fig-spec from your project's root directory!

You can also compile your spec and run my-cli generate-fig-spec to see the same output.

Next Steps: now that you have successfully configured the integration you can either push the spec to the autocomplete repo or push it to Fig's cloud.