━━━━━━━━━━━━ 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 ━━━
Colors, progress bars, spinners, prompts — terminal UX in one import.
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.
pip install codechu-cliRequires Python 3.10+. Depends on
codechu-fmt and
codechu-meter (both
stdlib-only — no transitive deps).
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).
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 (noNO_COLORreading).Table/box/render_markdown— formatted widgets that respect Unicode widths and ANSI escape codes.
- 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
| 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.
- 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.
MIT — see LICENSE.
Part of Codechu.