Reproducible Development Environments Made Simple
A lightweight CLI tool that makes setting up development environments as easy as running a single command. No more "it works on my machine" - RepDev ensures consistent environments across your entire team using Docker containers with intelligent orchestration.
- π― One Command Setup -
repdev upstarts your entire stack - π¦ Pre-built Presets - MERN, Django, Next.js, and more
- π¨ Interactive CLI - Guided setup with smart prompts
- π Lifecycle Hooks - Run scripts before/after container events
- β±οΈ Readiness Checks - Wait for services to be truly ready
- π Environment Files - Secure
.envfile support - π Network Control - Host, bridge, and custom networks
- π οΈ DX Commands - logs, exec, restart without leaving RepDev
- π₯ Health Checks -
repdev doctordiagnoses issues - π State Tracking - Know what's running and when
npm install -g repdev# List available presets
repdev init --list
# Initialize with a preset (interactive prompts)
repdev init -p mern
# Start your environment
repdev up
# Check status
repdev status
# View logs
repdev logs backend -f
# Stop everything
repdev down- Why RepDev?
- Installation
- Quick Start
- Available Presets
- CLI Commands
- Template Structure
- Advanced Features
- Customization
- Troubleshooting
- Contributing
- License
Setting up development environments is painful:
- β Complex Docker Compose files
- β Manual dependency installation
- β Different environments across team members
- β "Works on my machine" syndrome
- β No standardized onboarding process
RepDev provides:
- β Simple YAML templates
- β Interactive setup wizards
- β Consistent environments everywhere
- β Automated health checks
- β New developers productive in minutes
| Feature | Docker Compose | RepDev |
|---|---|---|
| Syntax | Verbose YAML | Simple YAML |
| Setup | Manual | Interactive prompts |
| Hooks | Limited | Full lifecycle |
| Readiness | Depends on | Built-in wait_for |
| Presets | None | MERN, Django, etc. |
| Port Checks | No | Automatic |
| Error Help | Generic | Actionable suggestions |
| State Tracking | No | Yes |
# Global installation
npm install -g repdev
# Verify installation
repdev --version
# Check system health
repdev doctorRepDev comes with battle-tested presets for popular stacks:
repdev init -p mern- Frontend: React (Vite)
- Backend: Node.js + Express
- Database: MongoDB Atlas
- Features: Hot reload, auto-install deps, interactive network configuration
repdev init -p django- Framework: Django
- Database: PostgreSQL
- Features: Auto migrations, static files, custom network support
repdev init -p django-drf- Backend: Django REST Framework
- Frontend: React
- Database: PostgreSQL
- Features: Full API setup, network isolation options
repdev init -p network-demo- Purpose: Multi-tier network architecture demonstration
- Services: 7 containers with 3 isolated networks
- Features: Shows microservices, host mode, static IPs, sidecars
Create a new repdev.yml template.
# Interactive mode
repdev init
# Use a preset
repdev init -p mern
# List available presets
repdev init --list
# Force overwrite existing file
repdev init -p django --forceStart your development environment.
# Start all services
repdev up
# Use specific template
repdev up -t custom-template.yml
# Use preset
repdev up -p mern
# Force recreate containers
repdev up --force
# Skip readiness checks
repdev up --no-wait
# Start specific services
repdev up -s backend,dbStop and remove containers.
# Stop all services
repdev down
# Stop specific services
repdev down -s frontend
# Force removal
repdev down --forceCheck environment status.
repdev statusOutput:
π RepDev Status
Template: /path/to/repdev.yml
Preset: mern
Containers: 2 total, 2 running, 0 stopped
Last Up: 10/20/2025, 2:30:15 PM
π¦ Containers:
π’ backend (mern_backend)
Image: node:20
Status: running
Ports: 3000:3000
π’ frontend (mern_frontend)
Image: node:20
Status: running
Ports: 5173:5173
View container logs.
# View logs
repdev logs backend
# Follow logs (like tail -f)
repdev logs backend -f
# Show last 50 lines
repdev logs backend --tail 50Execute commands in containers.
# Interactive shell
repdev exec backend bash
# Run a command
repdev exec backend npm run test
# Database access
repdev exec db psql -U postgres mydbRestart containers.
# Restart a service
repdev restart backend
# Restart all services
repdev restart --allValidate template syntax.
# Validate local repdev.yml
repdev validate
# Validate specific file
repdev validate -t custom.yml
# Validate preset
repdev validate -p mernRun system health checks.
# Basic health check
repdev doctor
# Include port availability
repdev doctor --portsOutput:
π₯ RepDev System Health Check
π’ Node.js
Status: β
OK
Version: v20.10.0
π³ Docker
Status: β
OK
Version: 24.0.6
π Template (repdev.yml)
Status: β
OK
πΎ Disk Space
Status: β
OK
π¦ RepDev Containers
Status: β
OK
Total: 2 (2 running, 0 stopped)
β¨ All systems operational!
version: '1.0'
metadata:
name: my-app
description: My awesome application
author: Your Name
services:
app:
image: node:20-alpine
container_name: my_app
working_dir: /app
volumes:
- ./app:/app
ports:
- "3000:3000"
environment:
NODE_ENV: development
PORT: 3000
command:
- sh
- -c
- |
npm install
npm run devversion: '1.0'
metadata:
name: advanced-app
hooks:
preUp:
- echo "π Starting environment..."
postUp:
- echo "β
Environment ready!"
- 'echo "π Visit: http://localhost:3000"'
preDown:
- echo "π§Ή Cleaning up..."
postDown:
- echo "β
Cleanup complete"
services:
backend:
image: node:20
container_name: app_backend
working_dir: /app
volumes:
- ./backend:/app
ports:
- "3000:3000"
env_file:
- ./backend/.env
environment:
NODE_ENV: development
hooks:
beforeStart:
- echo "Installing backend dependencies..."
afterStart:
- echo "Backend started!"
wait_for:
type: http
url: http://localhost:3000/health
timeout: 60000
retries: 30
interval: 2000
command:
- sh
- -c
- |
npm install
npm run dev
depends_on:
- db
db:
image: postgres:15-alpine
container_name: app_db
environment:
POSTGRES_USER: devuser
POSTGRES_PASSWORD: devpass
POSTGRES_DB: devdb
ports:
- "5432:5432"
volumes:
- ./data/postgres:/var/lib/postgresql/data
wait_for:
type: tcp
host: localhost
port: 5432Execute scripts at specific points in the container lifecycle:
hooks:
preUp: ["echo Starting..."]
postUp: ["echo Ready!"]
preDown: ["echo Stopping..."]
postDown: ["echo Stopped"]
services:
app:
hooks:
beforeStart: ["npm install"]
afterStart: ["npm run migrate"]Wait for services to be truly ready:
services:
api:
wait_for:
type: http
url: http://localhost:3000/health
timeout: 60000
retries: 30
interval: 2000
db:
wait_for:
type: tcp
host: localhost
port: 5432
container:
wait_for:
type: container_healthyKeep secrets out of version control:
services:
app:
env_file:
- .env # Base config
- .env.local # Local overrides
environment:
NODE_ENV: development # Overrides .envPriority: inline environment > env_file
Control container networking for isolation, performance, and multi-tier architectures:
Network Modes:
services:
app:
network_mode: host # High performance, uses host network
# network_mode: bridge # Default, isolated networking
# network_mode: none # No networkingCustom Networks (recommended for complex apps):
networks:
frontend:
backend:
database:
services:
web:
networks: [frontend]
api:
networks: [frontend, backend]
db:
networks: [database] # Fully isolatedAdvanced Network Config:
networks:
app_net:
driver: bridge
ipam:
config:
- subnet: 172.25.0.0/16
services:
api:
networks:
app_net:
ipv4_address: 172.25.0.10
aliases: [api-server, backend]π Full Guide: docs/NETWORK_CONFIGURATION.md
See CUSTOMIZATION.md for detailed customization guide.
Change directories:
volumes:
- ./backend:/app # Change to ./server:/appChange ports:
ports:
- "3000:3000" # Change to "4000:4000"Change package manager:
command:
- npm install # Change to 'yarn install' or 'pnpm install'Use environment files:
env_file:
- .envError: Cannot connect to the Docker daemon
Solutions:
- Start Docker Desktop
- Check if Docker daemon is running:
docker ps - On Linux:
sudo systemctl start docker
Error: EADDRINUSE: address already in use
Solutions:
- Find the process:
netstat -ano | findstr :<port>(Windows) - Stop conflicting containers:
repdev down - Change the port in
repdev.yml - Kill the process or use a different port
Error: container name already in use
Solutions:
- Use
--forceflag:repdev up --force - Stop existing containers:
repdev down - Remove conflicting container:
docker rm -f <name>
Error: pull access denied or not found
Solutions:
- Check image name spelling in
repdev.yml - Verify image exists on Docker Hub
- Try pulling manually:
docker pull <image> - Login if needed:
docker login
Error: no such file or directory: repdev.yml
Solutions:
- Run
repdev initto create a template - Use
-tflag:repdev up -t /path/to/template.yml - Use a preset:
repdev up -p mern
Error: permission denied
Solutions:
- On Linux:
sudo usermod -aG docker $USER - On Windows: Run as Administrator
- Check file/directory permissions
Run diagnostic checks:
repdev doctorThis checks:
- β Node.js version
- β Docker connectivity
- β Template validity
- β Disk space
- β Container status
With port check:
repdev doctor --portsrepdev/
βββ src/
β βββ cli/
β β βββ commands/ # CLI command implementations
β βββ core/
β β βββ dockerManager.js # Docker orchestration
β β βββ TemplateManager.js # Template loading
β β βββ HooksRunner.js # Lifecycle hooks
β β βββ logger.js # Logging
β βββ utils/
β β βββ envFileLoader.js # .env file parsing
β β βββ errorHandler.js # Error handling
β β βββ stateManager.js # State tracking
β βββ templates/
β βββ presets/ # Pre-built templates
βββ docs/ # Documentation
We welcome contributions! See CONTRIBUTING.md for guidelines.
# Clone the repo
git clone https://github.com/el-noir/repdev.git
cd repdev
# Install dependencies
npm install
# Test locally
node src/index.js --help
# Run tests
npm testMIT Β© el-noir
Built with:
- Docker - Container platform
- Commander.js - CLI framework
- Inquirer.js - Interactive prompts
- Dockerode - Docker API client
- Documentation: Full Docs
- Customization Guide: CUSTOMIZATION.md
- Issue Tracker: GitHub Issues
- Discussions: GitHub Discussions
If RepDev helped you, please give it a β on GitHub!
Made with β€οΈ by developers, for developers