Skip to main content

Autogenerate Completions for CLI tools built with click

Project description

Autogenerate Completions for CLI tools built with click

Add the integration to your CLI tool:

pip install fig-click-completions

Add new subcommand to your CLI tool.

  • You must pass in the root level CLI.
  • Note: make sure you use the name generate_fig_spec.
from fig_click_completions import fig

...

@cli.command()
def generate_fig_spec():
    fig.print_completion_spec(cli)

cli.add_command(generate_fig_spec)

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

$CLI generate-fig-spec > $CLI.ts

Updating

Prereqs:

  • Create a ~/.pypirc
[testpypi]
  username = __token__
  password = ...

(Note that __token__ is NOT a placeholder)

  • Install twine
python3 -m pip install --upgrade twine
  1. Bump the version in setup.cfg
  2. python3 -m build
  3. twine upload dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fig-click-completions-0.0.4.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

fig_click_completions-0.0.4-py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page