Scripts Reference
This page documents all available scripts in the emp-job-queue monorepo. Scripts are organized by category and can be run using pnpm <script-name> or directly from the scripts/ directory.
Quick Start
Most commonly used scripts:
pnpm dev:local-redis- Start local development environmentpnpm dev:api- Start API serverpnpm dev:studio- Start EmProps Studiopnpm build- Build all packagespnpm test- Run all tests
Development Scripts
Local Development Environment
| Script | Command | Description |
|---|---|---|
| Local Redis + API | pnpm dev:local-redis | Starts fresh local Redis and API server with minimal logging |
| Stop Local Redis | pnpm dev:local-redis:stop | Stops local Redis server (brew services) |
| Full Stack | pnpm dev:full-stack | Runs API and Studio concurrently with color-coded output |
| Developer Setup | pnpm setup:developer | One-command setup: install dependencies + start local Redis |
Service Development
| Script | Command | Description |
|---|---|---|
| API | pnpm dev:api | Start Job API server (port 3331) |
| EmProps API | pnpm dev:emprops-api | Start EmProps API server (port 3335) |
| Worker | pnpm dev:worker | Start worker service (Turbo) |
| Worker (Local) | pnpm dev:worker:local | Start worker with local configuration |
| Monitor | pnpm dev:monitor | Start monitoring UI (port 3002) |
| Webhook | pnpm dev:webhook | Start webhook service (port 3332) |
| Studio | pnpm dev:studio | Start EmProps Studio (port 3000) |
| Docs | pnpm dev:docs | Start VitePress documentation site |
Redis Development
| Script | Command | Description |
|---|---|---|
| Dev Redis | pnpm dev:redis | Start Redis with development configuration |
| Dev Data | pnpm dev:redis:dev-data | Start Redis with dev data preloaded |
| Prod Clone | pnpm dev:redis:prod-data | Start Redis with production data clone |
| Stop Redis | pnpm dev:redis:stop | Stop all Redis server instances |
| Sync Test DB | pnpm redis:sync:test | Sync staging data to test environment (optimized) |
| Redis Migrate | pnpm redis:migrate | Run Redis data migration scripts |
Machine Development
| Script | Command | Description |
|---|---|---|
| ComfyUI Dev | pnpm dev:machine | Start ComfyUI machine in local-dev mode |
| ComfyUI Prod | pnpm dev:machine:prod | Start ComfyUI machine in local-prod mode |
| Simulation Dev | pnpm dev:machine:sim | Start simulation machine (local-dev) |
| Simulation Prod | pnpm dev:machine:sim:prod | Start simulation machine (local-prod) |
| Stop Machine | pnpm dev:machine:down | Stop all dev machines |
| Machine Logs | pnpm dev:machine:logs | Follow dev machine logs |
| Machine Exec | pnpm dev:machine:exec | Execute bash in ComfyUI dev container |
| Debug (2 Workers) | pnpm dev:machine:debug | Start ComfyUI with 2 workers for debugging |
Build Scripts
Package Builds
| Script | Command | Description |
|---|---|---|
| Build All | pnpm build | Build all packages with Turbo |
| Build Prod | pnpm build:prod | Build with CURRENT_ENV=production |
| Build Dev | pnpm build:dev | Build with CURRENT_ENV=development |
| Build Backend | pnpm build:backend | Build only backend services (core, api, webhook, emprops-api, telemetry) |
| Build Worker | pnpm build:worker | Force rebuild worker package |
| Build Worker Prod | pnpm build:worker:prod | Build worker with production env |
| Build Studio | pnpm build:studio | Build EmProps Studio |
| Bundle Worker | pnpm worker:bundle | Create self-contained worker bundle with esbuild |
Build Status
| Script | Command | Description |
|---|---|---|
| Status All | pnpm build:status | Check build status of all services |
| Status EmProps API | pnpm build:status:emprops-api | Check EmProps API build status |
| Status Job API | pnpm build:status:api | Check Job API build status |
| Status Worker | pnpm build:status:worker | Check worker build status |
| Status Telemetry | pnpm build:status:telemetry | Check telemetry collector build status |
| Build Info | pnpm build:info | Show build metadata (human-readable) |
| Build Info JSON | pnpm build:info:json | Show build metadata (JSON format) |
| Build Info Current | pnpm build:info:current | Show current build information |
Docker Scripts
Docker Build & Push
| Script | Command | Description |
|---|---|---|
| Build All | pnpm d:all:build | Build all Docker containers in parallel |
| Build All Sequential | pnpm d:all:build:sequential | Build all containers sequentially |
| Build All (No Cache) | pnpm d:all:build:nocache | Build all containers without cache |
| Build & Push All | pnpm d:all:build:push | Build and push all containers in parallel |
| Deploy | pnpm d:deploy | Unified deployment script |
API Container
| Script | Command | Description |
|---|---|---|
| Build | pnpm d:api:build | Build API Docker image |
| Build (No Cache) | pnpm d:api:build:nocache | Build API without cache |
| Push | pnpm d:api:push | Push API image to registry |
| Build & Push | pnpm d:api:build:push | Build and push API |
| Pull | pnpm d:api:pull | Pull API image from registry |
| Run | pnpm d:api:run | Run API container locally |
| Pull & Run | pnpm d:api:pull:run | Pull and run API container |
| Status | pnpm d:api:status | Check API health endpoint |
| Generate Env | pnpm d:api:env_gen | Generate API environment file |
EmProps API Container
| Script | Command | Description |
|---|---|---|
| Build | pnpm d:emprops-api:build | Build EmProps API Docker image |
| Build (No Cache) | pnpm d:emprops-api:build:nocache | Build without cache |
| Push | pnpm d:emprops-api:push | Push image to registry |
| Build & Push | pnpm d:emprops-api:build:push | Build and push EmProps API |
| Pull | pnpm d:emprops-api:pull | Pull image from registry |
| Run | pnpm d:emprops-api:run | Run EmProps API container |
| Pull & Run | pnpm d:emprops-api:pull:run | Pull and run container |
| Status | pnpm d:emprops-api:status | Check health endpoint |
| Generate Env | pnpm d:emprops-api:env_gen | Generate environment file |
Webhook Service Container
| Script | Command | Description |
|---|---|---|
| Build | pnpm d:webhook:build | Build webhook service Docker image |
| Build (No Cache) | pnpm d:webhook:build:nocache | Build without cache |
| Push | pnpm d:webhook:push | Push image to registry |
| Build & Push | pnpm d:webhook:build:push | Build and push webhook service |
| Pull | pnpm d:webhook:pull | Pull image from registry |
| Run | pnpm d:webhook:run | Run webhook container |
| Pull & Run | pnpm d:webhook:pull:run | Pull and run container |
| Status | pnpm d:webhook:status | Check health endpoint |
| Generate Env | pnpm d:webhook:env_gen | Generate environment file |
Telemetry Collector Container
| Script | Command | Description |
|---|---|---|
| Build | pnpm d:telcollect:build | Build telemetry collector image |
| Build (No Cache) | pnpm d:telcollect:build:nocache | Build without cache |
| Push | pnpm d:telcollect:push | Push image to registry |
| Build & Push | pnpm d:telcollect:build:push | Build and push telemetry |
| Pull | pnpm d:telcollect:pull | Pull image from registry |
| Run | pnpm d:telcollect:run | Run telemetry container |
| Pull & Run | pnpm d:telcollect:pull:run | Pull and run container |
| Status | pnpm d:telcollect:status | Check health endpoint |
| Generate Env | pnpm d:telcollect:env_gen | Generate environment file |
Machine Container
| Script | Command | Description |
|---|---|---|
| Up | pnpm d:machine:up | Start machine with docker-compose |
| Up & Build | pnpm d:machine:up:build | Start and build machine |
| Down | pnpm d:machine:down | Stop machine containers |
| Build | pnpm d:machine:build | Build machine image |
| Build (No Cache) | pnpm d:machine:build:nocache | Build without cache |
| Build & Push | pnpm d:machine:build:push | Build and push machine |
| Build Local | pnpm d:machine:build:local | Build for local testing |
| Pull & Run | pnpm d:machine:pull:run | Pull and run machine |
| Logs | pnpm d:machine:logs | View machine logs |
| Status | pnpm d:machine:status | Check machine health endpoint |
| Generate Env | pnpm d:machine:env_gen | Generate machine environment file |
Other Container Builds
| Script | Command | Description |
|---|---|---|
| Database | pnpm d:database:build | Build database package |
| Monitor | pnpm d:monitor:build | Build monitor package |
| Monitor Env | pnpm d:monitor:env_gen | Generate monitor environment |
| Studio | pnpm d:emprops-studio:build | Build EmProps Studio |
| Studio Env | pnpm d:emprops-studio:env_gen | Generate Studio environment |
| Env Diff | pnpm d:env:diff | Compare deployment environment files |
Environment Management
Environment Builder
| Script | Command | Description |
|---|---|---|
| Build Env | pnpm env:build <profile> | Build environment for profile (production, development, etc.) |
| Build Worker-Driven | pnpm env:build:worker-driven | Build worker-driven environment configuration |
| Switch Env | pnpm env:switch | Switch between environments interactively |
| Validate Env | pnpm env:validate | Validate environment configuration |
| List Profiles | pnpm env:list or pnpm profiles | List all available environment profiles |
| Consolidate | pnpm env:consolidate | Consolidate environment variables |
| Show Env | pnpm env:show | Show current service environment variables |
Profile Runner
| Script | Command | Description |
|---|---|---|
| Run Profile | pnpm run-profile <profile> | Run a specific environment profile |
| Run Profile Debug | pnpm run-profile:debug <profile> | Run profile with debug mode enabled |
| Run Service | pnpm run-service <service> | Run a specific service |
| Compose Profile | pnpm compose:profile | Generate docker-compose from profile |
Vercel Deployment
| Script | Command | Description |
|---|---|---|
| Push to Vercel | pnpm env:vercel:push | Push environment variables to Vercel |
| Export to Vercel | pnpm env:vercel:export | Export environment to Vercel format |
| Delete from Vercel | pnpm env:vercel:delete | Delete environment variables from Vercel |
Testing Scripts
Unit & Integration Tests
| Script | Command | Description |
|---|---|---|
| Test All | pnpm test | Run all tests across monorepo |
| Test Core | pnpm test:core | Run @emp/core package tests |
| Test Core UI | pnpm test:core:ui | Run core tests with Vitest UI |
| Test Core Watch | pnpm test:core:watch | Run core tests in watch mode |
| Test API | pnpm test:api | Run API server tests |
| Test API UI | pnpm test:api:ui | Run API tests with Vitest UI |
| Test API Watch | pnpm test:api:watch | Run API tests in watch mode |
| Test API Coverage | pnpm test:api:coverage | Generate API test coverage report |
| Test Worker | pnpm test:worker | Run worker service tests |
| Test Worker UI | pnpm test:worker:ui | Run worker tests with Vitest UI |
| Test Worker Watch | pnpm test:worker:watch | Run worker tests in watch mode |
| Test Webhook | pnpm test:webhook | Run webhook service tests |
| Test Webhook UI | pnpm test:webhook:ui | Run webhook tests with Vitest UI |
| Test Webhook Watch | pnpm test:webhook:watch | Run webhook tests in watch mode |
| Test Telemetry | pnpm test:telemetry | Run telemetry collector tests |
| Test Telemetry UI | pnpm test:telemetry:ui | Run telemetry tests with UI |
| Test Monitor | pnpm test:monitor | Run monitor UI tests |
| Test Monitor UI | pnpm test:monitor:ui | Run monitor tests with UI |
| Test Machine | pnpm test:machine | Run machine tests |
| Test Studio | pnpm test:studio | Run EmProps Studio tests |
E2E Tests
| Script | Command | Description |
|---|---|---|
| API E2E | pnpm test:api:e2e | Run API end-to-end tests |
| API E2E UI | pnpm test:api:e2e:ui | Run API E2E tests with UI |
| API E2E Telemetry | pnpm test:api:e2e:telemetry | Run API E2E telemetry tests |
| Webhook E2E | pnpm test:webhook:e2e | Run webhook end-to-end tests |
| Webhook E2E UI | pnpm test:webhook:e2e:ui | Run webhook E2E with UI |
| Webhook E2E Telemetry | pnpm test:webhook:e2e:telemetry | Run webhook E2E telemetry tests |
| Telemetry E2E | pnpm test:telemetry:e2e | Run telemetry collector E2E tests |
| Infrastructure Tests | pnpm test:infrastructure | Run infrastructure validation tests |
Quality Assurance
| Script | Command | Description |
|---|---|---|
| Lint All | pnpm lint | Run ESLint across all packages |
| Lint Studio | pnpm lint:studio | Run ESLint for EmProps Studio |
| Typecheck All | pnpm typecheck | Run TypeScript type checking on all packages |
| Typecheck Studio | pnpm typecheck:studio | Run TypeScript checking for Studio |
| Check Core | pnpm check:core | Verify and rebuild @emp/core if needed |
Utility Scripts
Logging & Monitoring
| Script | Command | Description |
|---|---|---|
| Log Viewer | pnpm logs | Interactive log viewer for all services |
| EmProps API Logs | pnpm logs:emprops-api | Tail EmProps API logs |
| Studio Logs | pnpm logs:emprops-studio | Tail EmProps Studio logs |
| Redis Monitor | pnpm logs:redis | Filtered Redis monitor output |
| All Logs Watch | pnpm dev:all:logs:watch | Watch all service logs |
| Error Logs | pnpm dev:all:logs:errors | Filter logs for errors only |
Redis CLI
| Script | Command | Description |
|---|---|---|
| Local Redis CLI | pnpm redis-cli-local | Connect to local Redis (host.docker.internal:6379) |
| Production Redis CLI | pnpm redis-cli-prod | Connect to production Redis |
| Redis Monitor | ./scripts/redis-monitor-filtered.sh | Filtered Redis monitor output |
| Clean Redis Start | ./scripts/redis-clean-start.sh | Start Redis with clean state |
ngrok Tunneling
| Script | Command | Description |
|---|---|---|
| ngrok Check | pnpm ngrok:check | Check ngrok health (headless) |
| ngrok Start | pnpm ngrok:start | Start ngrok tunnels (headless) |
| ngrok Watch | pnpm ngrok:watch | Watch ngrok tunnel status |
| ngrok Status | pnpm ngrok:status | List active ngrok tunnels (JSON) |
| ngrok Stop | pnpm ngrok:stop | Stop all ngrok processes |
| ngrok All | pnpm ngrok | Start all ngrok tunnels from config |
| ngrok API | pnpm ngrok:api | Start ngrok tunnel for API only |
| ngrok EmProps | pnpm ngrok:emprops | Start ngrok tunnel for EmProps only |
| ngrok Redis | pnpm ngrok:redis | Start ngrok tunnel for Redis only |
Shutdown & Cleanup
| Script | Command | Description |
|---|---|---|
| Shutdown All | pnpm shutdown | Stop all containers and cleanup |
| Shutdown Containers | pnpm shutdown:container | Stop Docker containers only |
| Stop All | pnpm dev:all:stop or pnpm stop-all | Stop all development services |
| Clean | pnpm clean | Clean all build artifacts and node_modules |
| Clean Install | pnpm install:clean | Remove node_modules, lockfile, and reinstall |
| Clean Turbo Cache | ./scripts/clean-turbo-cache.sh | Clear Turbo build cache |
Worktree Management
| Script | Command | Description |
|---|---|---|
| Create Worktree | pnpm worktree:create | Create new git worktree for parallel work |
| Setup Worktree | pnpm worktree:setup | Setup environment in worktree |
| Setup Worktree Env | ./scripts/worktree/setup-worktree-env.sh | Copy env files and build config for worktree |
Database Scripts
| Script | Command | Description |
|---|---|---|
| Schema Diff | pnpm db:schema:diff | Compare database schemas |
| Backup Prod Redis | ./scripts/backup-prod-redis.sh | Backup production Redis data |
Dashboard Scripts
| Script | Command | Description |
|---|---|---|
| Dev Dashboard | pnpm dash:dev | Open development dashboard in terminal |
| Staging Dashboard | pnpm dash:staging | Open staging dashboard in terminal |
| Restart Service | pnpm dash:dev:restart | Restart a service from dashboard |
Direct Script Files
The following scripts are located in the scripts/ directory and can be run directly:
Development Scripts
scripts/dev-local-redis.sh- Complete local dev environment setupscripts/dev-redis.sh- Start Redis for developmentscripts/dev-worker-local.sh- Start worker locallyscripts/dev-service.js- Generic service launcher
Environment Scripts
scripts/env/build-env.js- Environment builder (main entry point)scripts/env/consolidate-env.js- Consolidate environment variablesscripts/env/validate-env.js- Validate environment configurationscripts/env/list-profiles.js- List available profilesscripts/env/profile-runner.js- Run environment profilesscripts/env/service-runner.js- Run individual servicesscripts/env/switch-env.js- Switch between environments
Docker Scripts
scripts/docker/build-all-containers.sh- Build all containersscripts/docker/build-all-parallel.sh- Build all in parallelscripts/docker/build-push-all-parallel.sh- Build and push allscripts/run-api-docker.sh- Run API containerscripts/run-emprops-api-docker.sh- Run EmProps API containerscripts/run-webhook-docker.sh- Run webhook containerscripts/run-telcollect-docker.sh- Run telemetry container
Machine Scripts
scripts/env/machine-compose.js- Docker-compose manager for machinesscripts/env/machine-build.js- Build machine imagesscripts/env/machine-local-build.sh- Build machine for local testing
Utility Scripts
scripts/log-viewer.js- Interactive log viewerscripts/show-service-env.js- Display service environmentscripts/show-build-info.js- Show build metadatascripts/generate-build-metadata.js- Generate build metadatascripts/bundle-worker.sh- Create self-contained worker bundlescripts/ngrok-health-check.js- ngrok tunnel managementscripts/terminal/restart-service.js- Service restart utilityscripts/terminal/dashboard-dev.sh- Development dashboardscripts/terminal/dashboard-staging.sh- Staging dashboard
Testing Scripts
scripts/test-infrastructure.sh- Infrastructure validationscripts/test-local-fluent-bit.sh- Test Fluent Bit locally
Redis Scripts
scripts/redis-clean-start.sh- Start fresh Redis instancescripts/redis-migrate.sh- Run Redis migrationsscripts/redis-monitor-filtered.sh- Filtered Redis monitorscripts/redis/sync-staging-to-test-optimized.sh- Optimized data syncscripts/backup-prod-redis.sh- Backup production data
Worktree Scripts
scripts/worktree-create.sh- Create git worktreescripts/setup-worktree.sh- Setup worktree environmentscripts/worktree/setup-worktree-env.sh- Copy env and build config
Common Workflows
Starting Local Development
bash
# Full local development setup
pnpm setup:developer
# Or step-by-step:
pnpm dev:local-redis # Start Redis + API
pnpm dev:studio # Start EmProps Studio
pnpm dev:monitor # Start monitoring UIBuilding for Production
bash
# Build all packages
pnpm build:prod
# Build and push all Docker containers
pnpm d:all:build:push
# Or build specific services
pnpm d:api:build:push
pnpm d:emprops-api:build:push
pnpm d:webhook:build:push
pnpm d:machine:build:pushRunning Tests
bash
# Run all tests
pnpm test
# Run tests with UI for better debugging
pnpm test:core:ui
pnpm test:api:ui
pnpm test:worker:ui
# Run tests in watch mode during development
pnpm test:core:watchEnvironment Management
bash
# List available profiles
pnpm env:list
# Build environment for production
pnpm env:build production
# Switch between environments
pnpm env:switch
# Validate current environment
pnpm env:validateDocker Development
bash
# Start machine locally
pnpm d:machine:up:build
# View machine logs
pnpm d:machine:logs
# Stop machine
pnpm d:machine:down
# Check machine health
pnpm d:machine:statusScript Naming Conventions
dev:*- Development environment scriptsd:*- Docker-related scriptsenv:*- Environment management scriptstest:*- Testing scriptsbuild:*- Build scriptslogs:*- Logging and monitoring scriptsngrok:*- ngrok tunnel managementredis:*- Redis-specific scriptsworktree:*- Git worktree management
See Also
- Environment Management - Detailed guide on environment system
- Getting Started - Setup instructions for new developers
- Development Guide - Development workflows and best practices
