Skip to content

dumpenv

Pythonv0.5.0MIT

Runs any command in a minimal environment (only PATH, HOME, USER, PWD, SHELL, LANG) and diffs the command's visible environment against your current shell. Surfaces which environment variables would leak into a subprocess and which ones your command needs but won't have. Helps reproduce 'it works on my machine' bugs by showing exactly what the command sees. Passes through exit codes.

DevOpsDebuggingEnvironmentCLI

Features

  • Minimal environment with PATH, HOME, USER, PWD, SHELL, LANG only
  • Diff view: missing vars (would leak) and unexpected vars
  • Exit code passthrough from child command
  • Exclude list for known environment variables
  • Verbose side-by-side comparison

Flags

LongShortDescription
--version-VShow version and license
--exclude-eComma-separated vars to exclude from diff
--show-all-aShow all env vars, not just diff
--verbose-vSide-by-side comparison view

Usage

terminal
$ dumpenv npm run build
$
$ dumpenv --exclude PATH,HOME --show-all python my_script.py

Dependencies

stdlib only — subprocess, os, sys

Install
$ curl -LO https://labs.stech-sol.com/downloads/dumpenv/0.5.0/dumpenv_0.5.0.tar.gz
$ tar xzf dumpenv_0.5.0.tar.gz
$ chmod +x dumpenv/dumpenv.py
$ sudo ln -s $PWD/dumpenv/dumpenv.py /usr/local/bin/dumpenv
About
Language
Python
Versionv0.5.0
LicenseMIT
RepositoryGitHub