Skip to content
Skillpedia
Deploy & cloud (DevOps)58k · #3237

cli-anything-pm2

What it does

This skill lets an AI agent manage the programs run by PM2, a tool that keeps Node.js apps running. It is for people who run websites or services on a server and want quick status checks.

When to use it

  • ✓When you want to see which PM2-managed apps are running and how they are doing.
  • ✓When an app has stopped and you need to restart it.
  • ✓When you want to read the recent logs of an app to find an error.

Skill link

https://github.com/HKUDS/CLI-Anything/blob/main/pm2/agent-harness/cli_anything/pm2/skills/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/HKUDS/CLI-Anything/blob/main/pm2/agent-harness/cli_anything/pm2/skills/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“I want to check whether my website process is running in PM2 and see the last 50 log lines.”

5 new skills a week. 1 minute to read.

How it works

The agent sends commands to the PM2 program on your machine and reads back the results. It does not keep its own memory between runs.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

cli-anything-pm2

A stateless command-line interface for PM2 process management. Communicates via the PM2 CLI subprocess. No local state or session.

Installation

pip install -e .

Prerequisites:

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

Usage

Basic Commands

# Show help
cli-anything-pm2 --help

# Start interactive REPL mode
cli-anything-pm2

# Run with JSON output (for agent consumption)
cli-anything-pm2 --json process list
cli-anything-pm2 --json system version

REPL Mode

When invoked without a subcommand, the CLI enters an interactive REPL session:

cli-anything-pm2
# Enter commands interactively with tab-completion and history

Command Groups

process

Process inspection commands.

Command Description
list List all PM2 processes
describe <name> Get detailed info for a process
metrics Get metrics for all processes

lifecycle

Process lifecycle commands.

Command Description
start <script> --name <name> Start a new process
stop <name> Stop a process
restart <name> Restart a process
delete <name> Delete a process

logs

Log management commands.

Command Description
view <name> --lines 50 View recent logs
flush [name] Flush logs

system

System-level commands.

Command Description
save Save current process list
startup Generate startup script
version Get PM2 version

Output Formats

All commands support dual output modes:

  • Human-readable (default): Tables, colors, formatted text
  • Machine-readable (--json flag): Structured JSON for agent consumption
# Human output
cli-anything-pm2 process list

# JSON output for agents
cli-anything-pm2 --json process list

For AI Agents

When using this CLI programmatically:

  1. Always use --json flag for parseable output
  2. Check return codes - 0 for success, non-zero for errors
  3. Parse stderr for error messages on failure

Version

1.0.0

FAQ

Do I need PM2 installed?

Yes. PM2 must be installed globally, usually with npm, before the skill can use it.

Can it remove a process?

Yes. A delete command removes a process from PM2, so use it with care.

Can it show how much resources an app uses?

Yes. A metrics command shows metrics for all of the processes.

Details

Original description by the author

Command-line interface for PM2 - A stateless CLI for Node.js process management via the PM2 CLI. List, start, stop, restart processes, view logs, and manage system configuration.

repo: HKUDS/CLI-Anything

Popularity

GitHub stars
58k
Ranking position
#3237
License
Apache-2.0
Updated
9/21/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills