Overview
Handler’s TUI (Terminal User Interface) provides an interactive, Textual-based interface for communicating with A2A agents. The TUI offers real-time message streaming, task tracking, artifact viewing, and built-in authentication management.Launching the TUI
Start the TUI
Launch Handler’s TUI using the default command:The TUI will start with a welcome message and display the main interface.
Understand the layout
The TUI is divided into four main panels:
- Contact Panel (top-left): Agent URL input and connection
- Agent Card Panel (bottom-left): Displays agent metadata and capabilities
- Messages Panel (right-top): Shows conversation history, tasks, artifacts, and logs
- Input Panel (bottom-right): Message input and send controls
Connecting to an Agent
Enter agent URL
In the Contact Panel, enter your agent’s base URL:Press the Connect button or hit Enter.
Sending Messages
Send the message
Press Enter or click the Send button. The message is sent with:
- Your message text
- Current
context_id(automatically managed for conversation continuity) - Any configured authentication credentials
Working with Tasks
The TUI automatically tracks task state throughout the conversation:- Task States
- Viewing Tasks
Tasks can be in various states:
working: Agent is processinginput-required: Waiting for user inputauth-required: Needs authenticationcompleted: Successfully finishedfailed: Encountered an errorcanceled: User or agent canceled
Viewing Artifacts
Artifacts are structured outputs from agents (code, data, files, etc.).Using Authentication
For agents requiring authentication, the TUI provides built-in credential management.Open authentication panel
In the Messages Panel, navigate to the authentication section (implementation in
tui/components/auth.py).Choose auth type
Select from:
- None: No authentication
- API Key: Custom header authentication
- Bearer Token: OAuth-style token
Keyboard Shortcuts
The TUI provides several keyboard shortcuts for efficient navigation:| Shortcut | Action |
|---|---|
Ctrl+Q | Quit the TUI |
/ | Open command palette |
Ctrl+M | Maximize focused panel |
Tab | Navigate between panels |
Enter | Send message (when in input field) |
Viewing Logs
The TUI includes a built-in log viewer for debugging:Web Mode
You can also run the TUI as a web application:Theming
Handler supports custom themes. Your theme preference is saved to~/.handler/ and persists across sessions:
app.py:121-126
Tips and Best Practices
Context Continuity
The TUI automatically manages
context_id for conversation continuity. Each new connection generates a fresh context.Streaming Support
If the agent supports streaming, responses appear incrementally as they’re generated.
Panel Maximization
Use
Ctrl+M to maximize the Messages or Agent Card panel for better visibility.Error Handling
Connection errors and agent errors are displayed as system messages in the Messages Panel.
Next Steps
Authentication
Learn about bearer tokens and API key authentication
Sessions
Persist context and credentials across TUI sessions
CLI Reference
Complete CLI reference for TUI options