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
Markdown
# ๐ 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.
[](https://www.npmjs.com/package/kmuc-dev-cli)
[-blue.svg)](LICENSE)
[](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*