DocsIntegratingIntegrationsCement

Fig Autocomplete & Cement

This tutorial will walk you through setting up Fig's integration with the Python CLI framework, Cement.

Install the integration

Add the cement-complete-fig package to your project's dependencies using pip:

pip install cement-complete-fig

Setup the integration

Choose one of the methods below to add the generate-fig-spec subcommand to the top level of your CLI tool.

Generate the spec

You can now automatically generate the completion spec skeleton by running the following command:

my-app generate-fig-spec

To test the completions in dev mode, you can run

# Create dev environment.
yarn create completion-spec my-app

# Use generated fig spec.
my-app generate-fig-spec > .fig/autocomplete/src/my-app.ts

# Launch autocomplete dev mode.
cd .fig/autocomplete
yarn dev

If you edit your app and want to test the changes, just regenerate the spec in the .fig/autocomplete/src/ folder while dev mode is running.

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.