# Terminal client The Go terminal client lives in [`cli/internal/tui`](../cli/internal/tui/app.go). It uses Bubble Tea models and the daemon client. The [web client](web.md) is another client of the daemon. ## Application and screens [`AppModel`](../cli/internal/tui/app.go) owns navigation between chat, session selection, and other screens. `Update` routes messages to the relevant model and handles transitions such as opening the model picker, [webhooks](webhooks.md), and [Discord](discord.md) pages. [`listFrame`](../cli/internal/tui/frame.go) renders shared list-screen framing. [`pageStatus`](../cli/internal/tui/page.go) tracks loading and request generations for pages. 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). [`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. ## 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. ## Related pages - [All topics](README.md) - [Change guidance](contributing.md) - [Web client](web.md) - [Session attachment](sessions.md)