cli(ux): rename 'node env' → 'NODE_ENV' and show selected --env profile in describe command #6022
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
node env→NODE_ENVinpm2 describe.pm2 describe:PM2 --env, which shows the ecosystem profile selected with--env <name>(e.g.,test,production).pm2_env_nameso the UX layer can display it.Why
Users often confuse the old “node env” label with PM2’s ecosystem profile. This PR:
NODE_ENV.--env, which previously wasn’t visible anywhere indescribe.Output:
How
lib/Common.jsWhen merging environment variables, persist the selected profile name on the process config:
pm2_env_name = <env_name>(or'default'when unset).lib/API/UX/pm2-describe.jsNODE_ENV(guarded: showsN/Aif unset).PM2 --envusingpm2_env_name(fallback to'default').Behavior / Compatibility
--envis provided,PM2 --envshowsdefault.NODE_ENVisn’t set, it showsN/Ainstead ofundefined.Before / After (example)
Before
After
Test plan (manual)
Notes for reviewers