Guide · Agent skill
How to use the PM2 Process Manager CLI agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The cli-anything-pm2 skill teaches an AI agent to work with PM2, a tool that keeps Node.js applications running on a server. This guide explains what an agent skill is, how to install this one, how to ask for things in plain language, and what to watch for before letting an agent restart or stop live services. You do not need prior experience with agent skills to follow it, but you do need a server with PM2 already set up.
Quick start
- 1Confirm the prerequisites. Check that Python 3.10 or newer is installed and that PM2 is installed globally with npm.
- 2Download and unzip the skill. Download the ZIP from this page and unzip it so the skill folder sits in ~/.claude/skills/ or in a project's .claude/skills/ folder.
- 3Or upload it in the Claude apps. In the Claude apps, open Settings, go to Capabilities, then Skills, and upload the ZIP.
- 4Install the CLI package. From the package directory, run pip install -e . as the SKILL.md file describes.
- 5Test the wrapper. Run cli-anything-pm2 --json process list to confirm the CLI can reach your PM2 processes.
- 6Ask for what you need. Describe the outcome in plain language, naming the exact process for any action that changes its state.
What is an agent skill and what does this one do?
An agent skill is a folder of instructions, bundled with any scripts it needs, that an AI agent can load when a task calls for it. This skill is described by a single file called SKILL.md. Once it is installed, the agent knows how to run a command-line wrapper named cli-anything-pm2 to control PM2 on your machine.
The skill lets the agent list the PM2 processes that are running, look at their metrics, start or stop them, restart them, delete them, and read their recent logs. It also covers a few system-level tasks: saving the current process list, generating a startup script, and reporting the PM2 version.
The wrapper is stateless. It sends each request to the PM2 CLI as a subprocess and keeps no session of its own, so every command stands alone.
Install the cli-anything-pm2 skill
Download the skill as a ZIP file from this page, then unzip it. Put the resulting folder in one of two places. For a personal setup, use ~/.claude/skills/. For a single project, use the .claude/skills/ folder inside that project.
If you use the Claude apps instead, open Settings, go to Capabilities, then Skills, and upload the ZIP there.
The skill also needs its command-line package installed. The SKILL.md file gives this command, run from the package directory:
- Python 3.10 or newer must be available.
- PM2 must be installed globally with npm. The SKILL.md file uses: npm install -g pm2
pip install -e .Check that the wrapper works before you trust the agent
Before asking an agent to act, run a few commands yourself. The --help flag lists what the CLI offers. Adding --json before a command makes the output machine-readable, which is the format the agent uses.
If these commands return your process list, the agent will be able to reach PM2 too.
- Show help: cli-anything-pm2 --help
- List processes as JSON: cli-anything-pm2 --json process list
- Check the PM2 version as JSON: cli-anything-pm2 --json system version
cli-anything-pm2 --help
cli-anything-pm2 --json process list
cli-anything-pm2 --json system versionTrigger the skill with natural requests
You do not need to name the skill or type commands. Describe the outcome you want in plain language, and the agent should pick the matching commands. Be specific about the process name, because restart, stop and delete all act on a named process.
The skill's command groups map to common requests. Inspection covers list, describe and metrics. Lifecycle covers start, stop, restart and delete. Logs covers view and flush. System covers save, startup and version.
- 'Show me every PM2 process and whether it is online.'
- 'Show the metrics for all my PM2 processes.'
- 'Read the last 50 log lines for the api process.'
- 'Restart the worker process and then check its logs for errors.'
- 'What version of PM2 is running on this server?'
Know the command groups
The agent uses these groups. You can run the same commands yourself to check its work.
The process group inspects processes. The lifecycle group starts, stops, restarts and deletes them. The logs group views or flushes logs. The system group saves the process list, generates a startup script, and reports the version.
- process: list, describe <name>, metrics
- lifecycle: start <script> --name <name>, stop <name>, restart <name>, delete <name>
- logs: view <name> --lines 50, flush [name]
- system: save, startup, version
cli-anything-pm2 --json process describe <name>
cli-anything-pm2 --json logs view <name> --lines 50Safety notes before you let an agent act
Restarting, stopping or deleting a process can take down a live service. Use the skill only on a machine you own or administer, and be clear with the agent about which process it may touch. Reading processes, metrics and logs is the lower-risk side of the skill.
The skill runs scripts on your machine, so it is not a read-only tool. The source states that it does not use the network. Review the SKILL.md file and the package before installing if your environment requires it.
The skill's own guidance for agents is to always use the --json flag, check return codes (0 means success and anything else means an error), and parse stderr for error messages when a command fails.
- Use it only on servers you control.
- Name the exact process for any stop, restart or delete.
- Read logs first when diagnosing a problem.
- Confirm the agent's commands match what you expected before it runs destructive ones.
What people use it for
- Checking which Node.js services are online on a server you run.
- Reading the last 50 log lines of a named process while diagnosing an error.
- Comparing process metrics across all PM2 processes during a slow period.
- Restarting a single named worker after a deploy, then confirming it came back up.
- Saving the current PM2 process list and generating a startup script after setting up a server.
Frequently asked questions
Is the PM2 agent skill free to use?
The skill is published under the Apache-2.0 licence, as listed on this page. PM2 itself is a separate tool that you install with npm, and you should check its own licence if that matters to you.
What do I need before installing cli-anything-pm2?
You need Python 3.10 or newer and PM2 installed globally with npm install -g pm2. The skill only wraps an existing PM2 installation, so it cannot work without one.
How do I install the cli-anything-pm2 skill?
Download the ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder, or upload it under Settings, Capabilities, Skills in the Claude apps. Then install the CLI package with pip install -e . from the package directory.
Why is the cli-anything-pm2 output in JSON?
The skill is designed to return machine-readable JSON so an agent can parse results reliably. Add --json before a command, for example cli-anything-pm2 --json process list, to get that format. Without the flag, output is formatted for people.
Can the agent restart or delete my processes?
Yes, the lifecycle commands can stop, restart and delete named processes. Those actions can take down a live service, so only use the skill on servers you own or administer and name the exact process you want changed.
What should I do if a command fails?
Check the return code, where 0 means success and anything else is an error, and read stderr for the error message, as the skill's guidance for agents describes. Confirm that PM2 is installed globally and that the process name exists in pm2 list.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
This skill suits developers and ops engineers who already run Node.js services under PM2 and want an agent to check status, read logs, or do scripted restarts on servers they control. It is not a good fit for machines you do not administer, or for anyone who does not already use PM2, since it only wraps an existing installation.
Download the skill