A lightweight CLI tool that connects to a remote server over SSH and executes PM2 process manager commands.
Rust 100.0%
9 1 0

Clone this repository

https://tangled.org/tsiry-sandratraina.com/pm22
git@tangled.org:tsiry-sandratraina.com/pm22

For self-hosted knots, clone URLs may differ based on your setup.

README.md

PM22#

downloads crates

pm22 is a lightweight CLI tool that connects to a remote server over SSH and executes PM2 process manager commands.

Perfect for remotely managing Node.js applications from your terminal.

Preview

✨ Features#

  • SSH into any server with your private key
  • Auto install Node.js and PM2 if not found
  • Execute any PM2 command remotely (start, stop, restart, delete, logs, etc.)
  • Supports custom ports and SSH keys
  • Optional verbose output with --verbose

🚚 Installation#

You can install pm22 globally using cargo:

cargo install pm22

🚀 Usage#

pm22 [OPTIONS] <cmd> [args]...

🔹 Environment Variables#

Variable Description
PM22_HOST Default host to connect to (e.g., user@your.server.com)
PM22_PORT Default SSH port to connect to
PM22_KEY Path to your SSH private key, e.g. ~/.ssh/id_rsa

🔹 Arguments#

Name Description
<cmd> PM2 command to execute (start, restart, status, logs, etc.)
[args]... Additional arguments passed to the PM2 command

🔹 Options#

Flag Description Default
-h, --host <host> Host to connect to (e.g., user@your.server.com)
-p, --port <port> SSH port to connect to 22
-k, --key <path> Path to your SSH private key ~/.ssh/id_rsa
-v, --verbose Enable verbose output for debugging/logging
--help Show help information
-V, --version Show version information

📄 License#

MIT License © 2025 Tsiry Sandratraina