Expand description
§zeph-tui
Ratatui-based TUI dashboard for the Zeph AI agent with real-time metrics, syntax-highlighted chat, tool-output diffs, command palette, file picker, and multi-panel layout.
§Architecture
The crate is structured around a central App state machine that owns all
widget state and reacts to two event streams:
AppEvent— keyboard, resize, and mouse events produced byEventReaderrunning on a dedicated OS thread.AgentEvent— streaming agent output, tool events, and control signals forwarded throughTuiChannel.
The main entry point is run_tui, which initialises the terminal,
drives the render loop, and restores the terminal on exit or panic.
§Quick start
use tokio::sync::mpsc;
use zeph_tui::{App, run_tui};
use zeph_tui::event::AppEvent;
#[tokio::main]
async fn main() -> Result<(), zeph_tui::TuiError> {
let (user_tx, user_rx) = mpsc::channel(64);
let (_agent_tx, agent_rx) = mpsc::channel(64);
let app = App::new(user_tx, agent_rx);
let (_event_tx, event_rx) = mpsc::channel(64);
run_tui(app, event_rx).await
}Re-exports§
pub use app::App;pub use channel::TuiChannel;pub use command::TuiCommand;pub use error::TuiError;pub use event::AgentEvent;pub use event::AppEvent;pub use event::CrosstermEventSource;pub use event::EventReader;pub use event::EventSource;pub use types::ChatMessage;pub use types::InputMode;pub use types::MessageRole;pub use types::PasteState;
Modules§
- app
- channel
- command
- error
- event
- file_
picker - highlight
- hyperlink
- layout
- metrics
- Re-exports of
zeph_core::metricstypes used by the TUI dashboard. - render_
cache - theme
- types
- widgets
Structs§
- Metrics
Collector - Metrics
Snapshot - Live snapshot of agent metrics broadcast via a
tokio::sync::watchchannel.
Functions§
- run_tui
- Run the TUI dashboard until the user quits.