/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
| Type | Detection | Default Port |
|---|---|---|
| Vite | vite.config.* | 5173 |
| Next.js | next.config.* | 3000 |
| Nuxt | nuxt.config.* | 3000 |
| CRA | react-scripts in package.json | 3000 |
| Express/Node | server/backend/api directory | 3000 |
| FastAPI/Flask | requirements.txt / pyproject.toml | 8000 |
| Go | go.mod / main.go | 8080 |
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