New to Claude Skills? Learn how to install them →

hkuds on GitHub

CLI Anything PM2

Free

Manage Node.js processes easily from the command line.

by hkuds46.9k stars on hkuds/cli-anything
3 views
Updated Aug 3, 2026
Get this skill

Free · Opens the source repo

What CLI Anything PM2 does

CLI Anything PM2 is a command-line interface designed for managing Node.js processes through PM2, a popular process manager. This tool allows users to interact with PM2 in a stateless manner, meaning it does not maintain any local state or session data. Instead, it communicates directly with PM2 via its CLI subprocess, making it suitable for both interactive use and automated scripts. With this skill, developers can efficiently manage their Node.js applications without the overhead of maintaining a persistent session.

The CLI provides a wide range of commands categorized into process management, lifecycle control, log management, and system-level operations. Users can easily list all running processes, start or stop applications, view logs, and even generate startup scripts. The tool supports both human-readable output, which is formatted for direct use in the terminal, and machine-readable JSON output, making it ideal for integration with AI agents or other automated systems.

This skill is particularly useful for developers who need to manage multiple Node.js applications efficiently. It simplifies common tasks such as starting, stopping, and monitoring processes, allowing developers to focus on writing code rather than managing their runtime environment. The interactive REPL mode enhances usability by providing command history and tab completion, which can speed up workflow.

Overall, CLI Anything PM2 is a valuable addition for any developer or operations engineer working with Node.js applications, providing a straightforward and efficient way to manage processes directly from the command line.

When to use it

Use this tool when you need to manage Node.js applications via PM2, especially in automated scripts or interactive sessions.

When not to use it

This skill may not be suitable if you require a graphical user interface or if you are working with non-Node.js applications.

What you can build with it

Managing Multiple Node.js Applications

Use CLI Anything PM2 to start, stop, and monitor multiple Node.js applications efficiently from the command line.

Automating Process Management

Integrate CLI Anything PM2 in deployment scripts to automate the management of Node.js processes.

Interactive Process Monitoring

Utilize the REPL mode for an interactive session to quickly check the status and logs of your Node.js applications.

How to install CLI Anything PM2

View source

1. Install with the skills CLI

npx skills add hkuds/cli-anything/skills --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by hkuds

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.

CommandDescription
listList all PM2 processes
describe <name>Get detailed info for a process
metricsGet metrics for all processes

lifecycle

Process lifecycle commands.

CommandDescription
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.

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

system

System-level commands.

CommandDescription
saveSave current process list
startupGenerate startup script
versionGet 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

Frequently asked questions about CLI Anything PM2

Similar skills