pm2
Manage Node.js applications with PM2 process manager. Use for deploying, monitoring, and auto-restarting Node apps in production. Covers starting apps, viewing logs, setting up auto-start on boot, and managing multiple processes.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/asteinberger/pm2What This Skill Does
The PM2 skill provides a robust interface for OpenClaw to manage Node.js applications within a server environment. It acts as an abstraction layer over the PM2 process manager, allowing the AI to start, stop, restart, reload, and monitor Node.js processes seamlessly. By leveraging this skill, the AI can ensure high availability for web services, handle production deployments, and manage resource limits through cluster mode and automatic restarts. It enables the AI to act as a sysadmin, maintaining uptime for backend services without requiring manual intervention.
Installation
To integrate this skill into your OpenClaw agent, execute the following command in your terminal:
clawhub install openclaw/skills/skills/asteinberger/pm2
Ensure that Node.js and npm are pre-installed on the target system, as the skill depends on the global PM2 package (npm install -g pm2).
Use Cases
- Production Deployment: Automatically trigger application starts after pulling new code from a repository.
- Process Monitoring: The AI can proactively check the status of critical services, interpret logs, and identify bottlenecks using
pm2 monitorpm2 logs. - Zero-Downtime Updates: Utilize
pm2 reloadto deploy changes to production environments without dropping active user connections. - Self-Healing Infrastructure: Configure auto-restart policies on memory thresholds or system reboots to ensure consistent service uptime.
Example Prompts
- "OpenClaw, list all running processes and show me the last 50 lines of logs for the 'auth-service' app."
- "I've updated the codebase for 'api-server'. Please restart the process using PM2 to apply the changes."
- "My Node.js app is crashing due to memory issues. Can you configure PM2 to restart the process whenever it exceeds 500MB of RAM?"
Tips & Limitations
- Environment Variables: When using PM2, remember that process environment variables set via shell might not persist after a system reboot unless saved in an
ecosystem.config.jsfile. - Permissions: PM2 operations often require specific system permissions. Ensure the user running OpenClaw has sufficient privileges to manage PM2 daemons and execute startup scripts.
- Resource Management: While cluster mode (
-i max) is excellent for scaling, avoid over-allocating CPU cores if the server is running other critical background tasks simultaneously. - Cleanup: Regularly audit the PM2 process list to delete stale or failed deployments to prevent memory leaks and confusion.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-asteinberger-pm2": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-write, file-read, code-execution
Related Skills
home-music
Control whole-house music scenes combining Spotify playback with Airfoil speaker routing. Quick presets for morning, party, chill modes.
portainer
Control Docker containers and stacks via Portainer API. List containers, start/stop/restart, view logs, and redeploy stacks from git.
airfoil
Control AirPlay speakers via Airfoil from the command line. Connect, disconnect, set volume, and manage multi-room audio with simple CLI commands.