TUI
hotaru tui is Hotaru full screen in a terminal (SI-560): the stream with its scores, a reader for each item, search, stars, read state, your labels, the agent chat with the changes it asks you to confirm, and live updates from the server. It is part of the CLI (cli.md), uses the same servers and tokens, and talks to the API through @hotaru/sdk like every other client. It is built on pi-tui, the toolkit of the pi family Hotaru already runs on.
hotaru tui # the default serverhotaru tui --server vpshotaru tui --theme day --background transparentIt needs a terminal: with a pipe, or with --json, it says so and exits with 2.
The screen
- The band on top: the mark and the server, then the view’s title. When new items arrive, a firefly pill says how many:
3 new · r. - The stream: one row per item. Its number (for slash commands), unread
●, starred★, the title, the source, the Signal, Facts and Hype bars and the age. Read titles step down to ink-2. Below 88 columns the bars go, and the source goes when the title would get too short. - The reader: Enter opens the selected item in the stream’s place, in a reading column of at most 72 characters: source, author, date and reading time, the title, the score bars, your labels, the link, the AI summary with its key points in a night-2 panel, then the article (its HTML set as Markdown: headings, lists, quotes, code and links) in ink-prose, and the other sources that carry the story. Opening an item reads it, as on the web.
- Search (
/search) puts the results in the list’s place, best match first, the hits in bold; Esc goes back to the stream. - The agent chat:
a,/chat, or anything typed in the prompt that isn’t a command opens it in the list’s place: the same conversation as the web app’s panel (chat.md). Your messages under “You”, with the items you sent along; the agent’s answers set as Markdown, written as they come; a quiet line per tool call (“· Update keyword”), in ember when it failed; your decisions on changes; and why an answer didn’t come. A view the agent shows says to open the chat in the web app. Keys you type in the chat start a message; ↑ ↓ and the page keys scroll; Esc goes back to the reader or the list. - Send to chat:
cputs the selected item (or the one in the reader) with your next message, as on the web, up to five; they show over the prompt, andcon one again takes it back. - Changes to confirm: when the agent asks to change something that waits for you (deleting, say), a panel opens over the screen with each change.
yor Enter confirms the chosen one (the panel’s one firefly button),ncancels it,jkchoose, Esc leaves them waiting. Waiting changes show in lantern in the status line;/changesopens the panel again. Changes already waiting when the TUI starts don’t pop up, they only show in the status line. - The status line:
livewhile the server’s events come through,offline, trying againin lantern when they don’t, what the last command did, and how many items are unread. - The prompt at the bottom, for slash commands.
Keys
| In the list | |
|---|---|
j k ↓ ↑, Page Up/Down |
Move |
g G, Home/End |
First, last |
Enter or l, a double click |
Read the item |
o |
Open the original in the browser (and count it read) |
s |
Star or unstar |
u |
Read or unread |
1 2 3 |
Your label Signal, Facts, Hype: on or off |
r |
Load the list again, new items included |
a |
The agent chat |
c |
Send the item along with your next message, or take it back |
| Esc | Back from search results to the stream |
/ or : |
The prompt, with a / already typed |
Tab or i |
The prompt |
? |
Keys and commands |
q, Ctrl-C |
Leave |
| In the reader | |
|---|---|
j k ↓ ↑ |
Scroll a line |
Space, b, Page Up/Down |
Scroll a page |
g G |
Top, end |
n p, → ← |
Next, previous item in the list |
o s u 1 2 3 a c |
As in the list, for this item |
Esc, q or h |
Back to the list |
In the prompt, Esc goes back to the list or the reader, Tab completes, and ↑ brings back earlier commands. The list loads the next page by itself when the selection nears the end.
Slash commands
| Command | What it does |
|---|---|
/feed [all|unread|starred] |
Shows the stream, only unread items, or starred ones |
/search <words…> |
Searches all your items, as hotaru search does: "exact phrases", -excluded, title: and the like |
/more |
Loads the next page |
/open <n> |
Reads a row |
/star [n…] |
Stars rows by number (/star 3 5, /star 2-4); when they all have a star, takes it back |
/read [n…], /unread [n…] |
Marks rows read or unread |
/label [n…] <labels> |
Sets your labels: /label 3 signal facts; the ones named are on, the others off, as a label says what you think of all three (feedback.md). /label 3 none takes them off |
/refresh |
Loads the stream again |
/theme [auto|night|day] |
Night, day, or auto: follows the terminal |
/background [solid|transparent] |
Paints the night, or keeps the terminal’s own background |
/chat |
The agent chat |
/changes |
The changes the agent asks you to confirm |
/help, /quit |
Without numbers, a command acts on the item in the reader or the selected row. A unique start of a name is enough: /st 3. Text that isn’t a command goes to the agent; // at the start sends a message that begins with a slash.
Looks
The colors are the web app’s tokens from apps/web/DESIGN.md, night and day; apps/cli/src/tui/theme.spec.ts fails when the two drift apart. Without fonts and shadows, the named rules carry the rest: the firefly light only on Signal, the selected row’s edge, the caret and the new-items pill; three inks for text; lantern for warnings and the star; ember for errors; healthy says nothing louder than ink-3.
Theme. auto (the default) asks the terminal for its background and takes day on a light one, night otherwise; without an answer it reads COLORFGBG, then falls back to night. With the transparent background it follows the terminal when it switches between light and dark.
Background. solid (the default) sets the terminal’s own background and text color to night-1 and ink (by day, the pale indigo and the night ink) with OSC 11 and OSC 10, so every empty cell is the night too, and gives the terminal’s colors back on exit, also when the process ends some other way. The band takes the dusk blues, with a few still fireflies at night. transparent keeps the terminal’s background (a translucent or themed one) and colors only the text; hairlines are mixed over the background the terminal reports. Terminals that ignore OSC 11, such as Apple’s Terminal, look the same either way.
The flags win over the config; /theme and /background keep the choice in the config file’s tui key:
{ "default": "vps", "servers": { … }, "tui": { "theme": "auto", "background": "transparent" } }Tip: the mark shows another kanji. The mark is 蛍 (U+86CD), and copying it gives 蛍, but some terminals draw a different character, such as 感. The TUI sends the right character; the terminal draws it with the wrong shape. Most coding fonts have no kanji, so the terminal borrows them from a fallback font, and a broken or patched one can have the wrong shape for 蛍. Terminals that use the system’s fallback, such as one in a browser, show it right. To check, run printf '蛍 感\n' in the same terminal:
-
Wrong there too: it’s the fallback font. Name a Japanese font after your coding font. In Ghostty (
~/.config/ghostty/config),font-familycan be given several times, and the later ones are tried in order:font-family = "Your Coding Font"font-family = "Hiragino Sans"Hiragino Mincho ProNgives the brush look of the web app’s mark;Noto Sans JPworks on Linux. Reload the config or restart the terminal. -
Right there, wrong only in the TUI: the terminal’s glyph cache got out of step. Restarting the terminal clears it; if it comes back, it’s worth reporting to the terminal.
Code
apps/cli/src/tui/: command.ts is the tui command and loads the rest only when it runs, so the other commands start as fast as before. app.ts puts the screen together and keeps its state. components.ts draws the band, the stream, the status line and the panel for overlays; rows.ts one row; chat.ts the chat, the items going with a message and the approvals panel; reader.ts the reader, with html.ts turning the article’s HTML into Markdown (feed text escaped, scripts and the like dropped, only http(s) and mailto links kept); slash.ts parses and completes the commands; theme.ts holds the colors. The specs render rows, the reader and themes to strings and check them. A link opens with open, xdg-open or, on Windows, rundll32 url.dll,FileProtocolHandler (not cmd /c start, which would read & in a link as a command); only http(s) links without spaces or control characters go.
pi-tui finds its optional native helpers (clipboard images) through import.meta.url; the single-executable build defines it for its CommonJS bundle, and without the helpers the TUI works the same.