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.
npx skills add HKUDS/CLI-Anything --skill cli-anything-pm2 -a claude-codeWhat 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-code2Manually: put the files in place
~/.claude/skills/cli-anything-pm2/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/cli-anything-pm2/
1Skills CLI (Vercel)
npx skills add HKUDS/CLI-Anything --skill cli-anything-pm2 -a codex2Manually: put the files in place
.agents/skills/cli-anything-pm2/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add HKUDS/CLI-Anything --skill cli-anything-pm2 -a cursor2Manually: put the files in place
.cursor/skills/cli-anything-pm2/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install HKUDS/CLI-Anything cli-anything-pm22Manually: put the files in place
.github/skills/cli-anything-pm2/SKILL.md1Skills CLI (Vercel)
npx skills add HKUDS/CLI-Anything --skill cli-anything-pm2 -a gemini-cli2Platform CLI
gemini skills install https://github.com/HKUDS/CLI-Anything --path skills/cli-anything-pm2Manually: put the files in place
.devin/skills/cli-anything-pm2/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add HKUDS/CLI-Anything --skill cli-anything-pm2 -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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