本文へスキップ
Skillpedia
デプロイとクラウド(DevOps)58k · #3237

cli-anything-pm2

できること

このスキルは、Node.jsアプリを動かし続けるツールPM2で管理されているプログラムを、AIエージェントが操作できるようにします。サーバー上でウェブサイトやサービスを動かし、状態をすばやく確認したい人向けです。

使う場面

  • ✓PM2で管理されているアプリが動いていて、どんな状態かを確認したいとき。
  • ✓アプリが止まったので、再起動したいとき。
  • ✓最近のログを読み、エラーを探したいとき。

スキルのリンク

https://github.com/HKUDS/CLI-Anything/blob/main/pm2/agent-harness/cli_anything/pm2/skills/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/HKUDS/CLI-Anything/blob/main/pm2/agent-harness/cli_anything/pm2/skills/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“PM2でウェブサイトのプロセスが動いているか確認し、直近50行のログを表示してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、お使いのマシン上のPM2プログラムにコマンドを送り、結果を読み取ります。実行の間で自分の記憶は保持しません。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

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.

Command Description
list List all PM2 processes
describe <name> Get detailed info for a process
metrics Get metrics for all processes

lifecycle

Process lifecycle commands.

Command Description
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.

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

system

System-level commands.

Command Description
save Save current process list
startup Generate startup script
version Get 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

よくある質問

PM2のインストールが必要ですか?

はい。通常はnpmを使って、PM2をグローバルにインストールしておく必要があります。

プロセスを削除できますか?

はい。deleteコマンドでPM2からプロセスを削除できるため、注意して使ってください。

アプリがどれだけリソースを使っているか確認できますか?

はい。metricsコマンドで、すべてのプロセスの指標を表示できます。

詳細

作者による元の説明

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.

repo: HKUDS/CLI-Anything

人気

GitHubのスター
58k
ランキング
#3237
ライセンス
Apache-2.0
更新日
2026/9/21

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル