click-prompt
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.
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 withmultiple=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.
Metadata
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| click_prompt-0.7.1.tar.gz | 5.4 kB | With provenance | Details for click_prompt-0.7.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| click_prompt-0.7.1-py3-none-any.whl | Python 3 | none | any | Details for click_prompt-0.7.1-py3-none-any.whl |
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 logRelease 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 logSecurity for click-prompt 0.7.1
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for click_prompt-0.7.1.tar.gz
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 logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.