Cli Anything Pm2

by hkuds34f519533bc1No license51K starsListed Oct 8, 2026Updated Oct 8, 2026Repository updated 2 weeks ago

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.

Instructions onlyDevOps & Cloud
AI-generated overview

Stateless CLI wrapper for PM2 that lists, starts, stops and restarts Node.js processes and reads logs.

What it does
Provides a command-line interface that talks to the PM2 CLI as a subprocess to manage Node.js processes. It groups commands into process inspection (list, describe, metrics), lifecycle (start, stop, restart, delete), logs (view, flush) and system operations (save, startup, version). Commands return human-readable tables by default or structured JSON with the --json flag, and an interactive REPL is available when no subcommand is given. It keeps no local state or session.
When to use it
Use it when an agent or operator needs to inspect or control PM2-managed Node.js processes from the command line, such as listing running processes, restarting a service or reading recent logs. It suits scripted or agent-driven use where JSON output and return codes are parsed.
Requirements
Requires Python 3.10+ and PM2 installed globally via npm. Installation is done with pip install -e . The skill ships instructions only, no scripts, and it invokes the PM2 CLI as a subprocess.

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 helpcli-anything-pm2 --help
# Start interactive REPL modecli-anything-pm2
# Run with JSON output (for agent consumption)cli-anything-pm2 --json process listcli-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.

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
bash
# Human outputcli-anything-pm2 process list
# JSON output for agentscli-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

Source and attribution

Source:hkuds/cli-anythinginskills/cli-anything-pm2at commit34f5195

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal