Communitygithub.com

cli-anything-pm2

一个用于PM2进程管理的无状态命令行界面。通过PM2子进程通信,无需本地状态或会话。

cli-anything-pm2 是什么?

cli-anything-pm2 是一个无状态、专门化的 CLI 工具,旨在通过命令行管理 PM2 进程。它通过 PM2 CLI 子进程进行通信,无需维护本地状态或持久会话,非常适合集成到 AI 代理的工作流中 (例如 Claude Code、Coder 或 Codex)。此工具提供了一组针对进程检查、生命周期管理、日志操作和系统级任务的结构化命令,全部通过一个统一的可执行文件访问。其独特价值在于支持双输出模式:面向人类用户的可读终端格式,以及为 AI 代理引擎设计的机器可读 JSON 格式 (通过 `--json` 标志)。该工具还提供一个交互式 REPL 模式,支持命令自动补全和操作历史,方便手动测试和管理。对于 AI 代理,推荐始终使用 `--json` 获取可解析输出,并检查返回码以进行错误处理。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/HKUDS/CLI-Anything/tree/main/skills/cli-anything-pm2

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

cli-anything-pm2 是做什么的?

一个无状态的命令行界面,用于 PM2 进程管理。 通过 PM2 CLI 子进程通信。无需本地状态或会话。

安装

pip install -e .

前提条件:

  • Python 3.10+
  • 全局安装 PM2 (npm install -g pm2)

使用

基本命令

# 显示帮助
cli-anything-pm2 --help

# 启动交互式 REPL 模式
cli-anything-pm2

# 以 JSON 输出运行(供代理使用)
cli-anything-pm2 --json process list
cli-anything-pm2 --json system version

REPL 模式

当未指定子命令调用时,CLI 将进入交互式 REPL 会话:

cli-anything-pm2
# 以交互方式输入命令,支持制表符补全和历史记录

命令组

process

进程检查命令。

命令描述
list列出所有 PM2 进程
describe <name>获取进程的详细信息
metrics获取所有进程的指标

lifecycle

进程生命周期命令。

命令描述
start <script> --name <name>启动新进程
stop <name>停止一个进程
restart <name>重启一个进程
delete <name>删除一个进程

logs

日志管理命令。

命令描述
view <name> --lines 50查看最近的日志
flush [name]清空日志

system

系统级命令。

命令描述
save保存当前进程列表
startup生成启动脚本
version获取 PM2 版本

输出格式

所有命令均支持双输出模式:

  • 人类可读(默认):表格、颜色、格式化文本
  • 机器可读(--json 标志):结构化的 JSON 供代理使用
# 人类输出
cli-anything-pm2 process list

# 为代理生成的 JSON 输出
cli-anything-pm2 --json process list

用于 AI 代理

当程序化使用此 CLI 时:

  1. 始终使用 --json 标志 以获得可解析的输出
  2. 检查返回码 - 0 表示成功,非零表示错误
  3. 解析 stderr 以获取失败时的错误消息

版本

1.0.0

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

cli-anything-adguardhome

>-

cli-anything-anygen

>-

cli-anything-audacity

>-

cli-anything-blender

>-

cli-anything-browser

Browser automation CLI using DOMShell MCP server. Maps Chrome

cli-anything-calibre

>-

cli-anything-ccswitch

CLI interface for CC Switch — manage AI coding tool configurations from the terminal

cli-anything-chromadb

>-

cli-anything-cloudanalyzer

Command-line interface for CloudAnalyzer — Agent-friendly harness for CloudAnalyzer, a QA platform for mapping, localization, and perception outputs. Supports 27 commands across 8 groups: point cloud evaluation, trajectory evaluation, ground segmentation QA, config-driven quality gates, baseline evolution, processing, visualization, and interactive REPL.

cli-anything-cloudcompare

Command-line interface for CloudCompare — Agent-friendly harness for CloudCompare, the open-source 3D point cloud and mesh processing software. Supports 41 commands across 9 groups: project management, session control, point cloud operations (subsample, filter, segment, analyze), mesh operations, distance computation (C2C, C2M), transformations (ICP, matrix), export (LAS/LAZ/PLY/PCD/OBJ/STL/E57), and interactive REPL.

cli-anything-comfyui

>-

cli-anything-dify-workflow

Wrapper for the Dify workflow DSL CLI. Create, inspect, validate, edit, and export Dify workflow files through a CLI-Anything harness.

cli-anything-drawio

>-

cli-anything-eez-studio

Use EEZ Studio from the command line: inspect and modify native .eez-project files, edit LVGL screens/widgets, manage SCPI commands, and invoke the real EEZ Studio backend for LVGL builds.

cli-anything-eth2-quickstart

>-

cli-anything-exa

>-

cli-anything-firefly-iii

Firefly III CLI - Personal finance management via CLI-Anything

cli-anything-freecad

Complete CLI harness for FreeCAD parametric 3D CAD modeler (258 commands). Covers ALL workbenches: Part (29 primitives + boolean + mirror + loft + sweep), Sketcher (26 cmds: geometry + constraints + editing), PartDesign (38 cmds: pad/pocket/groove/fillet/chamfer/patterns/hole/datum), Assembly (11 cmds), Mesh (16 cmds), TechDraw (15 cmds: views + dimensions + PDF/SVG), Draft (33 cmds: 2D shapes + arrays + transforms), FEM (12 cmds), CAM/CNC (10 cmds), Surface (6 cmds), Spreadsheet (7 cmds), Import (13 formats), Export (17 formats), Measure (12 cmds), Materials (21 presets). Headless FreeCAD export to STEP/IGES/STL/OBJ/DXF/PDF/glTF/3MF.

cli-anything-gimp

>-

cli-anything-godot

>-

相关技能