| Crates.io | boxmux |
| lib.rs | boxmux |
| version | 0.190.0 |
| created_at | 2025-08-17 19:57:53.400648+00 |
| updated_at | 2025-08-25 19:32:02.657881+00 |
| description | YAML-driven terminal UI framework for rich, interactive CLI applications and dashboards with PTY support |
| homepage | https://boxmux.com |
| repository | https://github.com/jowharshamshiri/boxmux |
| max_upload_size | |
| id | 1799671 |
| size | 5,620,896 |
Automate tasks and put automation into terminal dashboards with minimal effort. Use YAML to transform Unix commands into interactive programs running in organized, threaded interfaces.


BoxMux lets you automate tasks and immediately visualize that automation in terminal interfaces. Define shell commands and scripts in YAML configuration to create monitoring dashboards, system administration tools, and interactive applications. Commands execute in separate threads with clean process management and real-time output display.
Core Framework (Complete)
UI Components and Styling (Complete)
Scripting and Automation
PTY (Pseudo-Terminal) Features
Socket API and Remote Control (Complete)
Data Visualization (Complete)
Advanced Features
Cross-platform Compatibility
top, df, iostat into unified dashboardsvim, htop, less, nano directly in boxes with full interactiontail -f commands and auto-scrollnetstat, ss, ping with live updatespsql, mysql) in boxesgnuplot for charting featuresInstall BoxMux directly from the Rust package registry:
cargo install boxmux
Then run it with any YAML configuration:
boxmux layouts/dashboard.yaml
Clone the repository
git clone https://github.com/jowharshamshiri/boxmux.git
cd boxmux
Build BoxMux
cargo build --release
Run the example dashboard
./run_boxmux.sh layouts/dashboard.yaml
Create a simple interface with a single box:
# my-interface.yaml
app:
layouts:
- id: 'main'
root: true
title: 'My First Interface'
bg_color: 'black'
children:
- id: 'welcome'
title: 'Welcome MuxBox'
position:
x1: 10%
y1: 20%
x2: 90%
y2: 60%
content: 'Basic box example'
border: true
- id: 'system_logs'
title: 'Live System Logs'
position:
x1: 10%
y1: 65%
x2: 90%
y2: 90%
auto_scroll_bottom: true
refresh_interval: 1000
script:
- 'echo "$(date): System status check"'
- 'echo "$(date): Monitoring active processes"'
- 'echo "$(date): All systems operational"'
border: true
y2: 80%
content: 'Hello, BoxMux!'
border: true
Run it:
# If installed via cargo install
boxmux my-interface.yaml
# If built from source
./run_boxmux.sh my-interface.yaml
BoxMux uses a hierarchical YAML structure:
app:
libs: # External script libraries
- lib/utils.sh
layouts: # Layout definitions
- id: 'dashboard'
root: true
title: 'Dashboard'
children: # Nested boxes
- id: 'header'
title: 'Header'
position: # Percentage-based positioning
x1: 0%
y1: 0%
x2: 100%
y2: 10%
content: 'Welcome'
- id: 'menu'
title: 'Menu'
choices: # Interactive menu items
- id: 'option1'
content: 'Option 1'
script:
- echo 'Selected option 1'
BoxMux includes hierarchical variable substitution for dynamic configuration and template-driven interfaces:
Variables are resolved in this order (highest to lowest priority):
app:
variables:
SERVER_NAME: "production-server"
DEFAULT_USER: "admin"
layouts:
- id: 'dashboard'
title: 'Dashboard for ${SERVER_NAME}'
children:
- id: 'status_box'
variables:
MUXBOX_TITLE: "Server Status"
title: '${MUXBOX_TITLE}'
content: 'Monitoring: ${SERVER_NAME}'
script:
- echo "Checking ${SERVER_NAME} status..."
- ssh ${USER:${DEFAULT_USER}}@${SERVER_NAME} 'uptime'
${VAR:default_value} syntaxapp:
variables:
ENVIRONMENT: "staging"
LOG_LEVEL: "info"
layouts:
- id: 'monitoring'
title: 'Monitoring Dashboard - ${ENVIRONMENT}'
children:
- id: 'app_logs'
variables:
SERVICE_NAME: "web-api"
title: '${SERVICE_NAME} Logs'
script:
- tail -f /var/log/${SERVICE_NAME}/${ENVIRONMENT}.log
- id: 'db_status'
variables:
SERVICE_NAME: "database"
title: '${SERVICE_NAME} Status'
script:
- echo "Checking ${SERVICE_NAME} on ${ENVIRONMENT}..."
- pg_isready -h ${DB_HOST:localhost} -p ${DB_PORT:5432}
This enables:
BoxMux supports real-time communication via Unix sockets for regular boxes and PTY processes:
# Update box content
echo '{"UpdateMuxBox": {"box_id": "status", "content": "Connected"}}' | nc -U /tmp/boxmux.sock
# Send commands
echo '{"Command": {"action": "refresh", "box_id": "logs"}}' | nc -U /tmp/boxmux.sock
# PTY process control
echo '{"Command": {"action": "kill_pty", "box_id": "htop_box"}}' | nc -U /tmp/boxmux.sock
echo '{"Command": {"action": "restart_pty", "box_id": "ssh_session"}}' | nc -U /tmp/boxmux.sock
# Query PTY status
echo '{"Command": {"action": "pty_status", "box_id": "vim_box"}}' | nc -U /tmp/boxmux.sock
# Send input to PTY (for scripted interaction)
echo '{"Command": {"action": "pty_input", "box_id": "ssh_session", "input": "ls -la\n"}}' | nc -U /tmp/boxmux.sock
# Real-time system monitoring dashboard
- id: 'cpu_chart'
title: 'CPU Usage'
refresh_interval: 1000
script:
- top -l 1 | grep "CPU usage" | awk '{print $3}' | sed 's/%//'
# Navigation menu with actions and global hotkeys
app:
hot_keys:
'F1': 'deploy' # F1 triggers deploy action
'F2': 'logs' # F2 triggers logs action
layouts:
- id: 'main'
children:
- id: 'main_menu'
title: 'Actions (F1=Deploy, F2=Logs)'
tab_order: 1
choices:
- id: 'deploy'
content: 'Deploy Application [F1]'
script:
- ./deploy.sh
redirect_output: 'output'
- id: 'logs'
content: 'View Logs [F2]'
script:
- tail -f /var/log/app.log
redirect_output: 'log_box'
auto_scroll_bottom: true
# Interactive terminal applications in boxes
- id: 'htop_box'
title: 'System Monitor ⚡'
pty: true
script:
- htop
position:
x1: 0%
y1: 0%
x2: 50%
y2: 50%
- id: 'vim_box'
title: 'Text Editor ⚡'
pty: true
script:
- vim /path/to/file.txt
position:
x1: 50%
y1: 0%
x2: 100%
y2: 50%
- id: 'ssh_session'
title: 'Remote Server ⚡'
pty: true
script:
- ssh user@remote-server
position:
x1: 0%
y1: 50%
x2: 100%
y2: 100%
# Template with environment variables
app:
variables:
APP_NAME: "My Application"
layouts:
- id: 'main'
title: '${APP_NAME} Dashboard'
children:
- id: 'info'
title: 'System Info'
script:
- echo "User: ${USER:unknown}"
- echo "Home: $HOME"
- echo "App: ${APP_NAME}"
# Unicode-based chart
- id: 'metrics_chart'
title: 'Performance Metrics'
chart_config:
chart_type: 'line'
width: 40
height: 10
chart_data: |
1,10
2,15
3,8
4,20
# Table with sorting and filtering (clickable headers)
- id: 'data_table'
title: 'System Data (Click headers to sort)'
table_config:
headers: ['Process', 'CPU', 'Memory']
sortable: true
filterable: true
page_size: 10
table_data: |
nginx,2.5,45MB
mysql,15.2,312MB
redis,0.8,28MB
# PTY output with interactive build process
- id: 'build_output'
title: 'Build Progress ⚡'
auto_scroll_bottom: true
pty: true
script:
- ./interactive-build.sh
# Debug build
cargo build
# Release build
cargo build --release
# Run tests
cargo test
# Run with specific layout
cargo run -- layouts/dashboard.yaml
# Or if installed via cargo install
boxmux layouts/dashboard.yaml
boxmux/
├── src/
│ ├── main.rs # Application entry point
│ ├── lib.rs # Library exports
│ ├── draw_utils.rs # Rendering utilities
│ ├── thread_manager.rs # Thread management
│ └── model/ # Data structures
├── layouts/ # Example configurations
├── docs/ # Documentation
└── examples/ # Example interfaces
Contributions welcome. Please read our Contributing Guidelines for details.
git checkout -b feature/new-featurecargo testgit commit -m 'Add new feature'git push origin feature/new-featureBoxMux performance characteristics (validated with 402 passing tests):
Installation Problems
rustc --versionrustup updateRuntime Issues
yamllintPerformance Issues
For more help, see our Troubleshooting Guide.
This project is licensed under the MIT License - see the LICENSE file for details.
