Hide Modules in default pm2 list
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
What's going wrong?
Is there anyway to disable the list of modules by default when you run pm2 list?
How could we reproduce this issue?
Install any module (for example pm2-logrotate) and then run pm2 list
I was hoping to see only my script and not the modules I have installed.
If I wanted to see modules, I could do something like pm2 list --modules
Supporting information
--- PM2 report ----------------------------------------------------------------
Date : Thu Dec 23 2021 17:01:13 GMT+0000 (Western European Standard Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version : 5.1.2
node version : 16.13.1
node path : not found
argv : /usr/bin/node,/usr/lib/node_modules/pm2/lib/Daemon.js
argv0 : node
user : root
uid : 0
gid : 0
uptime : 23min
===============================================================================
--- CLI ----------------------------------------------------
local pm2 : 5.1.2
node version : 16.13.1
node path : /usr/bin/pm2
argv : /usr/bin/node,/usr/bin/pm2,report
argv0 : node
user : root
uid : 0
gid : 0
===============================================================================
--- System info --------------------------------------------
arch : arm
platform : linux
type : Linux
cpus : ARMv7 Processor rev 4 (v7l)
cpus nb : 4
freemem : 28528640
totalmem : 964706304
home : /root
===============================================================================
--- PM2 list -----------------------------------------------
┌─────┬──────────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
├─────┼──────────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 2 │ run │ default │ N/A │ fork │ 2103 │ 10m │ 0 │ online │ 6% │ 19.5mb │ root │ disabled │
└─────┴──────────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
Module
┌────┬──────────────────────────────┬───────────────┬──────────┬──────────┬──────┬──────────┬──────────┬──────────┐
│ id │ module │ version │ pid │ status │ ↺ │ cpu │ mem │ user │
├────┼──────────────────────────────┼───────────────┼──────────┼──────────┼──────┼──────────┼──────────┼──────────┤
│ 1 │ pm2-logrotate │ 2.7.0 │ 2065 │ online │ 0 │ 2% │ 41.9mb │ root │
└────┴──────────────────────────────┴───────────────┴──────────┴──────────┴──────┴──────────┴──────────┴──────────┘
===============================================================================
--- Daemon logs --------------------------------------------
/root/.pm2/pm2.log last 20 lines:
PM2 | 2021-12-23T16:37:17: PM2 log: PM2 home : /root/.pm2
PM2 | 2021-12-23T16:37:17: PM2 log: PM2 PID file : /root/.pm2/pm2.pid
PM2 | 2021-12-23T16:37:17: PM2 log: RPC socket file : /root/.pm2/rpc.sock
PM2 | 2021-12-23T16:37:17: PM2 log: BUS socket file : /root/.pm2/pub.sock
PM2 | 2021-12-23T16:37:17: PM2 log: Application log path : /root/.pm2/logs
PM2 | 2021-12-23T16:37:17: PM2 log: Worker Interval : 30000
PM2 | 2021-12-23T16:37:17: PM2 log: Process dump file : /root/.pm2/dump.pm2
PM2 | 2021-12-23T16:37:17: PM2 log: Concurrent actions : 2
PM2 | 2021-12-23T16:37:17: PM2 log: SIGTERM timeout : 1600
PM2 | 2021-12-23T16:37:17: PM2 log: ===============================================================================
PM2 | 2021-12-23T16:37:17: PM2 log: App [run:0] starting in -fork mode-
PM2 | 2021-12-23T16:37:17: PM2 log: App [run:0] online
PM2 | 2021-12-23T16:49:10: PM2 log: App [pm2-logrotate:1] starting in -fork mode-
PM2 | 2021-12-23T16:49:10: PM2 log: App [pm2-logrotate:1] online
PM2 | 2021-12-23T16:50:04: PM2 log: Stopping app:run id:0
PM2 | 2021-12-23T16:50:04: PM2 log: pid=1088 msg=failed to kill - retrying in 100ms
PM2 | 2021-12-23T16:50:04: PM2 log: App [run:0] exited with code [1] via signal [SIGINT]
PM2 | 2021-12-23T16:50:04: PM2 log: pid=1088 msg=process killed
PM2 | 2021-12-23T16:50:25: PM2 log: App [run:2] starting in -fork mode-
PM2 | 2021-12-23T16:50:25: PM2 log: App [run:2] online
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the pm2 list CLI command and how the requested --modules variant is handled. Done means pm2 list shows user scripts without installed modules by default, while an explicit module option still shows them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100