5 / 8
TUI
The CLI from the last chapter is great for scripts and for an agent. When
you just want to glance at what's in a project, add a few secrets in a row,
and check them right away, there's athanor tui.
The screen
Athanor — secrets for this project
> DB_PASSWORD [hidden]
STRIPE_TEST_KEY [exposable] sk-test-...
↑/↓ move · enter reveal · y copy · a add · d delete · r run · q quit
Each row is a secret's name, a [hidden]/[exposable] tag (the same
Exposable() from chapter 3, just
rendered), and — if revealed — the value itself alongside it.
Keys
↑/↓(ork/j) — move through the list.enter/space— reveal the selected secret's value. Only one is ever shown at a time — moving to another row clears the previous value from the TUI's memory.y— copy the selected secret's value to the clipboard, without ever printing it to the screen.d— ask to delete the selected secret from both the encrypted file and the manifest; confirm withy, or cancel withn/esc.r— switch to command-input mode: type a command,enterruns it through the sameStore.Runbehindathanor run, output shows right in the TUI;esccancels back to the list.q/ctrl+c— quit.
Why a briefly closes the TUI
The a key — add a secret — works differently from the rest. It exits
the current bubbletea loop, shows a standalone form on a clean terminal
(name → hidden-input value → expose flag → confirm), and reopens the list
once it's saved.
That's a deliberate choice, not a glitch: the form library (huh) Athanor
uses for input works best as its own program on a clean terminal, not
embedded inside another active bubbletea screen. Building a proper
integration of two UI loops in one process would add real complexity for
little benefit — exiting one, showing the other, and coming back is simpler
and more reliable. From the outside it barely registers (a brief flicker),
and the code stays easy to follow.
Checkpoint question. What happens to a value revealed with enter when
you move to a different row?
Answer: it's hidden again — the TUI keeps at most one revealed value in memory at a time, rather than piling them up as you navigate.