# Terminal client The Go terminal client uses Bubble Tea, Bloom, Lip Gloss and the daemon client. The dispatcher launches the sibling `albedo-tui` for the default interface and the `new`, `resume`, and `login` commands. The [web client](web.md) is another client of the daemon. ## Application and screens The [client](../cli/internal/terminalclient/client.go) runs the Bubble Tea event loop. Each route registers a renderer, input handler and resize handler together. The [workspace](../cli/internal/tui/app.go) binds those routes to daemon operations, including remote attachment and sign-in. The outer client owns focus, mouse mode, window titles and the navigation animation. [Pages](../cli/internal/terminalui/layout.go) share terminal cells between the filter, list, detail and footer using Bloom flex tracks. The [list index](../cli/internal/terminalui/list.go) maps selections to visible lines and keeps section headings with their rows. Session notices wrap above the list, leaving room for the selection and action keys. Chat composes its viewport and input with the [conversation renderer](../cli/internal/terminalui/conversation.go), preserving terminal image sequences and transcript selection coordinates. The [agents screen](../cli/internal/tui/agents/view.go) owns its tree, draft, and outstanding sends. It draws the graph into a [viewport-sized buffer](../cli/internal/tui/agents/canvas.go). Screens share [palette and controls](../cli/internal/tui/chrome/theme.go) and the [picker search matcher](../cli/internal/pickersearch/search.go). Follow [Add or change a terminal screen](tui-contributing.md) for shared components, keyboard conventions, confirmation behavior, and stale-request handling. ## Chat and events [`ChatModel.Init`](../cli/internal/tui/chat_subscription.go) starts the stream subscription and status requests. The subscription delivers daemon events as Bubble Tea messages. Cancellation and stream termination are handled in the subscription code. Chat transcript state and rendering live in [`transcript_state.go`](../cli/internal/tui/transcript_state.go) and [`transcript.go`](../cli/internal/tui/transcript.go). The active turn shows elapsed time beside its animated face. A completed reply ends with its outcome face, duration, and a clickable ⧉ that copies the original Markdown. When an idle session resumes, the client restores that row from recorded history, including the outcome of a stopped response. Loading [older history](../cli/internal/tui/chat_history.go) joins a reply across page boundaries so its duration and copy action cover the whole reply. Older pages and stream resets use each [replayed row's position](../cli/internal/daemon/history.go) to stamp transcript entries, including signoffs. Live commit events carry their own stamp and retire provisional output. [`chat_shell.go`](../cli/internal/tui/chat_shell.go) parses shell input, submits commands through the daemon client, and updates their output in chat. Shell output is external content, not an instruction to the model. ## Reasoning controls Chat headers and the model picker show model ids by default, and the catalog's display names when the [terminal preferences](#terminal-preferences) ask for them. The session's API ID remains unchanged. The chat loads names through the [session-bound model catalog](../cli/internal/daemon/models.go) when it opens or its model or provider changes. Late replies must match the chat generation, session, provider, and model before changing the displayed name. Missing names or failed reads fall back to the ID. The same read retains model and profile reasoning defaults so inherited chat headers show the effective level. Unknown levels display Provider default. Unsupported profile levels remain visible in the selectors with an unsupported warning and a model-default bypass. The [model picker](../cli/internal/tui/model_picker.go) separates the effective reasoning level from its source in the details pane. Left and Right choose a level, with the actual default annotated. Ctrl+X resets the staged choice to the profile/model default. When the profile has an override, Ctrl+T switches the staged choice between the profile and model default. Enter applies the choice only to this session. Escape cancels it. Ctrl+S separately asks to apply and save the selected model and reasoning for the named profile. Confirming changes that profile without changing the starting profile. The [chat selector](../cli/internal/tui/effort_selector.go), opened with `/effort`, uses a vertical list. The actual default level is annotated instead of appearing as a separate row. Up and Down preview levels, Ctrl+X resets to default, and Ctrl+T switches the default source when a profile override exists. Previewing does not save the choice. Enter applies it and Escape restores the composer. The list keeps the highlight visible in short terminals. [Models](models.md#reasoning-defaults) owns the saved choice and provider resolution contract. ## Settings Choose **settings** in the session picker or open `/settings` in chat to browse **connections**, **agent**, and **preferences**. Type to filter the destinations. Searching for **Honcho** opens its settings, where **account** leads to the Honcho sign-in. Enter opens the selected destination. Escape returns to the same place in the index. [`settings_index.go`](../cli/internal/tui/settings_index.go) routes each choice to the screen that owns it. The index matches enabled owners in the global inventory to their [declared settings](extensions.md#settings-panes). Declared field panes also work from the session picker. Open **extensions** to choose one, or type its name directly in the settings index. Inside **extensions**, **all settings** searches every declared field. In **manage extensions**, Ctrl+W opens the selected extension’s settings when it has a pane. Escape returns to the filtered list. Session-specific choices appear when a session is open. Use the shared [client conventions](contributing.md#preserve-client-conventions) when naming a destination. ## Terminal preferences [`prefs.go`](../cli/internal/tui/prefs.go) owns what the terminal client keeps for itself, apart from the daemon's settings, in `tui.json` under the albedo home. The client reads it once at start. A missing or unreadable file means the defaults. A save replaces the file atomically and keeps keys this client does not know, so other versions can share the file. Do not store daemon settings or anything another client needs there. `/config` lists the file as its last section, under **terminal**, with fields drawn with the same rows and keys as the daemon's sections. A pick there writes the file instead of the daemon, so it takes no settings validator. The saved value applies to every open screen at once, without a restart. Under **chat**, **assistant name** sets the sender label for all web and terminal clients connected to the daemon. Press Ctrl+X on the field to restore `albedo`. `model names` picks `ids`, the default, `lowercase`, or `names`, which `/config` shows as how each writes one model, and `tui.json` stores by name. With `ids`, model rows, the chat header and reasoning levels show the raw model id and level, such as `gpt-5:xhigh`. With `names` they show the catalog's names, such as `GPT-5 · Extra high`, and with `lowercase` the same names in lowercase. Only ids join the model and its level with a colon. Words that are not names, such as Default, Previous setting, and Provider default, take the case of the names around them: capitalized only with `names`. The model picker's search still matches both the name and the id, and its details show the name the row leaves out. `sessionFilter` holds the tokens the start screen lists under, `-is:worktree` unless changed, and `/config` shows it as **session filter**. A token typed in the search, `is:worktree`, `is:pinned`, or `is:archived` with an optional leading `-`, replaces the saved one for its field and is left out of the words matched; the screen lists again from the daemon under the result, shows the active tokens as chips below the search, opens a floating filter menu on `ctrl+t`, and offers completions on `Tab` while typing a token. See [`ListSessionsUnder`](../cli/internal/daemon/session_filter.go). While the saved filter alone leaves worktrees out, pinned sessions in them are listed too. Only this screen lists under the filter: CLI output, ID resolution, and the pickers that offer a session to act on list whole. ## Accounts [`/accounts`](../cli/internal/tui/accounts.go), with `/login` as an alias, lists sign-in accounts grouped by service, then API keys, tool sign-ins, the services not yet signed in to, and an advanced row. The service names and model lists live in one table, `accountServices`; other sign-in services keep the daemon's label and detail. Each service section ends with a row that adds an account, and a service with two or more accounts numbers them and shows its rotation mode on the section rule. With no accounts, no keys, and no setups, the screen shows the first-run choices from the daemon’s model sign-ins, followed by **API key or endpoint**. In `/accounts`, **tool sign-ins** opens service accounts when a service is available. Enter starts sign-in or renews an account that needs it. The row stays in its section while sign-in runs. For a device grant, confirm the displayed code in your browser. Providers with manual sign-in also accept a code or callback URL in the terminal. Ctrl+O reopens the link when a browser opener is available. Escape cancels the sign-in. The daemon joins new model accounts to the service's profiles. Tab cycles the service's rotation mode and Alt+Up or Alt+Down reorder its accounts. Both write through [`daemon.SaveServiceRotation`](../cli/internal/daemon/rotation.go), which owns the client mapping from one service order and mode to the profiles of that extension. Ctrl+R renames an account. Ctrl+X asks to sign out in the footer and names what keeps running or stops. In **tool sign-ins**, Enter on a connected saved account opens the same confirmation. Environment accounts cannot be renamed or signed out. The advanced row opens the setups list in [`login_accounts.go`](../cli/internal/tui/login_accounts.go). It keeps profile selection, editing, renaming, removal, account pins, and the setup forms. Do not show profiles or setups in the main accounts list. The folder picker shows connection progress across the full list while a remote folder listing waits for host setup. Folder counts appear once the listing arrives. ## Moving a session `/cd` to another host's folder opens the [question box](../cli/internal/tui/cd_question.go). It asks the daemon's preflight, and [`cd_move.go`](../cli/internal/tui/cd_move.go) starts and follows the move when the user chooses yes. In a short terminal the question and destination stay above the scrolling profile choices. An unavailable preflight shows its reason under yes and offers only no. A target that can't take this daemon's data refuses in the preflight or when a move reaches staging. `cdRefusal` reads three codes for a person: - `transfer_target_older`: "The target daemon is older than this one and can't accept this session. Update albedo on _host_." - `transfer_extension_unavailable`: an extension this session uses failed to load there. It gives no update advice. - `transfer_unsupported`: the target may be older, or one of its extensions failed to load there. An older target can't say which. The target's own words, which name what it lacks, stay below in faint text for debugging. Other refusals show their reason as it came. The shot gallery's `cd` screen covers these states. The rules behind the codes are in [moves between versions](workspaces.md#moves-between-versions). ## Screens and tests Screen-specific models and rendering live beside the application model. For example, [`webhooks_page.go`](../cli/internal/tui/webhooks_page.go) and [`discord_page.go`](../cli/internal/tui/discord_page.go) implement their respective pages. Screenshot fixtures and tests live in the same package, including [`shot_chat_test.go`](../cli/internal/tui/shot_chat_test.go). The [Go client boundary](../docs/client-api.md) owns typed daemon operations and transport recovery. Follow [Change the HTTP API](../docs/contributing-api.md) when a screen needs a new public operation. The hydration benchmark feeds the requested number of transcript rows, including their commit events, into the TUI model. Captures too short for a workload skip that size. It measures model updates before terminal output. ## Related pages - [All topics](README.md) - [Change guidance](contributing.md) - [Web client](web.md) - [Session attachment](sessions.md) - [Workspaces](workspaces.md)