prenv is a small Bash CLI for inspecting and formatting shell environment data.
- Pretty-prints environment variables
- Shows
PATHentries one per line - Runs a basic environment health check
- Includes an intended
diffmode for comparing environment state before and after a command
Because the script is not executable yet, run it with Bash:
bash ./prenvIf you want to run it as ./prenv, make it executable first:
chmod +x ./prenv
./prenvPretty-print the current environment. This is the default command.
bash ./prenv
bash ./prenv printUseful options:
--sortsorts variables alphabetically--filter <text>filters variables by key or value--wrapwraps long values instead of truncating them--width <n>changes the output width--no-colordisables ANSI colors
Examples:
bash ./prenv --sort
bash ./prenv --filter PATH
bash ./prenv --filter aws --width 100
bash ./prenv --wrapPrint the current PATH as a numbered list.
bash ./prenv pathShow a lightweight environment summary, including:
- shell
- user
- home directory
- AWS CLI presence and active profile
kubectlpresence- Node.js version
- total number of
PATHentries
bash ./prenv doctorIntended to compare environment state before and after running a command.
bash ./prenv diff 'npm run build'# Show all variables
bash ./prenv
# Show only variables related to PATH
bash ./prenv --filter PATH
# Show variables in sorted order
bash ./prenv --sort
# Inspect PATH cleanly
bash ./prenv path
# Run environment checks
bash ./prenv doctor- The script currently needs
bash ./prenvunless you add execute permissions. diffis present in the interface, but its current argument parsing and subshell behavior need follow-up before it works as expected for command-driven environment changes.
bash ./prenv --help