Related tool: a friend and I created `diffenv` for developers to easily compare (diff) development environments including environment variables:
https://github.com/error-central/diffenv
Helps for debugging those times when you say, “well it runs fine on my machine, what’s different about your machine??”
Not sure I’d use this. Might be fun to develop, but what’s wrong with a text file you copy to your bashrc or whatever?
Ansible vault, anyone?
Cool idea!
Before sendenv, but with magicwormhole (which it's built on top of):
After sendenv: sendenv also writes to "~/.bash_profile", "~/.zshrc", which is fraught (i.e. on my system they're read-only files).It also, just like the eval in the first example, has the downside of requiring you to completely trust the sender since they can send arbitrary code to execute that'll get written to your shell's rc file.
Basically, if you need to share ad-hoc env vars in a single terminal session, the wormhole snippet I posted above is fine.
If you want them to persist, probably use direnv to share them, ideally tracked in version control.
If you want them to persist system-wide, use ansible or some other configuration management.
The middle-ground, of wanting them to persist so much you write them to the shell rc, but not wanting them to be version controlled or configuration managed, seems like the worst of both worlds.