ShtukbaseStandard

Text interface

tui · version 0.1.0
Other1 check

The project in a terminal: a sidebar, pages, collections, boards and node screens (contours, rules, runs) through `shtukbase tui`. Open it, capture one screen without a terminal (for agents and checks), and a sensor: the binary exists, the project is readable, what the TUI does not show yet.

About the package

The text interface (TUI) is Shtukbase in a terminal: the project sidebar, pages, collections as a table, a kanban, a gallery and a feed, and node screens (automations, runs, rules, contours, resources, progress). It is the sb-tui crate in engine/tui of the Shtukbase repository; it is part of the shtukbase binary through the command shtukbase tui. The package changes nothing in the TUI: it finds the binary, gives it a node that reads this project, and prints screens as text.

Why the name tui: that is the name of the command (shtukbase tui), the crate (sb-tui) and the folder (engine/tui); shtuk run tui open reads without translation.

Actions

  • shtuk run tui open [address]: open the project in a terminal; with an address, straight on a page (work/tasks, @contours). Without a terminal (in a pipe, with an agent) it prints one line saying what to do and exits with code 2.
  • shtuk run tui shot <kind> [address] [flags]: one screen as text, without a terminal. Kinds:
    • sidebar [folders]: the sidebar: pages, collections with counters, boards; the address says which folders to expand (work,norms/rules);
    • page <address>: a page as text (--lines 0..200);
    • rows <address>: a collection as a table (--sort field, --desc, --find word, --limit 40);
    • board <address>: a collection or its view as a board by a state field (work/tasks#tasks--board);
    • screen [address]: the whole window as the terminal draws it (--view 1 is the kanban, --preview, --width, --height, --keys enter,down,c presses keys before the capture). Node screens: @contours, @rules, @runs, @automations, @resources, @progress.
  • shtuk run tui doctor: a sensor that shtuk check runs. It only looks and does not fail the check: the binary is found and of which version; the project is readable; how many of the project's collections and boards are visible in the sidebar. If there is no binary or node, a warning with what to do.

The flag --own-node on all three allows a temporary node in a project with automations (below).

Where the package looks for the binary

  1. The variable SHTUK_TUI_BIN: a path to the file (an explicit choice outweighs everything).
  2. shtukbase on PATH, if it has the TUI (shtukbase --version prints tui: on).
  3. A build in a Shtukbase checkout: engine/target/<profile>/shtukbase, then engine/target/<profile>/examples/tui. The checkout is looked for in SHTUKBASE_REPO, by the package source in .shtukbase/packages.lock, and in the folders around the project.

If it is not found: one line on how to install it, code 2.

How to install the binary

  • From a release: curl -fsSL https://releases.shtukbase.com/install.sh | sh (channel: -s -- --channel beta, version: -s -- --version 0.5.3). The binary lands in ~/.local/bin/shtukbase; the TUI is on in it by default.
  • From source, from the engine/ folder of the repository: cargo build --release -p shtukbase → engine/target/release/shtukbase. The TUI alone, without a node: cargo build --release -p sb-tui --example tui → engine/target/release/examples/tui (it needs an already running node).

The node

The TUI does not read the project itself but through a Shtukbase node. The node serves the projects from its home: ~/.shtukbase/spaces.md (or $SHTUKBASE_HOME) → a space → projects:.

  • If the project is added to the application and the application is running, the package works through that node.
  • Otherwise the package starts a temporary node (shtukbase serve) in a temporary folder where only this project is recorded, and stops it after the screen; it writes nothing into the project. This takes about a second.
  • If the project has pages in /automations, a temporary node is not started without asking: the node could run them. Then add the project to the application or pass --own-node.

Keys

KeyWhat it does
↑ ↓ (j k)up and down; in the sidebar a page opens at once
← →the sidebar, the middle, the right panel; in the sidebar → expands, ← collapses
⌘↑↓, ⇧↑↓, J Kthe next or previous document
Enteropen; on a collection row, open on the right
x, Escclose the right panel
< >narrow or widen the right panel
fthe page from the right panel to full width and back
⌥← ⌥→, ⌘[ ⌘], H Lback and forward
v, 1–4the collection view: table, kanban, gallery, feed
⇧← ⇧→, [ ]scroll the table columns
Space, bpage down, up
ggo to an address, for example work/tasks
eedit the page in $VISUAL/$EDITOR
Ctrl+P, :the command palette and page search
ssort the table by state
p, ⌘⇧↑↓another project
F3–F8node screens: automations, runs, rules, contours, resources, progress
rre-read the screen
/, druns: the state filter; all time or the last day
Enter, Esc, c, ocontours: deeper, back, captures, open the row's page
?hints
qquit

On a Russian keyboard layout the keys work as on QWERTY in the same place. Your own keys are in ~/.config/shtukbase/terminal.toml (on macOS ~/Library/Application Support/shtukbase/terminal.toml). The TUI looks best in Ghostty, kitty, WezTerm or iTerm2: they show images and large headings.

What the TUI does not understand yet in projects on basic

The sensor writes this as warnings. It is fixed in the engine, not in the project:

  • the BOARDS section of the sidebar is empty, although the basic collections declare views layout: board; a board can be seen with shot board <collection>#<view>;
  • rows of a collection with items: {mode: type} (Contours) and with recursive: true (Rules) is empty, although the counter in the sidebar is right;
  • in a table the column headers are field names (taskId), not the label; on a board the columns are phase names (todo), not their title, and empty contour phases are not visible;
  • screen captures the window before the node has answered: the sidebar and the kanban there say "Loading…"; for agents sidebar, rows, board, page are more reliable.

No norms

The TUI shows in the sidebar every collection of the project at any depth, even without a title and with a quoted type. A norm "every collection is visible in the TUI" would not catch a single project error; what the TUI does not show is the engine's business, and the doctor sensor sees it.

Actions 3

NameWhat it doesFileWhen
openOpen the project in a terminal: shtuk run tui open [address]actions/open.ts
shtuk run
shotOne screen as text, without a terminal: shtuk run tui shot <kind> [address]actions/shot.ts
shtuk run
doctorSensor: the binary is found, the version, the project is readable, what is missing from the sidebar (only looks)checks/doctor.ts
check

shtuk check runs the checks; shtuk run tui <name> runs any action. "After install" actions run by themselves only if the package comes from a trusted source.

Package files 5

They go into .shtukbase/packages/tui/; actions run from there.