Skip to main content

Interactive prompts with Rich

Project description

richer-prompt

CI - Test, Build and Release PyPI - Version PyPI - License

Beautiful, Rich-native interactive prompts for Python.

richer-prompt provides interactive terminal prompts built on top of Rich.

Visit the documentation: richer-prompt.readthedocs.io

richer-prompt demo

richer-prompt is designed for applications that already use rich and want interactive prompts that integrate naturally with the rest of their terminal output. Instead of introducing a separate rendering system or requiring a full TUI framework, it extends the rich experience with beautiful, composable prompts.

  • Focused: provides high-quality interactive prompts without requiring a full TUI framework.
  • Rich-native: designed to blend seamlessly with rich's rendering, colors, and layout.
  • Beautiful by default: polished prompts inspired by Claude Code without manual styling.
  • Fully typed: modern type hints for better editor support and safer code.

Installation

You can install richer-prompt from PyPI with pip or your favorite package manager:

pip install richer-prompt
uv add richer-prompt

Demo

To check if richer-prompt was installed correctly, and to see a quick demo of its capabilities, run the following from the command line:

python -m richer_prompt

Quickstart

[!TIP] See the documentation for the full guide and API reference.

Every prompt shares the same API as rich.prompt.Prompt: call an instance for a reusable prompt, or use the .ask() class method for a one-off prompt. Use Choice objects to add labels and descriptions to the options:

from richer_prompt import Choice, Select, Tabs

# One-off prompt
Select.ask("Select a color:", choices=["Red", "Green", "Blue"])

# Reusable prompt instance
confirm_action = Tabs(
    "Do you want to continue?",
    choices=[
        Choice(value=False, label="No"),
        Choice(value=True, label="Yes", description="This action cannot be undone"),
    ]
)
confirm_action()

richer-prompt provides four prompt types: Select, MultiSelect, Tabs, and Form.

Development

The development environment requires uv installed. Makefile has useful commands for development:

$ make help
Usage: make <COMMAND>

Commands:
  setup        Install dependencies and pre-commit hooks
  tests        Run tests with pytest
  pre-commit   Run pre-commit checks on all files
  help         Show this help message

Documentation

The documentation files are located in docs/ directory and written with Sphinx.

$ make -C docs help
Usage: make <COMMAND>

Commands:
  demo    Generate demo GIF
  build   Build Sphinx docs
  serve   Serve Sphinx docs locally with live reload
  clean   Remove build artifacts
  help    Show this help message

Notes:

  • Generated HTML output is written to docs/_build/html (ignore by Git).
  • The demo GIF records the current terminal and this is not exactly reproduced.

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

richer_prompt-0.3.0.tar.gz (136.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

richer_prompt-0.3.0-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file richer_prompt-0.3.0.tar.gz.

File metadata

  • Download URL: richer_prompt-0.3.0.tar.gz
  • Upload date:
  • Size: 136.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for richer_prompt-0.3.0.tar.gz
Algorithm Hash digest
SHA256 6d6e68f01a39f6d8b5af4624eedd3ac20785109b63f02134deb25f4c5f6c3e45
MD5 1350567dcd4877d7a4c458ae9c32d51e
BLAKE2b-256 42e4d07ece6fb013148b3eb60b8d67565202b32fce0edd25fbb6a77de1507aa3

See more details on using hashes here.

Provenance

The following attestation bundles were made for richer_prompt-0.3.0.tar.gz:

Publisher: test-build-release.yaml on gabriel-msilva/richer-prompt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file richer_prompt-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: richer_prompt-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for richer_prompt-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 90b28f016714b787cef34f9fa9380314308a1a610f49cae20f926fa344636ed5
MD5 219bb328aec426797b420ae66d50a727
BLAKE2b-256 ff56e84780f285b7eb0eabb602870f6f9df9062f4227ce7d21e286cbda8f456b

See more details on using hashes here.

Provenance

The following attestation bundles were made for richer_prompt-0.3.0-py3-none-any.whl:

Publisher: test-build-release.yaml on gabriel-msilva/richer-prompt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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