Day 3 of 30 for 30
Manage .env files across multiple projects from a single terminal UI. No more opening 12 editors to change one API key.
You have multiple projects with different .env files. You're constantly:
- Opening VSCode just to change one value
- Forgetting which project uses which API key
- Copy-pasting values between projects
- Searching for that one .env file
This tool solves that.
pip install textualOr use requirements.txt:
pip install -r requirements.txtScan current directory:
python envman.pyScan specific directory:
python envman.py /path/to/projects- Scans recursively - Finds all
.envfiles up to 3 levels deep - List all files - See all your .env files in one place
- View variables - See all key-value pairs for each file
- Edit in place - Change values with a simple terminal UI
- Add new variables - Add variables without opening an editor
- Auto-saves - Changes are written back to the file immediately
- Press
1-9to edit a specific.envfile - Edit values directly in the input fields
- Press "Save" to write changes back
- Press "Add Variable" to add new ones
- Press
Escapeto go back - Press
qto quit
- Max 9 files displayed (who has more than 9 projects open anyway?)
- No encryption (store sensitive values elsewhere)
- No git integration (that's scope creep)
- Doesn't handle multi-line values (rare in .env files)
~250 lines of Python (including comments and whitespace)
6 hours (including learning Textual's widget system)
Bug #1: DataTable Drama Initially tried to use Textual's DataTable widget for displaying and editing variables. Spent 45 minutes reading docs before realizing DataTable doesn't support inline editing. You can select cells, but can't edit them directly. Switched to individual Input widgets and it worked immediately.
Bug #2: The 303 Line Problem First version was 303 lines. Over the 300 line limit by 3 lines. Had to strip out docstrings and merge some imports. Down to 297 lines. Rule is the rule.
Bug #3: Quote Handling
Forgot that .env files often use quotes for values with spaces. First version stripped ALL quotes, which broke values like NAME="John Doe". Had to add logic to only remove matched quotes and preserve the spaces inside.
Bug #4: CSS Typo Hell
Spent 20 minutes debugging why my CSS wasn't applying to the variable rows. Turns out I had class="var-row" in the widget but .variable-row in the CSS. Classic typo. Changed CSS to .var-row and boom, styled.
What I Learned:
- Read the widget docs THOROUGHLY before committing to one
- Test with real .env files that have edge cases
- CSS typos are always the problem
- 300 lines is tighter than you think
Because opening your editor just to change DEBUG=True to DEBUG=False is ridiculous. Now you can manage all your environment variables from one place.
Perfect for:
- Switching between dev/prod settings
- Managing API keys across projects
- Checking what variables each project uses
- Quick edits without context switching