code-mesh-tui

Crates.iocode-mesh-tui
lib.rscode-mesh-tui
version0.1.0
created_at2025-07-16 15:18:36.886842+00
updated_at2025-07-16 15:18:36.886842+00
descriptionInteractive Terminal User Interface for the Code-Mesh distributed swarm intelligence system
homepagehttps://github.com/ruvnet/code-mesh
repositoryhttps://github.com/ruvnet/code-mesh
max_upload_size
id1755643
size265,403
rUv (ruvnet)

documentation

https://docs.rs/code-mesh-tui

README

Code-Mesh TUI ๐Ÿ–ฅ๏ธโœจ

Crates.io Documentation License Rust

Interactive Terminal User Interface for the Code-Mesh distributed swarm intelligence system.

Code-Mesh TUI provides a beautiful, feature-rich terminal interface to visualize, monitor, and control your Code-Mesh swarms in real-time. Experience the power of distributed computing through an intuitive, responsive interface.

๐ŸŒŸ Features

๐ŸŽจ Beautiful Interface

  • Modern Design: Clean, intuitive interface with customizable themes
  • Real-time Updates: Live monitoring with smooth animations
  • Responsive Layout: Adapts to any terminal size
  • Syntax Highlighting: Code display with language-aware highlighting

๐Ÿ“Š Visual Monitoring

  • Swarm Topology Visualization: Interactive network graphs of agent relationships
  • Performance Dashboards: Real-time metrics with charts and graphs
  • Agent Status Display: Live status updates for all active agents
  • Task Progress Tracking: Visual progress bars and completion indicators

๐ŸŽฎ Interactive Controls

  • Command Palette: Quick access to all functions with fuzzy search
  • Keyboard Shortcuts: Efficient navigation and control
  • Mouse Support: Click and scroll support where available
  • Multi-panel Layout: Split views for monitoring multiple aspects simultaneously

๐Ÿง  Neural Intelligence Visualization

  • Neural Network Display: Visual representation of agent neural networks
  • Learning Progress: Real-time learning metrics and pattern recognition
  • Cognitive Pattern Visualization: See how different thinking patterns work
  • Cross-Agent Communication: Visualize message passing between agents

๐Ÿš€ Installation

From Crates.io

cargo install code-mesh-tui

From Source

git clone https://github.com/ruvnet/code-mesh
cd code-mesh
cargo install --path crates/code-mesh-tui

As a Library

Add this to your Cargo.toml:

[dependencies]
code-mesh-tui = "0.1"

๐Ÿš€ Quick Start

Launch the TUI

# Start with default settings
code-mesh-tui

# Start with specific configuration
code-mesh-tui --config ~/.config/code-mesh/tui-config.toml

# Connect to remote Code-Mesh instance
code-mesh-tui --connect ws://localhost:8080

# Start in specific mode
code-mesh-tui --mode monitor

Basic Navigation

Tab / Shift+Tab    - Navigate between panels
Ctrl+P             - Open command palette
Ctrl+Q             - Quit application
?                  - Show help
Space              - Toggle pause/resume
F5                 - Refresh data

๐ŸŽจ Interface Overview

Main Dashboard

โ”Œโ”€ Code-Mesh TUI v0.1.0 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ โšก Swarm: mesh-001 โ”‚ ๐Ÿง  Agents: 5/8 โ”‚ ๐Ÿ“Š CPU: 45% โ”‚ ๐Ÿ’พ RAM: 2.1GB โ”‚ โ†— Net โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                             โ”‚
โ”‚  โ”Œโ”€ Swarm Topology โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€ Performance Metrics โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”‚
โ”‚  โ”‚                              โ”‚ โ”‚  CPU Usage        โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘ 89%      โ”‚โ”‚
โ”‚  โ”‚    [R1]โ”€โ”€โ”€โ”€[C1]              โ”‚ โ”‚  Memory Usage     โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘ 67%      โ”‚โ”‚
โ”‚  โ”‚     โ”‚       โ”‚                โ”‚ โ”‚  Neural Ops/sec   โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘ 85%      โ”‚โ”‚
โ”‚  โ”‚    [A1]โ”€โ”€โ”€โ”€[O1]              โ”‚ โ”‚  Network I/O      โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘ 59%      โ”‚โ”‚
โ”‚  โ”‚     โ”‚       โ”‚                โ”‚ โ”‚                                       โ”‚โ”‚
โ”‚  โ”‚    [A2]โ”€โ”€โ”€โ”€[C2]              โ”‚ โ”‚  โ”Œโ”€ Recent Tasks โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”‚โ”‚
โ”‚  โ”‚                              โ”‚ โ”‚  โ”‚ โœ“ Code analysis    (2.3s)        โ”‚โ”‚โ”‚
โ”‚  โ”‚  Legend:                     โ”‚ โ”‚  โ”‚ โณ Optimization    (45% done)    โ”‚โ”‚โ”‚
โ”‚  โ”‚  [R] Researcher [C] Coder    โ”‚ โ”‚  โ”‚ โธ Documentation   (paused)       โ”‚โ”‚โ”‚
โ”‚  โ”‚  [A] Analyst    [O] Optimizerโ”‚ โ”‚  โ”‚ โŒ› Testing         (queued)       โ”‚โ”‚โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ”‚โ”‚
โ”‚                                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ”‚
โ”‚                                                                             โ”‚
โ”‚  โ”Œโ”€ Agent Details โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”‚
โ”‚  โ”‚ Agent ID: researcher-001                    Status: โšก Active             โ”‚โ”‚
โ”‚  โ”‚ Type: Researcher                           Uptime: 2h 15m 33s           โ”‚โ”‚
โ”‚  โ”‚ Cognitive Pattern: Adaptive                Tasks: 12 completed          โ”‚โ”‚
โ”‚  โ”‚ Neural Network: nn-1752..                  Success Rate: 98.3%          โ”‚โ”‚
โ”‚  โ”‚                                                                         โ”‚โ”‚
โ”‚  โ”‚ Current Task: "Analyze codebase structure and dependencies"             โ”‚โ”‚
โ”‚  โ”‚ Progress: โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘ 78%                                      โ”‚โ”‚
โ”‚  โ”‚ ETA: 45 seconds                                                         โ”‚โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Available Views

1. Dashboard View (Default)

  • Overview of entire swarm
  • Key performance metrics
  • Active task monitoring
  • Agent status summary

2. Swarm View

  • Detailed swarm topology visualization
  • Agent relationships and communication flows
  • Network health and connectivity status
  • Real-time topology optimization

3. Agent View

  • Individual agent details
  • Neural network visualization
  • Performance metrics per agent
  • Task history and success rates

4. Task View

  • Task queue and execution status
  • Detailed progress tracking
  • Task results and outputs
  • Performance analytics

5. Neural View

  • Neural network architecture display
  • Learning progress visualization
  • Pattern recognition results
  • Cross-agent knowledge sharing

6. Performance View

  • Comprehensive system metrics
  • Resource utilization graphs
  • Performance trends and analytics
  • Bottleneck identification

โŒจ๏ธ Keyboard Shortcuts

Global Shortcuts

Key Action
Ctrl+Q Quit application
Ctrl+P Open command palette
Tab / Shift+Tab Navigate panels
? Show help
F5 Refresh data
Space Pause/Resume updates
Ctrl+R Reset view

View-Specific Shortcuts

Dashboard View

Key Action
1-6 Switch to specific view
Enter View details of selected item
D Toggle detailed mode

Swarm View

Key Action
+/- Zoom in/out
Arrow Keys Pan around topology
S Save topology layout
R Reset layout

Agent View

Key Action
Up/Down Select agent
Enter View agent details
K Kill selected agent
M Send message to agent

Task View

Key Action
Up/Down Select task
Enter View task details
C Cancel selected task
N Create new task

๐ŸŽจ Themes and Customization

Built-in Themes

# Dark theme (default)
code-mesh-tui --theme dark

# Light theme
code-mesh-tui --theme light

# High contrast
code-mesh-tui --theme high-contrast

# Cyberpunk theme
code-mesh-tui --theme cyberpunk

# Minimalist theme
code-mesh-tui --theme minimal

Custom Theme Configuration

Create ~/.config/code-mesh/tui-theme.toml:

[colors]
background = "#1e1e1e"
foreground = "#d4d4d4"
primary = "#007acc"
secondary = "#ff6b6b"
success = "#4ade80"
warning = "#facc15"
error = "#ef4444"
accent = "#a855f7"

[borders]
style = "rounded"  # rounded, sharp, double, thick
color = "primary"

[graphs]
line_color = "primary"
fill_color = "secondary"
grid_color = "foreground"

Layout Customization

[layout]
show_borders = true
panel_spacing = 1
header_height = 3
footer_height = 2

[panels]
swarm_topology = { x = 0, y = 0, width = 50, height = 60 }
performance_metrics = { x = 50, y = 0, width = 50, height = 30 }
task_list = { x = 50, y = 30, width = 50, height = 30 }
agent_details = { x = 0, y = 60, width = 100, height = 40 }

๐Ÿ”ง Configuration

Configuration File (~/.config/code-mesh/tui-config.toml)

[display]
theme = "dark"
refresh_rate = 1000  # milliseconds
enable_mouse = true
enable_unicode = true

[performance]
max_fps = 60
buffer_size = 1000
enable_vsync = true

[networking]
connection_timeout = 5000
retry_attempts = 3
keepalive_interval = 30

[features]
enable_neural_viz = true
enable_audio_alerts = false
enable_notifications = true
show_debug_info = false

[keybindings]
quit = "Ctrl+Q"
help = "?"
refresh = "F5"
command_palette = "Ctrl+P"

๐Ÿš€ Advanced Usage

Embedding in Applications

use code_mesh_tui::{TuiApp, TuiConfig};
use code_mesh_core::CodeMesh;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Initialize Code-Mesh core
    let mesh = CodeMesh::new().await?;
    
    // Configure TUI
    let config = TuiConfig::default()
        .with_theme("cyberpunk")
        .with_refresh_rate(500)
        .with_mouse_support(true);
    
    // Create and run TUI
    let mut tui = TuiApp::new(mesh, config).await?;
    tui.run().await?;
    
    Ok(())
}

Custom Views

use code_mesh_tui::{View, ViewContext, RenderResult};

struct CustomMetricsView {
    data: Vec<Metric>,
}

impl View for CustomMetricsView {
    fn render(&mut self, ctx: &ViewContext) -> RenderResult {
        // Custom rendering logic
        Ok(())
    }
    
    fn handle_input(&mut self, input: InputEvent) -> bool {
        // Custom input handling
        false
    }
}

// Register custom view
tui.register_view("custom_metrics", Box::new(CustomMetricsView::new()));

Remote Monitoring

# Start Code-Mesh server with TUI endpoint
code-mesh serve --tui-port 8080

# Connect TUI to remote instance
code-mesh-tui --connect ws://remote-server:8080

# SSH tunnel for secure connection
ssh -L 8080:localhost:8080 remote-server
code-mesh-tui --connect ws://localhost:8080

๐ŸŽฏ Performance Optimization

For Large Swarms (10+ agents)

[performance]
# Reduce refresh rate for better performance
refresh_rate = 2000
max_fps = 30

# Limit data retention
buffer_size = 500
max_history = 100

# Disable expensive features
enable_neural_viz = false
show_topology_animation = false

For Resource-Constrained Systems

[display]
# Use minimal theme
theme = "minimal"
enable_unicode = false

[features]
# Disable non-essential features
enable_audio_alerts = false
enable_notifications = false
show_debug_info = false

๐Ÿ› Troubleshooting

Common Issues

Issue: TUI doesn't display correctly Solution: Ensure terminal supports 256 colors and Unicode

Issue: High CPU usage Solution: Increase refresh_rate in config (e.g., 2000ms)

Issue: Connection timeouts Solution: Check network connectivity and increase connection_timeout

Issue: Garbled display Solution: Try --theme minimal or disable Unicode

Debug Mode

# Enable debug logging
export CODE_MESH_TUI_LOG=debug

# Run with debug output
code-mesh-tui --debug 2>debug.log

# Capture screen output
code-mesh-tui --capture-output tui-output.txt

๐Ÿ“š Documentation

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

๐Ÿ“œ License

This project is licensed under either of

at your option.

๐Ÿ‘จโ€๐Ÿ’ป Creator

Created by ruv - Innovator in AI-driven development tools and distributed systems.

Repository: github.com/ruvnet/code-mesh


Code-Mesh TUI - Visualize Your Swarm Intelligence ๐Ÿ–ฅ๏ธโœจ

Beautiful, interactive terminal interface for distributed computing

Commit count: 0

cargo fmt