Skip to content

codechu/cli-py

━━━━━━━━━━━━ c o d e c h u  ·  c l i ━━━━━━━━━━━━

   $ deploy --prod
   ? Deploy to production? [Y/n] y
   deploy
   [12 of 24 · 50% · 1m 32s · 156 items/s]  ████████████░░░░░░░░░░░░  ⠼
     ↳ migrating database…                                            ✓
     ↳ rolling out workers                                            ⠿

━━━ colors · progress · spinners · prompts · tables ━━━

PyPI Python CI License: MIT

Colors, progress bars, spinners, prompts — terminal UX in one import.

codechu-cli

Line-oriented CLI primitives for Python: colors, progress bars, spinners, prompts, tables, boxes. Consistent UX across every Codechu tool, with graceful fallbacks for pipes, Windows, and CI.

Install

pip install codechu-cli

Requires Python 3.10+. Depends on codechu-fmt and codechu-meter (both stdlib-only — no transitive deps).

Quick example

from codechu_cli import ProgressBar, Spinner, confirm

if not confirm("Deploy to production?"):
    raise SystemExit(0)

bar = ProgressBar(len(files)).style("claude").with_eta().with_rate()
for f in files:
    process(f)
    bar.advance(1, label=f.name)
bar.finish()

with Spinner("publishing artifacts…"):
    publish()

POSIX-first. Raw-mode pickers on Linux/macOS, numbered-prompt fallback everywhere else (Windows, CI, pipes).

What you get

  • ProgressBar — bracketed bar with percent, count, ETA, rate. Multiple style presets; subpixel-smooth narrow bars.
  • Spinner — threaded spinner with Braille frames + ASCII fallback, dozens of style presets organised by family and mood.
  • confirm / prompt — yes-no + single-line input with validator + password mode.
  • select / multiselect — arrow-key pickers, numbered fallback off-TTY.
  • Color — fluent ANSI palette (c.low(...), c.high(...)) with caller-controlled enable/disable (no NO_COLOR reading).
  • Table / box / render_markdown — formatted widgets that respect Unicode widths and ANSI escape codes.

Read more

  • API reference — every public symbol with signatures.
  • Recipes — 11 idiomatic patterns end to end.
  • Customize — palettes, templates, custom keymaps, i18n, ASCII-art banners, style discovery.
  • Migration guide — v0.1 → v0.2 → v0.3 breaking changes with before/after code.
  • Changelog

Family

Library Purpose
codechu-fmt Human-readable sizes, durations, rates
codechu-meter Timing primitives — stopwatch, ETA, rate
codechu-spark Unicode sparklines, mini bar charts, heatmaps
codechu-term Terminal capabilities, alt buffer, raw mode
codechu-color Color palettes, WCAG contrast, color-blind variants

Full ecosystem: github.com/codechu.

Credits

  • Spinner glyph styles adapted from cli-spinners.
  • ANSI escape conventions per ECMA-48.
  • Inspiration from rich and questionary; codechu-cli stays minimal and line-oriented.

License

MIT — see LICENSE.

Part of Codechu.

About

Stdlib-only CLI primitives — colors, progress, prompts, spinners, ASCII banners, emoji helpers — with consistent UX across Codechu tools.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages