Clodo Framework CLI Commands
Complete reference guide for automating Cloudflare Workers development with Clodo Framework's command-line interface.
📋 Contents
🚀 Installation & Setup
Install the Clodo CLI globally to access all automation commands.
Install Clodo CLI
# Install globally via npm
npm install -g @clodo/cli
# Or use npx for one-time commands
npx @clodo/cli --help
Verify Installation
# Check version and available commands
clodo --version
clodo --help
🏗️ Service Creation Commands
Generate production-ready Cloudflare Workers services with intelligent defaults.
Basic Service Creation
Create a Simple Service
# Create a basic service with smart defaults
clodo create my-service
# Result: Complete service structure generated automatically
✅ Service created successfully!
📁 Generated 28+ files with production-ready code
🔗 Ready for deployment across multiple domains
Advanced Service Creation
Create Service with Custom Configuration
# Create service with specific template and configuration
clodo create ./my-service --template complex \
--config-file config.json \
--env-file .env \
--handlers custom.js \
--validation-config validation.json
# Alternative: Use npx for one-time service creation
npx create-clodo-service my-new-service --type data-service
🎯 What Gets Generated
Each service creation generates a complete, production-ready structure including:
- ✅ Service handlers with error handling
- ✅ Database schemas and migrations
- ✅ Authentication & authorization
- ✅ Input validation & sanitization
- ✅ Monitoring & logging setup
- ✅ Deployment configurations
- ✅ Unit & integration tests
💻 Development Commands
Commands for local development and testing.
Start Development Server
Run Local Development Environment
# Start development server with hot reload
clodo dev
# Server starts at http://localhost:8787
# Hot reload enabled for instant feedback
Testing Commands
Run Test Suite
# Run all tests
clodo test
# Run specific test file
clodo test --file auth.spec.js
# Run tests in watch mode
clodo test --watch
🚀 Deployment Commands
Deploy services across multiple environments with zero-downtime updates.
Environment-Based Deployment
Deploy to Different Environments
# Deploy to development environment
clodo deploy --env dev
# Deploy to staging for testing
clodo deploy --env staging
# Deploy to production
clodo deploy --env prod
# Deploy to custom environment
clodo deploy --env custom --config production.toml
Multi-Domain Deployment
Deploy Across Multiple Domains
# Deploy to multiple domains simultaneously
clodo deploy --domains api.example.com,app.example.com \
--env production
# Result: Service deployed across all specified domains
✅ Deployed to api.example.com
✅ Deployed to app.example.com
🔍 Health checks passed for all domains
🔄 Zero-Downtime Deployment
All deployments use rolling updates to ensure:
- ✅ No service interruption during deployment
- ✅ Automatic rollback on failure
- ✅ Health checks before traffic switching
- ✅ Gradual traffic migration
⚙️ Service Management Commands
Monitor, scale, and manage deployed services.
Service Monitoring
Check Service Status
# Get detailed service status
clodo status
# Monitor specific service
clodo status --service my-service
# View real-time metrics
clodo monitor --service my-service
Scaling Commands
Scale Service Resources
# Auto-scale based on traffic
clodo scale --auto
# Manual scaling
clodo scale --cpu 2 --memory 1GB
# Scale to zero for cost optimization
clodo scale --zero
🔧 Advanced Options
Advanced configuration and customization options.
Custom Templates
Use Custom Service Templates
# List available templates
clodo templates --list
# Create service with specific template
clodo create my-api --template rest-api
clodo create my-worker --template queue-worker
clodo create my-site --template static-site
Configuration Overrides
Override Default Configurations
# Use custom configuration file
clodo create my-service --config custom-config.json
# Override specific settings
clodo deploy --env prod --timeout 300 \
--health-check-path /api/health \
--rollout-percent 25
💡 Practical Examples
Real-world scenarios and command combinations.
Complete Development Workflow
From Idea to Production
# 1. Create new service
clodo create ecommerce-api --template rest-api
# 2. Start development
cd ecommerce-api
clodo dev
# 3. Run tests during development
clodo test --watch
# 4. Deploy to staging
clodo deploy --env staging
# 5. Run integration tests
clodo test --integration
# 6. Deploy to production
clodo deploy --env prod --domains api.store.com
Multi-Service Application
Create Complete Application Stack
# Create API service
clodo create api-service --template rest-api
# Create worker service
clodo create worker-service --template queue-worker
# Create frontend service
clodo create frontend --template static-site
# Deploy all services together
clodo deploy --services api-service,worker-service,frontend \
--env prod --domains api.app.com,app.com
🔍 Troubleshooting
Common issues and their solutions.
❌ Command Not Found
Solution: Ensure CLI is installed globally
npm install -g @clodo/cli
# Or reinstall if issues persist
npm uninstall -g @clodo/cli && npm install -g @clodo/cli
❌ Deployment Fails
Solution: Check authentication and permissions
# Verify Cloudflare credentials
clodo auth status
# Re-authenticate if needed
clodo auth login
❌ Service Won't Start
Solution: Check logs and configuration
# View detailed logs
clodo logs --service my-service --tail 100
# Validate configuration
clodo validate --config config.json
Ready to Automate Your Development?
Join thousands of developers who have accelerated their Cloudflare Workers development with Clodo Framework.