/pm2 Command
Auto-analyze project and generate PM2 service commands for managing development services.Workflow
- Check PM2 (install via
npm install -g pm2if missing) - Scan project to identify services (frontend/backend/database)
- Generate config files and individual command files
- Update project CLAUDE.md with PM2 info
- Display completion summary
Service Detection
Port Detection Priority: User specified > .env > config file > scripts args > default port
Generated Files
Command Syntax
Windows Configuration
ecosystem.config.cjs
Must use.cjs extension
Terminal Commands
After init:Key Rules
- Config file:
ecosystem.config.cjs(not .js) - Node.js: Specify bin path directly + interpreter
- Python: Node.js wrapper script +
windowsHide: true - Open new window:
start wt.exe -d "{path}" pwsh -NoExit -c "command" - Minimal content: Each command file has only 1-2 lines description + bash block
Related
- Commands:
/setup-pm