mockey-patcher-cli
v1.1.1
Published
Global CLI tool for managing Mockey Patcher backend services with Docker Compose - API mocking and request redirection made simple
Maintainers
Readme
🔧 Mockey Patcher CLI
Global CLI tool for managing Mockey Patcher backend services with Docker Compose - API mocking and request redirection made simple.
📦 Installation
npm install -g mockey-patcher-cli🚀 Quick Start
# Install globally
npm install -g mockey-patcher-cli
# Initialize project (creates folder automatically)
mockey-patcher setup my-project
cd my-project
# Start services
mockey-patcher start
# Check status
mockey-patcher status📋 Commands
mockey-patcher setup
🚀 Initialize a new Mockey Patcher project.
mockey-patcher setup [project-name] [options]
Arguments:
project-name Name of the project folder to create
Options:
-p, --port <number> Backend API port (default: 3000)
--postgres-port <number> PostgreSQL port (default: 5432)
-u, --docker-username <username> Docker Hub username (default: shivarajbakale)
-f, --force Overwrite existing configuration
--no-interactive Skip interactive promptsExamples:
# Interactive setup
mockey-patcher setup
# Create project with custom name
mockey-patcher setup my-api-project
# Non-interactive with custom port
mockey-patcher setup my-api --port 8080 --no-interactive
# Force overwrite existing project
mockey-patcher setup my-api --forcemockey-patcher start
▶️ Start all services.
mockey-patcher start [options]
Options:
-d, --detach Run in detached mode
--pull Pull latest images before starting
--build Build images before startingmockey-patcher stop
⏹️ Stop all services.
mockey-patcher stop [options]
Options:
-v, --volumes Remove volumesmockey-patcher status
📊 Check service status.
mockey-patcher status [options]
Options:
-v, --verbose Show detailed status information
--json Output in JSON formatmockey-patcher restart
🔄 Restart all services.
mockey-patcher restart [options]
Options:
--pull Pull latest images before restarting
--build Build images before restartingmockey-patcher logs
📋 Show service logs.
mockey-patcher logs [service] [options]
Arguments:
service Service name (backend, postgres)
Options:
-f, --follow Follow log output
-t, --tail <number> Number of lines to show
--since <string> Show logs since timestampmockey-patcher reset
🗑️ Reset project (remove containers, volumes, and data).
mockey-patcher reset [options]
Options:
-f, --force Skip confirmation💡 Usage Examples
Basic Usage
# Create new project
mockey-patcher setup my-api
cd my-api
# Start services
mockey-patcher start
# Test API
curl http://localhost:3000/health
# Stop services
mockey-patcher stopDevelopment Workflow
# Start with latest images
mockey-patcher start --pull
# Monitor logs
mockey-patcher logs --follow
# Check status
mockey-patcher status --verbose
# Restart services
mockey-patcher restartCustom Configuration
# Setup with custom ports
mockey-patcher setup my-api --port 8080 --postgres-port 5433
cd my-api
# Start with latest images
mockey-patcher start --pull
# Monitor logs
mockey-patcher logs --followTroubleshooting
# Check detailed status
mockey-patcher status --verbose
# View specific service logs
mockey-patcher logs backend --tail 50
# Reset everything
mockey-patcher reset --force🛠️ Requirements
- Node.js 16 or higher
- Docker and Docker Compose
- npm or yarn
🔧 Development
# Clone the repository
git clone https://github.com/shivarajbakale/redirector-app.git
cd redirector-app/packages/backend/cli
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
# Link for local development
npm link📄 License
MIT
