Reusable lazygit-style Textual TUI framework primitives.
Project description
lazy-cuh
lazy-cuh is an experimental Python framework for building lazygit-style
terminal user interfaces on top of Textual.
It provides reusable building blocks for terminal apps that need pane-based navigation, compact key hints, modal flows, and list/tree content that behaves consistently.
Status
Pre-alpha. The package is useful for experimentation and early dogfooding, but APIs are expected to change before a stable release.
Features
- bordered panels with numbered titles and tabs
- vim-like item navigation and optional line numbers
- reusable list, tree, text, and option-style views
- contextual keybars and expandable help hints
- confirm, input, selection, and notice modal models
- action, command, and keybinding primitives
- clear separation between app state, rendering, navigation, viewport, and Textual widget adapters
Installation
pip install lazy-cuh
Pre-release versions may need:
pip install --pre lazy-cuh
Quick Example
from rich.text import Text
from lazy_cuh import (
LineNumberMode,
LineNumberSpec,
ListItem,
ListViewModel,
ListViewSpec,
)
items = (
ListItem(id="panels", label=Text("Composable panels and tabs")),
ListItem(id="navigation", label=Text("Vim-style item navigation")),
ListItem(id="keybars", label=Text("Context-aware keybars")),
)
view = ListViewModel(
items=items,
cursor_index=1,
spec=ListViewSpec(
width=60,
line_numbers=LineNumberSpec(LineNumberMode.RELATIVE),
),
)
for line in view.rendered_lines():
print(line.plain)
Examples
After installing from source, run the interactive demo:
uv run lazy-cuh-demo
Focused examples are also available:
uv run lazy-cuh-example-text-wrap
uv run lazy-cuh-example-help-modal
uv run lazy-cuh-example-help-keybar
uv run lazy-cuh-example-options
Documentation
The documentation lives in docs/ and is built with Astro Starlight. It covers
architecture, package layout, and guides for lists, trees, panels, keybars,
modals, and Textual adapters.
Development
For local development:
uv sync --extra dev --extra release
uv run pytest
uv run pyright
ruff check .
Nix users can enter the packaged development shell with:
nix develop
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lazy_cuh-0.1.0a1.tar.gz.
File metadata
- Download URL: lazy_cuh-0.1.0a1.tar.gz
- Upload date:
- Size: 59.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2fb2816c75f2e23ed9332f028d10472ce7c571eabcb2ab1569e41fb26110417
|
|
| MD5 |
10bc9b463590052a29c3060e3db68746
|
|
| BLAKE2b-256 |
552223163553f2ab37cc95924450e52c8a54cec92e0acec103b4a880f7d0948b
|
Provenance
The following attestation bundles were made for lazy_cuh-0.1.0a1.tar.gz:
Publisher:
release.yml on janthmueller/lazy-cuh
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lazy_cuh-0.1.0a1.tar.gz -
Subject digest:
e2fb2816c75f2e23ed9332f028d10472ce7c571eabcb2ab1569e41fb26110417 - Sigstore transparency entry: 1874125554
- Sigstore integration time:
-
Permalink:
janthmueller/lazy-cuh@f85b14a2cb2e646631c307938325789d8c80cfc2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/janthmueller
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f85b14a2cb2e646631c307938325789d8c80cfc2 -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file lazy_cuh-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: lazy_cuh-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 61.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0335b9baa6303b76d5382c4b278c83c381650aee3a5e3403bd216dfcbd47da38
|
|
| MD5 |
ef1b4e2b7edc11f9d536b7665400b831
|
|
| BLAKE2b-256 |
38d9886fc5e7e3a9d6013a2437b4fe3a46c5ef8407bd077b4ef665246bbfb71d
|
Provenance
The following attestation bundles were made for lazy_cuh-0.1.0a1-py3-none-any.whl:
Publisher:
release.yml on janthmueller/lazy-cuh
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lazy_cuh-0.1.0a1-py3-none-any.whl -
Subject digest:
0335b9baa6303b76d5382c4b278c83c381650aee3a5e3403bd216dfcbd47da38 - Sigstore transparency entry: 1874125728
- Sigstore integration time:
-
Permalink:
janthmueller/lazy-cuh@f85b14a2cb2e646631c307938325789d8c80cfc2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/janthmueller
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f85b14a2cb2e646631c307938325789d8c80cfc2 -
Trigger Event:
workflow_run
-
Statement type: