Skip to content

Console script

Console Script Setup

Optionally, your package can include a console script using Click.

How It Works

If the command_line_interface option is set to click during setup, cookiecutter will add a file cli.py in the pkg_name subdirectory. An entry point is added to pyproject.toml that points to the main function in cli.py.

Usage

To use the console script in development:

1
poetry install

Then execute:

1
$project_slug --help

it will show your package name, project short description and exit.

More Details

You can read more about Python Click at Click.


Last update: 2021-12-20
Back to top