Communitygithub.com

cli-anything-pm2

無狀態命令列介面,用於管理 PM2 程序。

cli-anything-pm2 是什麼?

此技能提供一個無狀態的命令列介面 (CLI) 用於管理 PM2 程序管理器。它透過 PM2 CLI 子程序進行通訊,不儲存任何本地狀態或工作階段,因此非常適合 AI 代理程式或腳本化使用。支援互動式 REPL 模式與指令式模式,並提供 `--json` 旗標輸出機器可讀的 JSON,方便代理程式解析。主要功能包括程序檢查(列出、描述、指標)、生命週期管理(啟動、停止、重新啟動、刪除)、日誌檢視與清除,以及系統層級指令(儲存、設定開機啟動、版本查詢)。開發者應優先使用 `--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. 解析標準錯誤輸出 以取得失敗時的錯誤訊息

版本

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

>-

相關技能