{"id":24306598,"url":"https://github.com/therealfredp3d/evironmentmastermanager","last_synced_at":"2025-03-06T18:17:43.048Z","repository":{"id":270392973,"uuid":"910176119","full_name":"TheRealFREDP3D/EvironmentMasterManager","owner":"TheRealFREDP3D","description":".env MasterManager is a command-line tool designed to manage environment variables stored in .env files. It provides a user-friendly interface for editing, adding, deleting, and saving environment variables directly from the terminal.","archived":false,"fork":false,"pushed_at":"2024-12-30T21:22:59.000Z","size":368,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-17T03:38:21.340Z","etag":null,"topics":["api-keys","cli","env","environment-variables","python","rich"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheRealFREDP3D.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-30T17:19:22.000Z","updated_at":"2024-12-30T21:23:02.000Z","dependencies_parsed_at":"2024-12-30T20:30:13.387Z","dependency_job_id":"8c2c2f2c-e13a-4915-abe2-ed597b4f6958","html_url":"https://github.com/TheRealFREDP3D/EvironmentMasterManager","commit_stats":null,"previous_names":["therealfredp3d/evironmentmastermanager"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheRealFREDP3D%2FEvironmentMasterManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheRealFREDP3D%2FEvironmentMasterManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheRealFREDP3D%2FEvironmentMasterManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheRealFREDP3D%2FEvironmentMasterManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheRealFREDP3D","download_url":"https://codeload.github.com/TheRealFREDP3D/EvironmentMasterManager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242259922,"owners_count":20098429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-keys","cli","env","environment-variables","python","rich"],"created_at":"2025-01-17T03:37:43.227Z","updated_at":"2025-03-06T18:17:43.026Z","avatar_url":"https://github.com/TheRealFREDP3D.png","language":"Python","readme":"# README.md\n\n![Header](header.jpg)\n\n---\n\n## [.env] Environment Master Manager\n\n### Overview\n\n**.env MasterManager** is a command-line tool designed to manage environment variables stored in `.env` files. It provides a user-friendly interface for editing, adding, deleting, and saving environment variables directly from the terminal.\n\nI made this because while testing which LLM model model worked the best for a project, I find myself opening .env file\nbefore nearly each program run, to verify my settings where right, no API key was missing. Quit the text editor and \nexecuted the main program.  \n\nThis is a shortcut. `manager.py` loads the .env file, sort the list of entry, remove empty lines, remove commentaries and  \ndisplay them. If no .env is found, create a new one from a template. Let you edit, add, delete and save your change (it makes a backup of the current .env file before applying the changes if you want to go back). You can hit `Execute Main` to launch\nyour program using your new config. \n\nAll of this in a simple CLI screen.  \n\nI use this for all my scripts that are using a `.env` file. All you have to change is the filename of the main program in\nthe script and it is good to go.\n\n---\n\n## Flowchart\n\n```mermaid\nflowchart TD\n    A[Start] --\u003e B[Initialize Rich Console]  \n    B --\u003e C[Load Environment Variables]  \n    C --\u003e D{Environment File Exists?}  \n    D -- Yes --\u003e E[Read .env or .env.example]  \n    D -- No --\u003e F[Return Empty List]  \n    E --\u003e G[Process Lines]  \n    G --\u003e H{Line Valid?}  \n    H -- Yes --\u003e I[Add to Valid Lines]  \n    H -- No --\u003e J[Skip Line]  \n    I --\u003e G  \n    J --\u003e G  \n    G -.-\u003e K[End Processing Lines]\n    \n    K --\u003e L[Main Loop Start]\n    \n    L --\u003e M[Clear Screen]\n    M --\u003e N[Print Title and Table of Environment Variables]\n    \n    N --\u003e O{User Choice?}\n    \n    O -- Edit Line (1) --\u003e P(Edit Line)\n    P -.-\u003e Q(Show Feedback)\n    \n    O -- Add New Line (2) --\u003e R(Add New Line)\n    R -.-\u003e Q\n    \n    O -- Delete Line (3) --\u003e S(Delete Line)\n    S -.-\u003e Q\n    \n    O -- Save Changes (4) --\u003e T(Save Environment Variables)\n    \n    T -.-\u003e U(Show Feedback)\n    \n    U -.-\u003e V(Main Loop Start Again)\n    \n    O -- Execute main.py (5) --\u003e W(Execute main.py)\n    \n    W -.-\u003e X(Exit Script)\n    \n    O -- Exit (6) --\u003e Y(Exit Script)\n```\n\n---\n\n### Features\n- **Load .env File:** Automatically loads the `.env` file or falls back to `.env.example` if the primary file does not exist.\n- **Edit Lines:** Modify existing environment variable entries.\n- **Add New Lines:** Add new environment variable entries.\n- **Delete Lines:** Remove unwanted environment variable entries.\n- **Save Changes:** Save modifications to the `.env` file with automatic backup creation.\n- **Execute Script:** Run `main.py` after making changes.\n\n---\n\n### Installation\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/TheRealFREDP3D/EvironmentMasterManager.git\n   ```\n\n---\n\n2. Navigate to the project directory:\n\n   ```bash\n   cd EnvironmentMasterManager\n   ```\n\n---\n\n3. Install dependencies (Rich library):\n\n   ```bash\n   pip install rich\n   ```\n\n---\n\n### Usage\n\n#### Running .env MasterManager\n\n```bash\npython manager.py\n```\n\n---\n\n#### Main Menu Options\n\n1. **Edit Line:**\n   - Select this option to modify an existing environment variable entry by entering its line number and providing a new value.\n\n2. **Add New Line:**\n   - Choose this option to add a new environment variable entry by entering the full line (e.g., `API_KEY=your_api_key_here`).\n\n3. **Delete Line:**\n   - Use this option to remove an unwanted environment variable entry by specifying its line number.\n\n4. **Save Changes:**\n   - Save all your modifications to the `.env` file, creating a backup of the original file as `.env.bak`.\n\n5. **Execute main.py:**\n   - Run your main script (`main.py`) after making any necessary changes.\n\n6. **Exit:**\n   - Exit the program without saving any changes.\n\n---\n\n### Notes\n\n- The tool skips lines that are empty or start with specific characters such as spaces, comments (`#`), newlines (`\\n`), or tabs (`\\t`).\n- Error messages and feedback are displayed using Rich Console for better readability and styling.\n\n---\n\n### Authorship\n\n**Author:** Frederick Pellerin  \n**Email:** fredp3d@proton.me  \n**GitHub:** [TheRealFREDP3D](https://github.com/TheRealFREDP3D/)  \n**Twitter/X:** [@TheRealFredP3D](https://x.com/TheRealFredP3D/)\n\n---\n\nFeel free to contribute to or report issues on [GitHub](https://github.com/TheRealFREDP3D/EvironmentMasterManager).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftherealfredp3d%2Fevironmentmastermanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftherealfredp3d%2Fevironmentmastermanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftherealfredp3d%2Fevironmentmastermanager/lists"}