Skip to content

Commit 3b45e11

Browse files
authored
Merge pull request #23 from mittwald/feat/tui
feat(tui): add a toolkit for full-screen terminal applications
2 parents f10cd62 + eb4d335 commit 3b45e11

36 files changed

Lines changed: 8725 additions & 0 deletions

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ compiled into your binary.
3030
| [`term`](https://pkg.go.dev/github.com/mittwald/cli-kit/term) | Terminal detection and size, the `--color` mode with `NO_COLOR` and `TERM=dumb`, visible text width, truncation, padding, word wrapping, OSC 8 hyperlinks and when to write them, 24-bit color detection, and untrusted output made safe to show |
3131
| [`theme`](https://pkg.go.dev/github.com/mittwald/cli-kit/theme) | SGR styles, styles parsed from user settings ("fg=white:bg=#aa0000:bold"), regular expression matches painted into painted text, the color roles the other packages paint with, unified diffs painted the way git paints them, painted JSON, and a stable color per name |
3232
| [`pick`](https://pkg.go.dev/github.com/mittwald/cli-kit/pick) | Interactive list selection with filtering, views and ranges, per-row and in-cell painting, an adjustable look, switches, and line-edited text and secret input |
33+
| [`tui`](https://pkg.go.dev/github.com/mittwald/cli-kit/tui) | Full-screen terminal applications from widgets: lists and tables that filter as you type, text fields and editors, switches, radio buttons, check lists, forms, dialogs and menus, panels, tabs and pages, a key legend, a help screen and a status bar, with a headless driver for tests |
3334
| [`live`](https://pkg.go.dev/github.com/mittwald/cli-kit/live) | Blocks of lines redrawn in place, detail/result output separation, and cursor and terminal restore on exit, panic and signals |
3435
| [`progress`](https://pkg.go.dev/github.com/mittwald/cli-kit/progress) | A gradient progress bar with a stall countdown that steps aside for log lines |
3536
| [`table`](https://pkg.go.dev/github.com/mittwald/cli-kit/table) | Tables in plain, framed and Markdown styles, and CSV/TSV records, with spreadsheet formulas escaped on request |
@@ -53,6 +54,7 @@ To see the interactive packages at work, run the demo program:
5354
```shell
5455
go run github.com/mittwald/cli-kit/examples/demo@latest --help
5556
go run github.com/mittwald/cli-kit/examples/demo@latest pick
57+
go run github.com/mittwald/cli-kit/examples/demo@latest tui
5658
```
5759

5860
### Color and terminal

‎examples/demo/main.go‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
// - progress: a progress bar over fake steps, with log lines that step
1111
// around it and a stalled step that counts down its timeout
1212
// - live: a block of lines redrawn in place
13+
// - tui: a full-screen ticket tool on made-up tickets: a filtered table,
14+
// dialogs, a thread, a reply editor and the key legend (needs a
15+
// terminal)
1316
// - table: a table in every drawn style, or in the format --output names
1417
// - theme: the color roles, a painted diff, painted JSON, a stable color
1518
// per name and a style read from --style
@@ -63,6 +66,7 @@ func run() int {
6366
newTableCommand(),
6467
newThemeCommand(),
6568
newNoticeCommand(),
69+
newTUICommand(),
6670
newTermCommand(links),
6771
cobrax.NewVersionCommand(info),
6872
)

0 commit comments

Comments
 (0)