This tutorial will walk you through setting up Fig's integration with the Python CLI framework, click.
pip install click_complete_fig
Add new subcommand to your CLI tool.
- You must pass in the root level CLI.
add_completion_spec_commandfunction will add a new
generate-fig-specto the passed in
from click_complete_fig import fig def cli(): pass fig.add_completion_spec_command(cli)
You can now automatically generate the completion spec skeleton by running the following command:
$CLI generate-fig-spec > $CLI.ts
Now if you run
my-cli generate-fig-spec you'll see it output a Fig completion spec!