Skip to content

FoleyBridge-Solutions/lxtui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LXTUI

License: MIT Rust Crates.io

A modern, fast, and intuitive terminal user interface for managing LXC/LXD containers. Built with Rust and designed for developers who prefer command-line workflows.

LXTUI Demo

✨ Features

  • πŸš€ Fast & Responsive - Async operations with real-time updates
  • πŸ“± Modern TUI - Clean, intuitive interface built with Ratatui
  • πŸ”„ Real-time Operations - Live progress tracking for container operations
  • ⌨️ Keyboard-first - Vim-style navigation with intuitive shortcuts
  • 🎯 Smart Actions - Context-aware operations (start/stop toggle)
  • πŸ” Operation Monitoring - Track running operations with detailed status
  • πŸ›‘οΈ Robust Error Handling - Graceful error handling with retry logic
  • πŸ“Š Container Overview - View status, resource usage, and details at a glance

πŸ“¦ Installation

From Cargo (Recommended)

cargo install lxtui

From Source

git clone https://github.com/yourusername/lxtui.git
cd lxtui
cargo build --release
sudo cp target/release/lxtui /usr/local/bin/

Package Managers

Arch Linux (AUR)

yay -S lxtui

Ubuntu/Debian (Coming Soon)

# Will be available via apt once published

πŸš€ Quick Start

  1. Ensure LXD is installed and running:

    # Ubuntu/Debian
    sudo apt install lxd
    sudo lxd init
    
    # Arch Linux
    sudo pacman -S lxd
    sudo lxd init
  2. Add your user to the lxd group:

    sudo usermod -a -G lxd $USER
    newgrp lxd
  3. Run LXTUI:

    lxtui

⌨️ Key Bindings

Main Container List

  • ↑/↓ or j/k - Navigate containers
  • Enter - Open container actions menu
  • Space - Open system menu
  • s - Start selected container (quick action)
  • S - Stop selected container (quick action)
  • d - Delete selected container (quick action)
  • n - Create new container
  • r/R - Refresh container list
  • o/O - Toggle operations sidebar
  • ?/h - Show help
  • q/Q - Quit

Container Actions Menu

  • Enter - Smart action (Start if stopped, Stop if running)
  • 1 - Start container
  • 2 - Stop container
  • 3 - Restart container
  • 4 - Delete container
  • 5 - Clone container
  • e - Execute shell (container must be running)
  • Esc - Close menu

System Menu

  • 1/r - Refresh container list
  • 2/l - Check/start LXD service
  • 3/n - Create new container
  • 4/o - Toggle operations sidebar
  • 5/h - Show help
  • 6/q - Quit application
  • Esc - Close menu

For complete keybindings, see KEYBINDINGS.md.

πŸ› οΈ System Requirements

  • Operating System: Linux (Ubuntu 20.04+, Debian 11+, Arch Linux, Fedora 35+)
  • LXD Version: 4.0+ (5.0+ recommended)
  • Terminal: Any modern terminal emulator with 256+ colors
  • Memory: ~10MB RAM
  • Storage: ~15MB disk space

βš™οΈ Configuration

LXTUI works out of the box with standard LXD installations. Configuration options:

Environment Variables

  • RUST_LOG - Set logging level (off, error, warn, info, debug, trace)

    RUST_LOG=debug lxtui  # Enable debug logging
  • LXD_SOCKET - Custom LXD socket path (defaults to /var/lib/lxd/unix.socket)

    LXD_SOCKET=/custom/path/unix.socket lxtui

LXD Remote Configuration

LXTUI supports LXD remote servers. Configure remotes using the LXD client:

lxc remote add myserver https://server.example.com:8443
lxtui --remote myserver

πŸ—οΈ Architecture

LXTUI is built with a modern async architecture:

  • Frontend: Ratatui for the terminal UI
  • Backend: Tokio async runtime
  • LXD Communication: RESTful API over Unix sockets
  • State Management: Centralized app state with real-time updates
  • Error Handling: Comprehensive error types with retry logic

Key Components

  • src/app.rs - Main application state and logic
  • src/ui.rs - Terminal UI rendering
  • src/lxd_api.rs - LXD API client and operations
  • src/lxc.rs - Container management and state tracking

🀝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Development Setup

  1. Clone the repository:

    git clone https://github.com/yourusername/lxtui.git
    cd lxtui
  2. Install Rust and dependencies:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    rustup update
  3. Run in development mode:

    RUST_LOG=debug cargo run
  4. Run tests:

    cargo test
  5. Format code:

    cargo fmt
  6. Lint code:

    cargo clippy

Project Structure

lxtui/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.rs          # Application entry point
β”‚   β”œβ”€β”€ app.rs           # Main application logic
β”‚   β”œβ”€β”€ ui.rs            # Terminal UI components
β”‚   β”œβ”€β”€ lxd_api.rs       # LXD API client
β”‚   └── lxc.rs           # Container operations
β”œβ”€β”€ tests/               # Integration tests
β”œβ”€β”€ docs/                # Documentation
β”œβ”€β”€ .github/workflows/   # CI/CD pipelines
└── README.md

πŸ› Troubleshooting

Common Issues

1. "Failed to connect to LXD"

# Check if LXD is running
sudo systemctl status lxd

# Start LXD if needed
sudo systemctl start lxd

# Verify your user is in the lxd group
groups $USER

2. "Permission denied" errors

# Add user to lxd group and refresh
sudo usermod -a -G lxd $USER
newgrp lxd

3. "No containers found"

# Verify LXD is initialized
lxc profile list

# If not initialized
sudo lxd init

4. Terminal display issues

# Try setting terminal type
export TERM=xterm-256color
lxtui

Debug Mode

Enable debug logging for troubleshooting:

RUST_LOG=debug lxtui 2> lxtui.log

Reporting Issues

Please report issues on GitHub Issues with:

  1. Your operating system and version
  2. LXD version (lxd --version)
  3. LXTUI version (lxtui --version)
  4. Steps to reproduce the issue
  5. Debug logs if applicable

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Ratatui - Excellent TUI framework
  • LXD Team - Amazing container runtime
  • Tokio - Async runtime for Rust
  • The Rust community for incredible tooling and support

πŸ”— Links


Made with ❀️ by the LXTUI contributors

Streamline your container workflow with the power of the terminal.

About

LXD/LXC TUI Manager

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published