Skip to main content

click-prompt

Supported Python Versions PyPI version License Ruff Downloads/Month

click-prompt extends the Click command-line interface library by adding intuitive, interactive prompts. It's perfect for building more user-friendly CLI tools.

This library is inspired by a post on stackoverflow.com.

Contributions are welcome! Open a pull request or submit an issue.

Installation

To install click-prompt, use pip:

pip install click-prompt

Usage

Here’s a basic example using the choice_option decorator:

import click
from click_prompt import choice_option

@click.command()
@choice_option('--fruit', type=click.Choice(['Apples', 'Bananas', 'Grapefruits', 'Mangoes']))
def select_fruit(fruit: str):
    """Prompt user to select a fruit from a list."""
    print(f"You selected: {fruit}")

if __name__ == '__main__':
    select_fruit()

Example

For more examples see the file example.py.

Example

Available Decorators

Each of these decorators replaces a click.Option (and also works with click.Argument):

  • choice_option
    Prompt the user to select one (or more with multiple=True) from a list.

  • confirm_option
    Yes/No confirmation prompt.

  • filepath_option
    Prompt the user to select a file path with auto-completion.

  • auto_complete_option
    Input prompt with tab completion from a list of choices.

  • input_text_option
    Prompt the user for free-form text input.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

Release files for click-prompt 0.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for click-prompt 0.7.1
File Size Uploaded
click_prompt-0.7.1.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for click-prompt 0.7.1
File Interpreter ABI Platform
click_prompt-0.7.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.4 kB

Release files / click_prompt-0.7.1.tar.gz

Download URL click_prompt-0.7.1.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4558d2d3a8a7e0187fa3ab6b2cc0bfa0c1d7d840245d64fbe09060eba94a9fc8
BLAKE2b-256 checksum
How to use checksums
b2ea8068615f5fd6ed1e3de0f566be63f21bbc8fa1bd24dd26b118d69ffd786d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 22, 2025.

Transparency log

Release files / click_prompt-0.7.1-py3-none-any.whl

Download URL click_prompt-0.7.1-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0ab0e80493d7ad9cb71cfd3903319bbea964b0e190e7f3db21ea03ba2935448f
BLAKE2b-256 checksum
How to use checksums
02096091b944bb39224d8ba66202f85a3441405e08e0f8fccef7117e89d18405
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 22, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.7.1 This release

2 release files

0.7.0

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.5.1

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page