Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)58k · #3237

cli-anything-pm2

Skill này làm gì

Skill này giúp agent AI quản lý các chương trình được chạy bởi PM2, một công cụ giữ cho ứng dụng Node.js hoạt động liên tục. Skill dành cho người chạy website hoặc dịch vụ trên máy chủ và muốn kiểm tra trạng thái nhanh.

Khi nào nên dùng

  • ✓Khi bạn muốn xem những ứng dụng nào do PM2 quản lý đang chạy và hoạt động ra sao.
  • ✓Khi một ứng dụng đã dừng và bạn cần khởi động lại nó.
  • ✓Khi bạn muốn đọc log gần đây của một ứng dụng để tìm lỗi.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/HKUDS/CLI-Anything/blob/main/pm2/agent-harness/cli_anything/pm2/skills/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tôi muốn kiểm tra xem tiến trình website của mình có đang chạy trong PM2 không và xem 50 dòng log cuối.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent gửi lệnh đến chương trình PM2 trên máy của bạn rồi đọc lại kết quả. Agent không giữ bộ nhớ riêng giữa các lần chạy.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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

Câu hỏi thường gặp

Tôi có cần cài PM2 không?

Có. PM2 phải được cài toàn cục, thường bằng npm, trước khi skill có thể dùng nó.

Nó có xóa được tiến trình không?

Có. Lệnh delete sẽ xóa một tiến trình khỏi PM2, vì vậy hãy dùng cẩn thận.

Nó có hiển thị ứng dụng dùng bao nhiêu tài nguyên không?

Có. Lệnh metrics hiển thị các chỉ số cho tất cả tiến trình.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
58k
Vị trí xếp hạng
#3237
Giấy phép
Apache-2.0
Cập nhật
21/9/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự