Skip to main content

/pm2 Command

Auto-analyze project and generate PM2 service commands for managing development services.

Workflow

  1. Check PM2 (install via npm install -g pm2 if missing)
  2. Scan project to identify services (frontend/backend/database)
  3. Generate config files and individual command files
  4. Update project CLAUDE.md with PM2 info
  5. Display completion summary

Service Detection

Port Detection Priority: User specified > .env > config file > scripts args > default port

Generated Files

Command Syntax

No arguments required - auto-detects services.

Windows Configuration

ecosystem.config.cjs

Must use .cjs extension

Terminal Commands

After init:

Key Rules

  1. Config file: ecosystem.config.cjs (not .js)
  2. Node.js: Specify bin path directly + interpreter
  3. Python: Node.js wrapper script + windowsHide: true
  4. Open new window: start wt.exe -d "{path}" pwsh -NoExit -c "command"
  5. Minimal content: Each command file has only 1-2 lines description + bash block
  • Commands: /setup-pm