Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Console Module (XtreeUI)

Terminal-based admin interface for managing General Bots instances.

Overview

XtreeUI is a TUI (Terminal User Interface) for administering bots directly from the command line. It provides file browsing, log viewing, chat testing, and status monitoring in a single terminal window.

Feature Flag

Enabled via Cargo feature:

[features]
console = []

Panels

PanelKeyDescription
File Tree1Browse bot files and packages
Editor2View/edit configuration files
Status3System status and metrics
Logs4Real-time log viewer
Chat5Test bot conversations

Keyboard Navigation

KeyAction
1-5Switch between panels
TabCycle panels
↑/↓Navigate within panel
EnterSelect/open item
qQuit console
?Show help

Components

File Tree

Browse .gbai folder structure:

  • View packages (.gbkb, .gbdialog, .gbtheme)
  • Open config.csv for editing
  • Navigate bot resources

Status Panel

Real-time system metrics:

  • CPU/memory usage
  • Active connections
  • Bot status
  • Database connectivity

Log Panel

Live log streaming with filtering:

  • Error highlighting
  • Log level filtering
  • Search functionality

Chat Panel

Interactive bot testing:

  • Send messages to bot
  • View responses
  • Debug conversation flow

Editor

Basic file editing:

  • Syntax highlighting
  • Save/reload files
  • Config validation

Starting the Console

./botserver --console

Or programmatically:

#![allow(unused)]
fn main() {
let mut ui = XtreeUI::new();
ui.set_app_state(app_state);
ui.start_ui()?;
}

Progress Channel

Monitor background tasks:

#![allow(unused)]
fn main() {
let (tx, rx) = tokio::sync::mpsc::channel(100);
ui.set_progress_channel(rx);

// Send progress updates
tx.send(ProgressUpdate::new("Loading KB...", 50)).await;
}

Use Cases

  • Server administration without web UI
  • SSH-based remote management
  • Development and debugging
  • Headless server deployments
  • Quick configuration changes

See Also