v1.0.0: Complete framework
- README.org with overview, architecture, component table, quick start - demo.lisp — working TUI demo exercising multiple components - run-all-tests.lisp — single-script test runner - ROADMAP updated with v1.0.0 documentation milestone - Full test suite: ~280 checks, 100% passing across 9 suites
This commit is contained in:
103
README.org
103
README.org
@@ -1,53 +1,74 @@
|
||||
#+TITLE: cl-tty — Reusable Common Lisp Terminal UI Framework
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :project:cl-tty:readme:
|
||||
# cl-tty — Terminal UI Framework for Common Lisp
|
||||
|
||||
* cl-tty
|
||||
Pure CL terminal UI framework. No ncurses, no FFI, no external dependencies.
|
||||
|
||||
A reusable Common Lisp framework for building rich terminal user interfaces.
|
||||
Built on croatoan (ncurses) with Yoga for Flexbox layout. Provides a component
|
||||
tree model with dirty-tracking, incremental rendering, layered keybinding,
|
||||
theme engine, and full mouse support — the primitives needed to match the TUI
|
||||
quality of Claude Code and OpenCode from Common Lisp.
|
||||
|
||||
** Why
|
||||
|
||||
Common Lisp has no reusable terminal UI framework at the level of Python's
|
||||
Rich/prompt_toolkit or Go's Bubble Tea. Every CL project that wants a
|
||||
terminal UI either builds ncurses from scratch or uses a text-only REPL.
|
||||
cl-tty fills that gap — a component library with Flexbox layout, semantic
|
||||
theming, layered keybinding, and full mouse support. Build a terminal UI once,
|
||||
reuse it everywhere.
|
||||
|
||||
Terminal UIs also work over SSH. A Qt or browser-based UI requires a local
|
||||
display. A cl-tty application runs remotely — same code, same components,
|
||||
accessible from anywhere.
|
||||
|
||||
** Architecture
|
||||
|
||||
```
|
||||
Application code (any CL project)
|
||||
└── cl-tty (layout, components, theme, events, dialogs)
|
||||
└── Yoga (Flexbox layout — C library via FFI)
|
||||
└── croatoan (ncurses terminal rendering)
|
||||
```lisp
|
||||
(ql:quickload :cl-tty)
|
||||
```
|
||||
|
||||
cl-tty depends only on croatoan and Yoga. It is not tied to any application.
|
||||
## Quick start
|
||||
|
||||
** Dependencies
|
||||
```lisp
|
||||
;; Create a modern terminal backend
|
||||
(let ((backend (make-instance 'cl-tty.backend:modern-backend)))
|
||||
(cl-tty.backend:initialize-backend backend)
|
||||
;; Backend is ready — write text, draw boxes, handle input
|
||||
(cl-tty.backend:shutdown-backend backend))
|
||||
```
|
||||
|
||||
- Common Lisp (SBCL tested)
|
||||
- croatoan — ncurses binding for terminal rendering
|
||||
- Yoga — Flexbox layout engine (C library, loaded via CFFI)
|
||||
- Quicklisp libraries as needed (ironclad for hashing, bordeaux-threads)
|
||||
## Architecture
|
||||
|
||||
** Status
|
||||
Two backends, one protocol:
|
||||
|
||||
v0.1.0 — Layout engine (in progress)
|
||||
- **modern-backend** — truecolor 24-bit, OSC 8 hyperlinks, DECICM sync,
|
||||
SGR mouse, kitty keyboard, bold/italic/underline, box-drawing chars
|
||||
- **simple-backend** — ASCII art, no color, universal compatibility
|
||||
|
||||
See ~docs/ROADMAP.org~ for the full release plan.
|
||||
Everything is pure escape sequences (no curses, no terminfo, no FFI).
|
||||
|
||||
** License
|
||||
## Components
|
||||
|
||||
| Component | What it does | Version |
|
||||
|-------------|------------------------------------------------------|---------|
|
||||
| Box | Bordered container with background, title | v0.2.0 |
|
||||
| Text | Styled text with word-wrap, spans | v0.2.0 |
|
||||
| ScrollBox | Scrollable viewport with scrollbars | v0.6.0 |
|
||||
| TabBar | Horizontal tab navigation | v0.6.0 |
|
||||
| Select | Dropdown with fuzzy filter, category headers | v0.7.0 |
|
||||
| TextInput | Single-line text input with readline keybindings | v0.5.0 |
|
||||
| TextArea | Multi-line input with undo/redo, selection | v0.5.0 |
|
||||
| Markdown | Renders markdown with syntax highlighting + diffs | v0.8.0 |
|
||||
| Dialog | Modal overlays with stack management | v0.9.0 |
|
||||
| Toast | Transient notifications (info/success/warning/error) | v0.9.0 |
|
||||
| Mouse | Event handlers, hit-testing, text selection | v0.10.0 |
|
||||
| Slot | Plugin system — named slots for extensible UI | v0.11.0 |
|
||||
|
||||
## Backend features
|
||||
|
||||
| Feature | modern | simple |
|
||||
|-------------------|--------|--------|
|
||||
| Truecolor (24-bit)| Yes | No |
|
||||
| Bold/italic | Yes | No |
|
||||
| OSC 8 hyperlinks | Yes | No |
|
||||
| DECICM sync | Yes | No |
|
||||
| SGR mouse | Yes | No |
|
||||
| Kitty keyboard | Yes | No |
|
||||
| Box drawing chars | Unicode| ASCII |
|
||||
| Pipe-safe | No | Yes |
|
||||
|
||||
## Development
|
||||
|
||||
```bash
|
||||
# Run all tests
|
||||
sbcl --script run-all-tests.lisp
|
||||
|
||||
# Tangle org files
|
||||
emacs --batch --eval "(progn (require 'org) (find-file \"org/FILE.org\") (org-babel-tangle) (kill-buffer))"
|
||||
```
|
||||
|
||||
Literate programming: `.org` files in `org/` are the source of truth.
|
||||
`.lisp` files are generated by tangling.
|
||||
|
||||
## License
|
||||
|
||||
TBD
|
||||
# Test
|
||||
|
||||
Reference in New Issue
Block a user