UNPKG

kmuc-dev-cli

Version:

Complete development CLI for modern web projects - From init to deploy, Docker, CI/CD, testing, and more

415 lines (297 loc) โ€ข 8.65 kB
# ๐Ÿš€ KMUC CLI **Your complete development toolkit in one CLI** - Streamline your entire workflow from project init to production deploy with Docker, CI/CD, monitoring, and more. [![npm version](https://img.shields.io/npm/v/kmuc-dev-cli.svg)](https://www.npmjs.com/package/kmuc-dev-cli) [![License](https://img.shields.io/badge/license-MIT%20(Private%20%26%20Non--Commercial)-blue.svg)](LICENSE) [![Node.js Version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg)](https://nodejs.org/) --- ## โœจ Why KMUC CLI? Stop juggling multiple tools. One CLI for everything: - ๐ŸŽฏ **Project Setup** - Initialize production-ready Docker projects in seconds - ๐Ÿงช **Testing** - Comprehensive test suite with 3 strictness levels (NEW in v2.3!) - ๐Ÿณ **Container Management** - Status dashboard, logs, updates, cleanup - ๐Ÿ—„๏ธ **Database Tools** - Direct DB access, backups, migrations - ๐Ÿ“Š **Monitoring** - Health checks, resource usage, live dashboards - ๐Ÿ”„ **CI/CD** - Auto-generate GitHub Actions, GitLab CI configs - ๐ŸŒ **SSL & Domains** - Automated Let's Encrypt setup and renewal - ๐Ÿ› ๏ธ **Dev Mode** - Hot-reload, debugging, instant feedback - ๐Ÿ“ค **Smart Deploy** - transfer.sh integration for seamless deployments (NEW in v2.3!) --- ## ๐Ÿ“ฆ Installation ```bash npm install -g kmuc-dev-cli ``` Verify installation: ```bash kmuc --version ``` --- ## ๐Ÿš€ Quick Start ```bash # 1. Initialize your project cd my-project kmuc init # 2. Start everything kmuc publish # 3. Monitor status kmuc status --watch ``` That's it! Your app is running in Docker with all services configured. --- ## ๐Ÿ†• What's New in v2.3.0 ### ๐Ÿงช Comprehensive Testing Suite - **kmuc test** - Multi-level test automation - **Relaxed** - Quick critical checks - **Standard** - Normal tests, linting, build checks - **Strict** - Deep analysis with 16 phases: - TypeScript analysis - Code complexity metrics - Dependency vulnerability scanning - Bundle size & performance analysis - Code quality metrics (TODO/console.log detection) - Git analysis - Environment security checks - Dead code detection - And more! ### ๐Ÿ“ค Smart Deployment - **transfer.sh Integration** - No more SCP hangs! - Uploads to free file hosting - Server downloads directly - Works everywhere, even Windows - Automatic fallback to SCP ### ๐Ÿ”’ Enhanced Security - Deploy scripts automatically added to .gitignore - Server credentials protection - Better SSH key handling ### Previous Updates (v2.1.0) - ๐Ÿ› ๏ธ **kmuc dev** - Development mode with hot-reload - ๐Ÿ—„๏ธ **kmuc db:connect** - Auto-connect to databases - ๐Ÿ’พ **kmuc backup** - Complete backup/restore system - ๐Ÿฅ **kmuc health** - Health checks - ๐Ÿ”’ **kmuc ssl*** - SSL management - โš™๏ธ **kmuc ci** - CI/CD generators --- ## ๐Ÿ“š Core Commands ### Project Lifecycle ```bash kmuc init # Interactive project setup kmuc test # Run test suite (relaxed/standard/strict) kmuc publish # Build & deploy everything kmuc dev # Start development mode kmuc status # Container status dashboard kmuc logs # Intelligent log viewer kmuc health # Health monitoring ``` ### Container Management ```bash kmuc update # Update Docker images kmuc clean # Clean unused resources kmuc restart # Restart services kmuc stop # Stop all containers ``` ### Database Tools ```bash kmuc db:connect # Auto-connect to database kmuc backup # Create full backup kmuc backup:restore # Restore from backup ``` ### CI/CD & Deploy ```bash kmuc ci:github # Generate GitHub Actions kmuc deploy # Deploy to server kmuc ssl:renew # Renew SSL certificates ``` ### Utilities ```bash kmuc help # Interactive documentation kmuc clean # Clean Docker resources ``` --- ## ๐ŸŽจ Supported Technologies ### Frameworks & Languages | Type | Frameworks | |------|-----------| | **JavaScript** | Express.js, Next.js, React (Vite), Node.js | | **Python** | FastAPI, Django, Flask | | **Static** | HTML/CSS/JS with nginx | ### Databases | Database | Version | Features | |----------|---------|----------| | **PostgreSQL** | 16 Alpine | Health checks, auto-backup | | **MongoDB** | 7 | Authentication, replication-ready | | **Redis** | 7 Alpine | Caching, pub/sub | | **MySQL** | 8 | Full-featured relational DB | ### Infrastructure - Docker & Docker Compose - nginx Reverse Proxy - Let's Encrypt SSL/TLS - GitHub Actions & GitLab CI - VPS & Cloud deployment --- ## ๐Ÿ’ก Feature Highlights ### ๐Ÿ“Š Status Dashboard ```bash kmuc status --watch ``` Real-time container monitoring with: - Live CPU & Memory usage - Health status indicators - Port mappings - Auto-refresh every 2 seconds ### ๐Ÿ”„ Smart Updates ```bash kmuc update ``` - Checks for available image updates - Creates backup before updating - Rolling updates (zero downtime) - Automatic health verification ### ๐Ÿงน Intelligent Cleanup ```bash kmuc clean ``` Interactive cleanup wizard: - Stopped containers - Dangling images - Unused volumes - Build cache - Shows space freed ### ๐Ÿ—„๏ธ Database Access ```bash kmuc db:connect ``` Automatically: - Detects your database type - Opens the right client (psql, mongo, mysql, redis-cli) - Passes credentials from .env ### ๐Ÿ› ๏ธ Development Mode ```bash kmuc dev ``` - Volume mounts for hot-reload - Debug ports enabled - Development environment - Live log streaming --- ## ๐Ÿ“– Usage Examples ### Full-Stack Node.js App with PostgreSQL ```bash kmuc init # Select: Express.js App # Select: PostgreSQL # Select: VPS deployment kmuc publish # Access at: http://localhost:3000 kmuc db:connect # Opens psql with your credentials kmuc backup # Creates timestamped backup kmuc ci:github # Generates .github/workflows/deploy.yml ``` ### Python FastAPI with MongoDB ```bash kmuc init # Select: Python FastAPI # Select: MongoDB # Select: Local development kmuc dev # Starts with hot-reload kmuc logs --detailed # Watch all logs with timestamps ``` ### Static Site with SSL ```bash kmuc init # Select: Static Website # Select: VPS deployment # Enter: yourdomain.com kmuc publish # Deploys locally first ./scripts/setup-domain.sh # Sets up nginx + Let's Encrypt kmuc ssl:status # Check SSL expiry ``` --- ## ๐Ÿ”ง Advanced Usage ### Container Status with Live Updates ```bash kmuc status --watch ``` ### Detailed Logs from All Services ```bash kmuc logs --detailed ``` ### Force Update All Images ```bash kmuc update --force ``` ### Deep Clean Everything ```bash kmuc clean --all ``` ### Development with Debug Ports ```bash kmuc dev --debug ``` --- ## ๐Ÿ› ๏ธ Common Workflows ### Daily Development ```bash kmuc dev # Start dev environment kmuc logs # Watch logs kmuc status # Check status ``` ### Before Deployment ```bash kmuc health # Verify all healthy kmuc backup # Create backup kmuc update # Get latest images kmuc publish # Deploy ``` ### Maintenance ```bash kmuc ssl:renew # Renew certificates kmuc clean # Free up space kmuc status # Verify everything running ``` --- ## ๐Ÿ“„ License **MIT License - Private & Non-Commercial Use Only** ### โœ… Free for: - Personal projects - Learning & education - Open source (non-commercial) - Non-profit organizations - Academic research ### โš ๏ธ Requires commercial license for: - Commercial products or services - Paid software or SaaS - Revenue-generating applications - Business operations For commercial licensing, contact the maintainers. See [LICENSE](LICENSE) for full details. --- ## ๐Ÿค Contributing Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. ```bash git clone https://github.com/KmucDigital/dev-cli.git cd dev-cli npm install npm link ``` --- ## ๐Ÿ“ž Support - ๐ŸŒ **Website**: [cli.kmuc.online](https://links.kmuc.online/cli) - ๐Ÿ“– **Documentation**: Run `kmuc help` or visit [cli.kmuc.online/dokumentation](https://cli.kmuc.online/dokumentation) - ๐Ÿ› **Bug Reports**: [GitHub Issues](https://github.com/KmucDigital/dev-cli/issues) - ๐Ÿ’ฌ **Discussions**: [GitHub Discussions](https://github.com/KmucDigital/dev-cli/discussions) --- ## ๐ŸŒŸ Show Your Support - โญ Star the repository - ๐Ÿฆ Share with your network - ๐Ÿ› Report bugs or request features - ๐Ÿ“ Contribute improvements --- **Made with โค๏ธ by KMUC Digital** *Modern development, simplified - One CLI to rule them all*