Skip to content

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

This guide explains how to install and use the cli-anything-pm2 agent skill, which lets an AI agent work with PM2, a tool that keeps Node.js programs running in the background. It is written for readers who have never used an agent skill before. By the end you will know what the skill does, how to add it to your agent, how to ask for things in plain language, and which safety points to check first.

PM2 Process Manager CLIHKUDS/CLI-Anything · Apache-2.0

Quick start

  1. 1Check prerequisites. Confirm Python 3.10+ is installed and PM2 is installed globally with npm.
  2. 2Download and unzip the skill. Download the ZIP from this page and unzip it on your machine.
  3. 3Place the skill folder. Copy it to ~/.claude/skills/ for personal use or to a project's .claude/skills/ folder, or upload it under Settings, Capabilities, Skills in the Claude apps.
  4. 4Install the Python package. From the skill folder, run pip install -e . to install the command-line tool.
  5. 5Test the command. Run cli-anything-pm2 --help and cli-anything-pm2 --json process list to confirm it can reach PM2.
  6. 6Make a natural request. Ask the agent for a read-only check first, such as listing processes or viewing recent logs.

What an agent skill is and what this one does

An agent skill is a folder of instructions and tools that an AI agent can load when a task calls for it. This one is described as a command-line interface for PM2 process management, and its main file is SKILL.md.

Once installed, the agent can list PM2 processes, check their metrics, describe a single process, start, stop, restart or delete processes, view and flush logs, and save the process list or generate a startup script. The skill works by calling the PM2 command-line tool and can return results as JSON so the agent can read them.

  • Process inspection: list, describe and metrics
  • Lifecycle: start, stop, restart and delete
  • Logs: view recent logs and flush them
  • System: save the process list, generate a startup script, get the PM2 version

What you need before installing

The skill only wraps PM2, so PM2 must already work on the same machine. The source lists these prerequisites: Python 3.10+, PM2 installed globally through npm, and the Python package installed with pip.

If you do not use Node.js or PM2, this skill will not help you.

  • Python 3.10+
  • PM2 installed globally via npm
npm install -g pm2

Install the skill for your agent

Download the skill ZIP from this page and unzip it. For Claude Code, place the folder in ~/.claude/skills/ to make it available everywhere, or in a project's .claude/skills/ folder to limit it to that project.

In the Claude apps, you can instead upload the skill under Settings, then Capabilities, then Skills.

The source's install step for the Python package is shown below. Run it from the skill's folder, the one that contains the package files.

  • Personal: ~/.claude/skills/
  • Project only: .claude/skills/ inside your project
  • Claude apps: Settings → Capabilities → Skills
pip install -e .

Check that the command works

Before asking an agent to do anything, confirm that the command-line tool runs and can see PM2. The JSON flag is the form the agent uses to read results.

The source also notes that running the command with no subcommand opens an interactive session with tab-completion and history, which is useful if you want to try things yourself.

cli-anything-pm2 --help cli-anything-pm2 --json process list

How to trigger the skill with natural requests

The source does not define exact trigger phrases, so treat the requests below as examples of what to ask rather than fixed keywords. Describe the outcome you want and name the process if you know it. The agent will choose the matching command.

Be specific about actions that change things. Asking to restart or delete a process is a real change on a live system, so check the result afterwards.

  • Show me which PM2 processes are running and their memory use.
  • Show the last 50 log lines for my api process.
  • Restart the worker process and tell me if it comes back up.
  • Save the current PM2 process list.
  • Describe the process named web and tell me its status.

Safety notes: scripts and what it changes

The skill runs scripts on your machine by calling PM2. It does not use the network, according to the source. Commands such as start, stop, delete and startup can affect services that are live, so limit the agent to machines where that is acceptable.

The source's agent guidance also tells the agent to always use the JSON flag, check return codes (0 for success, non-zero for errors), and read stderr for error messages on failure. Ask the agent to report these if something goes wrong.

  • Runs scripts: yes. It calls the PM2 command-line tool.
  • Uses network: no, according to the source.
  • Avoid giving it stop, delete or startup requests on production machines unless you have reviewed the change first.

Tips for getting reliable results

Ask for read-only checks first, such as listing processes or viewing logs, to confirm the agent sees the right names before changing anything. Process names must match what PM2 shows, so run a list request first if you are unsure.

The skill is stateless: the source says it keeps no local state or session. Each command talks to PM2 directly, so give the full process name in each request rather than assuming the agent remembers an earlier one.

  • Start with a list or metrics request.
  • Use exact process names from the list output.
  • Ask for JSON-based answers when you need structured data.

What people use it for

  • Checking which Node.js services are running and how much memory they use, without typing PM2 commands.
  • Pulling the last 50 log lines from a failing service to see what went wrong.
  • Restarting a stuck worker process and confirming its status afterwards.
  • Saving the current process list and generating a startup script so services return after a reboot.

Frequently asked questions

Is the PM2 agent skill free to use?

The source does not state a licence fee for the skill. It lists the licence as Apache-2.0, so check the licence text in the repository before using it in your own project. PM2 itself must also be installed separately with npm.

What do I need to install the PM2 skill?

You need Python 3.10+, PM2 installed globally through npm (npm install -g pm2), and the Python package installed with pip install -e . from the skill folder. The skill does not work without PM2.

Where do I put the skill so my agent can find it?

Unzip the downloaded folder into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder for one project. In the Claude apps you can upload it under Settings, Capabilities, Skills.

Does this skill need an internet connection?

The source says the skill does not use the network. It works by calling the local PM2 command-line tool, so it acts on processes running on the same machine.

Why does the agent need the --json flag?

The source says JSON output is structured for agent consumption. Without it, commands print human-readable tables and colours, which are harder for an agent to parse reliably.

Can I use this skill with a server that does not run Node.js?

No. The skill only wraps PM2, which manages Node.js programs. If you do not use PM2, the skill has nothing to control.

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-minded people who already run Node.js services with PM2 and want an agent to check status, read logs and restart processes. Avoid it on machines where you do not want an agent changing live services, since start, stop, delete and startup commands can affect them. If you do not use PM2, pick a tool built for your own process manager instead.

Download the skill