Files
iris-context/commands/ops/pm2.go
T
VERSE 2ef3c90819 feat(commands): more commands (#30)
- I wrote a scripts to copy and generate all commands missing in iris
from fig repo: https://github.com/withfig/autocomplete
- Add a new script to generate commands docs about which commands
currently are inside commands folder
377d4aac663590e504fe39a92eb4dac4cbd333b2
- Add more icons e64d4e70a1db61e62053460a882e093bd6373ab1
2026-07-04 22:08:36 +07:00

103 lines
6.6 KiB
Go

package ops
import (
"github.com/versenilvis/iris/commands/core"
)
func init() {
core.Register(&core.Spec{
Name: "pm2",
Description: "Outputs the version number",
Subcommands: []core.Subcommand{
{Name: "start", Description: "Starts and daemonizes an app"},
{Name: "trigger", Description: "Deploy your json"},
{Name: "deploy", Description: "Deploy your json"},
{Name: "startOrRestart", Description: "Start or restart JSON file"},
{Name: "startOrReload", Description: "Start or gracefully reload JSON file"},
{Name: "pid", Description: "Return pid of the specified app or all"},
{Name: "startOrGracefulReload", Description: "Start or gracefully reolad JSON file"},
{Name: "stop", Description: "Stop a process"},
{Name: "restart", Description: "Restart a process"},
{Name: "scale", Description: "Scale up/down a process in cluster mode depending on the `number` param"},
{Name: "snapshot", Description: "Snapshot PM2 memory"},
{Name: "profile", Description: "Profile CPU"},
{Name: "reload", Description: "Reload processes (for apps using HTTP/HTTPS)"},
{Name: "gracefulReload", Description: "Gracefully reload a process. Send a “shutdown” message to close all connections"},
{Name: "id", Description: "Get process id by name"},
{Name: "delete", Description: "Stops and deletes a process from pm2 process list"},
{Name: "sendSignal", Description: "Send a system signal to the target process"},
{Name: "ping", Description: "Ping pm2 daemon - if not it will launch up"},
{Name: "updatePM2", Description: "Update in-memory PM2 with local PM2"},
{Name: "update", Description: "(alias) update in-memory PM2 with local PM2"},
{Name: "install", Description: "Install or update a module and run it forever"},
{Name: "module:generate", Description: "Generate a sample module in current folder"},
{Name: "uninstall", Description: "Stop and uninstall a module"},
{Name: "publish", Description: "Publish the module you are currently on"},
{Name: "set", Description: "Sets the specified config"},
{Name: "multiset", Description: "Multiset eg `key1 val1 key2 val2`"},
{Name: "get", Description: "Get value for the specified key"},
{Name: "conf", Description: "Get / set module config values"},
{Name: "config", Description: "Get / set module config values"},
{Name: "unset", Description: "Clears the specified config key"},
{Name: "report", Description: "Give a full pm2 report for https://github.com/Unitech/pm2/issues"},
{Name: "link", Description: "Linking action to keymetrics.io"},
{Name: "unlink", Description: "Linking action to keymetrics.io"},
{Name: "unmonitor", Description: "Unmonitor target process"},
{Name: "monitor", Description: "<Unm>onitor target process"},
{Name: "open", Description: "Open dashboard in browser"},
{Name: "register", Description: "Create an account on keymetrics"},
{Name: "login", Description: "Login to keymetrics and link current PM2"},
{Name: "web", Description: "Launch a health API on 0.0.0.0:9615"},
{Name: "dump", Description: "Dump all processes for resurrecting them later"},
{Name: "send", Description: "Send stdin to pm id"},
{Name: "attach", Description: "Attach stdin/stdout to application identified by pm id"},
{Name: "resurrect", Description: "Resurrect previously dumped processes"},
{Name: "unstartup", Description: "Disable and clear auto startup"},
{Name: "startup", Description: "Setup script for pm2 at boot"},
{Name: "logrotate", Description: "Copy default logrotate configuration"},
{Name: "ecosystem", Description: "Generate a process conf file"},
{Name: "reset", Description: "Reset counters for process"},
{Name: "describe", Description: "Describe all parameters of a process id"},
{Name: "desc", Description: "(alias) Describe all parameters of a process id"},
},
Options: []core.Option{
{Name: "-V", Description: "Outputs the version number"},
{Name: "-v", Description: "Gets version"},
{Name: "-s", Description: "Hides all messages"},
{Name: "-m", Description: "Displays a compacted list without formatting"},
{Name: "-f", Description: "Forces actions"},
{Name: "--disable-logs", Description: "Do not write logs"},
{Name: "-n", Description: "Sets a name for script"},
{Name: "-i", Description: "Launches [number] instances (for networked app)(load balanced)"},
{Name: "--parallel", Description: "Number of parallel actions (for restart/reload)"},
{Name: "-l", Description: "Specifies entire log file (error and out are both included)"},
{Name: "-o", Description: "Specifies out log file"},
{Name: "-e", Description: "Specifies error log file"},
{Name: "-p", Description: "Specify pid file"},
{Name: "-k", Description: "Delays before sending final SIGKILL signal to process"},
{Name: "--listen-timeout", Description: "Listen timeout on application reload"},
{Name: "--max-memory-restart", Description: "Specify max memory amount used to autorestart (in octet or use syntax like 100M)"},
{Name: "--restart-delay", Description: "Specify a delay between restarts (in milliseconds)"},
{Name: "--env", Description: "Specify environment to get specific env variables"},
{Name: "--log-type", Description: "Specify log output style (raw by default, json optional)"},
{Name: "-x", Description: "Execute a program using fork system"},
{Name: "--max-restarts", Description: "Only Restart the script COUNT times"},
{Name: "-u", Description: "Defines user when generating startup script"},
{Name: "--uid", Description: "Runs target script with <uid> rights"},
{Name: "--gid", Description: "Runs target script with <gid> rights"},
{Name: "--cwd", Description: "Runs target script as <username>"},
{Name: "--hp", Description: "Defines home path when generating startup script"},
{Name: "--wait-ip", Description: "Overrides systemd script to wait for full internet connectivity to launch pm2"},
{Name: "--service-name", Description: "Defines service name when generating startup script"},
{Name: "-c", Description: "Restarts a running process based on a cron pattern"},
{Name: "-w", Description: "Writes configuration in local folder"},
{Name: "--interpreter", Description: "The interpreter pm2 should use for executing app (bash, python…)"},
{Name: "--interpreter-args", Description: "Interprets options (alias of --node-args)"},
{Name: "--log-date-format", Description: "Adds custom prefix timestamp to logs"},
{Name: "--no-daemon", Description: "Runs pm2 daemon in the foreground if it doesn't exist already"},
{Name: "-a", Description: "Updates environment on restart/reload (-a <=> apply)"},
{Name: "-h", Description: "Outputs usage information"},
},
})
}