Your first session¶
In this tutorial you install the TUI, point it at a context, look at the context's workers and its live events, and ask the assistant a question. It takes about ten minutes and changes nothing on the platform: every step only reads.
You need:
- Python 3.14 or newer and uv;
- a Gitea user and personal access token with scope
read:packages(the TUI is published to a private index); - a context: the host and port of a running
virtufin-api, and its API key if it asks for one.
1. Start the TUI¶
In a terminal, give uv the private index and start the TUI:
export VIRTUFIN_REGISTRY_USER=<your-gitea-username>
export VIRTUFIN_REGISTRY_TOKEN=<your-gitea-token>
INDEX="https://${VIRTUFIN_REGISTRY_USER}:${VIRTUFIN_REGISTRY_TOKEN}@gitea.haenerconsulting.com/api/packages/virtufin/pypi/simple/"
uvx --index "$INDEX" --from virtufin-tui virtufin-tui
The TUI fills the terminal. Its first start also wrote
~/.config/virtufin/api/contexts.toml, the list of contexts. Press q, then q again,
to quit.
2. Add your context¶
Open ~/.config/virtufin/api/contexts.toml in an editor and add your context at the end:
[[contexts]]
name = "mine"
api_host = "api.example.com"
api_port = 443
tls = true
api_key = "<your-api-key>"
description = "My first context"
Use the host, port and key you were given; leave out tls and api_key if the endpoint
does not need them. Save the file and start the TUI again with the same uvx command.
3. Switch to it¶
Press → until the Config tab is selected, then 6 (Contexts). The table lists
your contexts, each with a status dot: green answers, red does not (the reason is
next to it), gray is not checked yet.
Highlight mine with the arrow keys and press Enter. The TUI checks that the context
answers, then makes it the active one: the context row under the tab bar now names it on
every tab.
Press → to come round to Home: the connection line shows a green dot, the context
and its URL.
4. Find the workers¶
Press → to the Infra tab, then 2 (Workers). The table lists the context's workers
and stays live: a worker that starts or stops changes its row while you watch.
Press /, type status:running and press Enter. Only the running workers stay; the
status line shows how many pass. Highlight one and press Enter: a popover shows its tags,
config, code history and lifecycle events. Press Escape to close it, and / then
Escape to clear the filter.
5. Watch live events¶
Still on Infra, press 9 (Events), then a. In the picker, highlight
sys.workmanager.worker.lifecycle, press space to select it, and choose Add. Events
arrive in the log as the platform publishes them: a line each time a worker changes state.
space pauses the log and resumes it.
6. Ask the assistant¶
Press → to Config, then 3 (AI). If no AI provider is set up yet, the tab shows a
"configure" hint; setting one up takes two minutes (Set up AI),
or skip this step.
Type Which workers are stopped? and press Enter. The assistant calls the platform's
read operations and answers with the list. It could also change things, but every change
would ask you first.
Press q twice to quit.
What you have learned¶
You started the TUI, added and switched to a context, moved between tabs with ←/→
and the number keys, filtered a live table, followed a topic and asked the assistant.
Next:
- the How-to guides for real tasks: connect a feed, start a worker, halt trading, run a script, make a page;
- Views for every key on every view;
- Contexts and the write gate for why changes ask first on a protected context.