Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
  • 한국어
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
  • 한국어
GitHub
  • Categories

    • Bits
    • Bytes
    • Chart
    • Conversions
    • Core
    • Database
    • Dataframe
    • Dataframe Or Lazyframe
    • Date
    • Debug
    • Default
    • Env
    • Experimental
    • Expression
    • Filesystem
    • Filters
    • Formats
    • Generators
    • Hash
    • History
    • Lazyframe
    • Math
    • Misc
    • Network
    • Path
    • Platform
    • Plugin
    • Prompt
    • Random
    • Removed
    • Shells
    • Strings
    • System
    • Viewers

tui for viewers

Build interactive terminal UIs by composing `tui` subcommands.

Command Type

built-in

Signature

> tui {flags}

Input/output types:

inputoutput
nothingstring

Examples

List TUI subcommands

> tui

Notes

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:

namedescriptiontype
tui bindRun a hook when a key is pressed anywhere in the TUI.built-in
tui boxGroup widgets inside a titled, bordered box.built-in
tui buttonAdd a button that runs a hook, or submits its label, when activated.built-in
tui debugRender a TUI without a terminal and return the screen plus the resolved layout, focus order, and pages.built-in
tui labelAdd static text: inline, or as the title bar (--title) or status bar (--status).built-in
tui logAdd an append-only log view. Streamed rows appear at the bottom.built-in
tui menuAdd a menu bar with mnemonics, dropdown items, and actions.built-in
tui previewShow text for the selected table, tree, or select row. Arrow keys stay on the source.built-in
tui progressAdd a progress bar.built-in
tui runRun a composed TUI until the user quits or submits a selection.built-in
tui searchAdd a search box that filters tables, logs, trees, and selects as you type.built-in
tui selectAdd a radio list of items, or a checkbox list with --multi.built-in
tui splitLay out child widgets side by side (or stacked with --vertical) with draggable dividers.built-in
tui tabGroup widgets as a page in the tab bar.built-in
tui tableAdd a navigable table. Pipeline rows become the rows; scalars show as one item column.built-in
tui textboxAdd an editable text field. Tab to focus it, then type.built-in
tui treeAdd a tree for nested records or a directory walk.built-in