mcpField
C
cli-anything-pm2

cli-anything-pm2

github.com/hkudsCloud & DevOps57.6k499 installsUpdated 5w ago
Repository

About cli-anything-pm2

cli-anything-pm2 is a stateless command-line skill for managing PM2 processes through the PM2 CLI. It offers an interactive REPL and JSON output for agent consumption.

Key features

  1. 01Inspect processes and metrics
  2. 02Start, stop, restart, and delete processes
  3. 03View and flush logs
  4. 04Save process lists and generate startup scripts
  5. 05Human-readable or JSON output

Use cases

  1. 01Check PM2 process status
  2. 02Manage process lifecycles
  3. 03Review recent process logs
  4. 04Provide structured command results to agents

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/hkuds/cli-anything --skill cli-anything-pm2

After installing, type/cli-anything-pm2in Claude Code to confirm it loaded.

Details

From the project README

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

Comments

Markdown supported