tui for viewers
Command Type
built-in
Signature
> tui {flags}
Input/output types:
| input | output |
|---|---|
| nothing | string |
Examples
List TUI subcommands
> tuiNotes
You must use one of the following subcommands. Using this command as-is will only produce this help message.
Builders (tui table, tui split, ...) append widgets to a tui value. tui run shows it and returns one record: {action, focused, selected, page, values, rows, live}, where values holds every widget's state by id. tui debug returns the same record plus the painted screen and the resolved layout, for scripts and tests.
Data: a value piped into a builder is the shared data list. Lists and streams are collected in full (up to 100k rows); an external command's output (tail -f log | tui log) and an unbounded range (1..) stay live, and their rows appear as they are produced. When the TUI closes while an external command is still running, it is stopped. A widget can have its own rows with --data, or by piping into it inside a container's child list: tui split [(ls | tui table) (ps | tui table)]. --from <id> (with an optional closure) makes a widget follow another's highlighted row.
Hooks: tui bind, menu actions, tui button, --on-select, and the tui run refresh closure all receive the state record and may return nothing, a new data list, or {action: submit|quit, selected: ...}.
Layout: tui split --sizes [30% 1fr] arranges children; tui box groups them with a border; tui tab makes a page. Colors come from $env.config.tui.
Subcommands:
| name | description | type |
|---|---|---|
tui bind | Run a hook when a key is pressed anywhere in the TUI. | built-in |
tui box | Group widgets inside a titled, bordered box. | built-in |
tui button | Add a button that runs a hook, or submits its label, when activated. | built-in |
tui debug | Render a TUI without a terminal and return the screen plus the resolved layout, focus order, and pages. | built-in |
tui label | Add static text: inline, or as the title bar (--title) or status bar (--status). | built-in |
tui log | Add an append-only log view. Streamed rows appear at the bottom. | built-in |
tui menu | Add a menu bar with mnemonics, dropdown items, and actions. | built-in |
tui preview | Show text for the selected table, tree, or select row. Arrow keys stay on the source. | built-in |
tui progress | Add a progress bar. | built-in |
tui run | Run a composed TUI until the user quits or submits a selection. | built-in |
tui search | Add a search box that filters tables, logs, trees, and selects as you type. | built-in |
tui select | Add a radio list of items, or a checkbox list with --multi. | built-in |
tui split | Lay out child widgets side by side (or stacked with --vertical) with draggable dividers. | built-in |
tui tab | Group widgets as a page in the tab bar. | built-in |
tui table | Add a navigable table. Pipeline rows become the rows; scalars show as one item column. | built-in |
tui textbox | Add an editable text field. Tab to focus it, then type. | built-in |
tui tree | Add a tree for nested records or a directory walk. | built-in |