Managing environment variables is a pain.
Typical solutions like dot env files don't cut it when working with launching docker containers, CLI tools and commands, scripts, etc. For this reason, I've augmented a tool called Pet to create Superpet, an environment variable and snippets manager.
This is going to be a quick read that aims to showcase Superpet, so buckle in!
You can use the following commands for managing env vars. Similar to many "environment activation" tools out there(think virtual environments in Python), Superpet is able to "activate" an environment for you, inheriting the current environment variables and extending them with those of the namespace specified.
When listing environments, Superpet hides the values of the variables, but shows their names to better describe the environment.
It's also easy to edit the environments and snippets using
superpet edit and
superpet editenv. All the snippets/environments are saved in .toml files that are stored in
~/.config/pet/ by default.
Most Important Command
This is what you're here for.
That's all there is to it. You pick the environment, and it's activated automatically.
Overview of Pet, Snippet Management
Pet, the original project, gives you the ability to create snippets, tag them, search them, list them, and even parametrize them. It also automatically syncs any changes I make to my snippets across machines through free Github gists.
(Yes, you heard that right. There can exist a sync feature without having to pay a monthly fee. I nearly forgot that such things could exist!)
Here are a bunch of useful features of Pet:
Pet really streamlined my workflow, but I felt that it could do even more. Managing environment variables was a very similar problem to managing snippets: you'd normally have a bunch of environment variables associated with doing a single task. For this reason, it made sense to group them in one place and have the ability to call upon them as we do with snippets.
I've also started using Superpet to streamline onboarding. Providing newcomers with a bunch of preconfigured snippets and environments would supercharge their onboarding experience. Installation instructions can be found in the repository.
If you found this helpful, consider supporting me by subscribing for free below and following me on Twitter @iamramiawar!