Skip to main content
skill CX Codex

cli-anything-pm2 — Claude Code skill: PM2 process management

A skill that brings PM2 CLI into Claude Code for managing Node.js processes. Start, stop, restart applications and tail logs directly from the editor.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add HKUDS/CLI-Anything --skill cli-anything-pm2 -a claude-code
Open on GitHub

What cli-anything-pm2 does

cli-anything-pm2 is a stateless interface to PM2 that works via subprocess. The skill provides four command groups: process (list processes, describe, metrics), lifecycle (start, stop, restart, delete), logs (view, flush), and system (save config, startup script, version).

Output comes in two modes: human-readable tables and colored text by default, or structured JSON with the --json flag for programmatic use. The skill also supports interactive REPL mode with tab-completion and command history.

You need Python 3.10+ and PM2 installed globally (npm install -g pm2). The skill is stateless — it keeps no local state and only talks to PM2 through its CLI.

What it helps with

  • List running Node.js processes and their metrics
  • Start a new application under PM2 with a custom name
  • Stop or restart a process without SSH access
  • View recent logs and flush them
  • Generate a startup script for process auto-boot

Example prompts for the agent

  • show all PM2 processes and their current status
  • start the app from index.js and call it my-app
  • restart the server process and display its recent logs

How to install cli-anything-pm2

1Skills CLI (Vercel)

npx skills add HKUDS/CLI-Anything --skill cli-anything-pm2 -a claude-code

2Manually: put the files in place

~/.claude/skills/cli-anything-pm2/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/cli-anything-pm2/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about cli-anything-pm2

How do I install cli-anything-pm2 in Claude Code?

Run npx skills add HKUDS/CLI-Anything --skill cli-anything-pm2 -a claude-code. After installation, the skill will be available at ~/.claude/skills/cli-anything-pm2/SKILL.md.

What does cli-anything-pm2 do?

The skill connects PM2's CLI interface to AI editors. It lets you manage Node.js processes — start, stop, restart, view logs and metrics, and save configuration — all from the editor.

What do I need to use it?

Python 3.10 or higher and PM2 installed globally via npm. The skill communicates with PM2 only through its CLI and maintains no local state.

Source text

SKILL.md · Apache-2.0
---
name: "cli-anything-pm2"
description: >-
  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.
---

# cli-anything-pm2

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

## Installation

```bash
pip install -e .
```

**Prerequisites:**
- Python 3.10+
- PM2 installed globally (`npm install -g pm2`)

## Usage

### Basic Commands

```bash
# 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:

```bash
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

```bash
# 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

© HKUDS · Apache-2.0 · HKUDS/CLI-Anything

Similar skills

Everything for DevOps and infrastructure →

From the same set55

cli-anything-musescore Skill wraps MuseScore 4's CLI for music notation work: transpose scores, export to PDF/MP3/MIDI, extract instrument parts, manage ensemble setup. CX Codex +1 500installs cli-anything-iterm2 Controls live iTerm2 sessions over the Python WebSocket API. Lets coding agents inspect running panes, send keystrokes, and split terminal layouts. CX Codex +1 495installs cli-anything-openscreen A Claude Code skill that hands the agent a CLI for editing screen recordings: zooms, speed changes, trims, crops, text overlays, and ffmpeg renders. CX Codex +1 495installs cli-anything-dify-workflow A skill that hands the agent commands for building, checking and editing Dify workflow YAML. Useful when a hand-written workflow breaks on import. CX Codex +1 493installs cli-anything-exa Connects the Exa neural search engine to your agent for deep web searches and page retrieval. Useful for gathering research papers, news, and company intelligence. CX Codex +1 491installs cli-anything-safari Controls real Safari on macOS via a Python Click CLI wrapping the safari-mcp server. Useful for running browser automations while preserving existing logins. CX Codex +1 483installs cli-anything-renderdoc A skill that lets your agent inspect RenderDoc frame captures from the terminal: draw call tree, pipeline state, textures and buffers inside .rdc files. CX Codex +1 482installs cli-anything-cloudcompare CLI harness for CloudCompare point cloud and mesh processing across 41 commands. Automates subsampling, normal computation, SOR filtering, and conversions for AI agents. CX Codex +1 478installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor