Nuwax CLI - Intelligent Docker Service Management Tool
A professional Docker service management and upgrade tool providing complete containerized service lifecycle management.
🎯 Project Overview
Nuwax CLI is a modern Docker service management tool developed in Rust, specifically designed to simplify the deployment, upgrade, backup, and maintenance of containerized applications. Through intelligent upgrade strategies and robust security mechanisms, it provides reliable operational support for enterprise-level applications.
✨ Core Features
- 🐋 Intelligent Docker Management: Complete Docker container lifecycle management with start, stop, restart, and health check capabilities
- 🔄 Multi-Strategy Upgrades: Support for both full and incremental upgrades with automatic optimal strategy selection
- 💾 Complete Backup System: Automatic backup before upgrades with full rollback support for data and application configurations
- 🏗️ Cross-Platform Architecture: Native support for x86_64 and aarch64 architectures with automatic system type detection
- 📊 Real-time Monitoring: Service status monitoring, health checks, and performance metrics collection
- 🛡️ Secure & Reliable: Transactional upgrade operations with automatic rollback on failure to ensure service stability
- ⚡ High Performance: Built on Rust async runtime providing exceptional concurrent performance
- 🎨 Modern CLI: Intuitive command-line interface with rich progress displays and status indicators
📁 Project Architecture
nuwax-cli/
├── 📦 nuwax-cli/ # CLI Main Program
│ ├── src/
│ │ ├── main.rs # Program Entry Point
│ │ ├── cli.rs # Command Line Definitions
│ │ ├── app.rs # Application Main Logic
│ │ ├── commands/ # Command Processors
│ │ └── docker_service/ # Docker Service Management
│ └── Cargo.toml
├── 🔧 client-core/ # Core Business Library
│ ├── src/
│ │ ├── upgrade.rs # Upgrade Management
│ │ ├── backup.rs # Backup System
│ │ ├── database.rs # Database Management
│ │ ├── api.rs # API Client
│ │ ├── container/ # Docker Operations
│ │ └── sql_diff/ # SQL Diff Comparison
│ └── Cargo.toml
├── 📚 docs/ # Technical Documentation
├── 📋 spec/ # Design Specifications
├── 🗄️ data/ # Data Directory
└── 📄 README.md
🚀 Quick Start
Requirements
- Rust: 1.75+
- Docker: 20.10+ and Docker Compose v2+
- Operating System: Windows 10+, macOS 10.15+, Linux (mainstream distributions)
- Memory: Minimum 512MB available memory
Installation
Build from Source
# Clone repository
# Build project
# Install to system
Direct Run
# Development mode
# Production mode
Basic Usage
# 1. Initialize working environment
# 2. Check service status
# 3. Download and deploy services
# 4. Start Docker services
# 5. Create backup
# 6. Check available updates
📖 Detailed Features
Docker Service Management
# Service Control
# Image Management
# Utilities
Upgrade and Backup
# Upgrade Management
# Backup and Recovery
Automated Operations
# Auto Backup
# Auto Upgrade Deployment
Utility Commands
# SQL Diff Comparison
# Cache Management
🛠️ Development Guide
Development Environment Setup
# 1. Install Rust toolchain
# 2. Verify dependencies
# 3. Run tests
# 4. Code formatting
# 5. Static analysis
Performance Testing
# Run performance benchmarks
# Generate performance reports
Project Dependency Management
The project uses Cargo workspace to manage multiple sub-modules:
- nuwax-cli: CLI interface layer, depends on client-core
- client-core: Core business logic, independently testable
All dependency versions are uniformly managed in the root Cargo.toml to ensure consistency.
🔧 Configuration
Configuration File Structure
The project uses config.toml configuration files with intelligent configuration discovery:
[]
= "1.0.0"
= "1.0.1"
= "1.0.1+1"
[]
= "docker/docker-compose.yml"
= "docker/.env"
[]
= "./backups"
= 10
[]
= "./cache"
= "1GB"
[]
= true
= true
Intelligent Configuration Discovery
Configuration file search order:
- Command line specified path (
--config) - Current directory
./config.toml - Recursive search to parent directories
- User home directory
~/.nuwax/config.toml
🏗️ System Architecture
Core Components
- CLI Interface Layer: Command parsing, user interaction, progress display
- Business Logic Layer: Upgrade strategies, backup management, Docker operations
- Data Access Layer: DuckDB storage, configuration management, state persistence
- API Client: Version checking, file downloading, service communication
Design Patterns
- Layered Architecture: Clear separation of responsibilities and dependency management
- Dependency Injection: Unified component lifecycle management through
CliApp - Strategy Pattern: Flexible switching between multiple upgrade strategies
- Actor Pattern: Concurrent safe processing of database operations
🤝 Contributing
We welcome community contributions! Please follow these steps:
- Fork the project to your GitHub account
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Create a Pull Request
Code Standards
- Use
cargo fmtfor code formatting - Use
cargo clippyfor static checking - Add unit tests for new features
- Update relevant documentation
📄 License
This project is dual-licensed:
You may choose either license to use this project.
🔗 Related Links
- Project Homepage: https://docx.xspaceagi.com/
- GitHub Repository: https://github.com/soddygo/nuwax-cli
- Issue Reporting: https://github.com/soddygo/nuwax-cli/issues
- Changelog: CHANGELOG.md
💬 Support
If you encounter issues or have improvement suggestions:
- Check documentation for detailed information
- Search known issues
- Create a new Issue
- Join discussions
Made with ❤️ by the Nuwax Team