Crate code_mesh_tui

Source
Expand description

§Code Mesh TUI

Terminal User Interface for Code Mesh - A modern, responsive terminal interface that enhances the user experience with interactive chat, file viewing, diff comparison, and more.

§Architecture

The TUI is built using ratatui and crossterm for cross-platform terminal handling, with a component-based architecture similar to React components.

§Core Components

  • App: Main application state and event handling
  • Chat: Interactive chat interface with message history and markdown rendering
  • FileViewer: File browser and viewer with syntax highlighting
  • DiffViewer: Side-by-side and unified diff comparison
  • StatusBar: System information and mode indicators
  • CommandPalette: Quick action interface
  • Dialog: Modal dialogs for forms and confirmations

§Features

  • Responsive layout system with panels and windows
  • Keyboard navigation and shortcuts
  • Mouse support where appropriate
  • Theme system with customizable colors
  • Syntax highlighting for code blocks
  • Real-time log streaming
  • Progress indicators for long operations
  • Accessibility features (high contrast, etc.)

§Usage

use code_mesh_tui::{App, Config};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let config = Config::default();
    let mut app = App::new(config).await?;
    app.run().await
}

Re-exports§

pub use app::App;
pub use config::Config;

Modules§

app
chat
components
config
diff
events
file_viewer
layout
renderer
status
theme
utils

Functions§

init_terminal
Initialize the terminal for TUI mode
restore_terminal
Restore the terminal to normal mode