{"id":22927686,"url":"https://github.com/shirajshrestha/env_reader","last_synced_at":"2025-04-01T15:44:00.756Z","repository":{"id":267500691,"uuid":"900638431","full_name":"ShirajShrestha/env_reader","owner":"ShirajShrestha","description":"A gem to manage env variables easily. Find and validate the variables easily","archived":false,"fork":false,"pushed_at":"2024-12-10T17:17:34.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T10:15:50.418Z","etag":null,"topics":["gem","rails","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/ShirajShrestha.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-09T07:36:18.000Z","updated_at":"2024-12-10T17:20:15.000Z","dependencies_parsed_at":"2024-12-10T18:41:45.951Z","dependency_job_id":"5835beb1-1344-4302-bab1-72a76bc2ffb6","html_url":"https://github.com/ShirajShrestha/env_reader","commit_stats":null,"previous_names":["shirajshrestha/env_reader"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShirajShrestha%2Fenv_reader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShirajShrestha%2Fenv_reader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShirajShrestha%2Fenv_reader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShirajShrestha%2Fenv_reader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShirajShrestha","download_url":"https://codeload.github.com/ShirajShrestha/env_reader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246667096,"owners_count":20814655,"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":["gem","rails","ruby"],"created_at":"2024-12-14T09:15:35.173Z","updated_at":"2025-04-01T15:44:00.734Z","avatar_url":"https://github.com/ShirajShrestha.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EnvReader\n\nThe EnvReader gem is a utility to manage and validate environment variables used in your project. It helps in reading, finding and validating the environment variables used in your project.\n\n## Installation\n\nAdd the gem to your `Gemfile`:\n\n```Gemfile\ngem 'env_reader'\n```\n\nRun `bundle install`\n\n```bash\nbundle install\n```\n\nOR\n\nYou can directly add it using `bundle add`\n\n```bash\nbundle add env_reader\n```\n\n## Usage\n\nThe gem offers several features through its Command-Line Interface (CLI). You can use the commands listed below to find, read, and validate environment keys.\n\n- ### CLI Commands\n\nRun the script using one of the following options:\n\n| Command                       | Description                                             |\n| ----------------------------- | ------------------------------------------------------- |\n| `-r, --read-keys [DIRECTORY]` | List all the environment keys used in a directory.      |\n| `-f, --find-keys [DIRECTORY]` | Find all files and display their environment key usage. |\n| `-v, --validate-keys`         | Validate environment keys and check for missing values. |\n| `-e, --extensions x,y,z`      | Specify file extensions to scan (default: rb, erb).     |\n| `-h, --help`                  | Display help for the available commands.                |\n\n### Directly using in a rails directory\n\n1. **Without passing directory and extensions**\n\n   - List all the env variables used in the app\n     ```bash\n     env_reader -r\n     ```\n   - Find the files where the variables are used\n     ```\n     env_reader -f\n     ```\n   - Check if the env variables are set or missing and shows if valid or not\n     ```\n     env_reader -v\n     ```\n\n2. **By passing directory and extension**\n\n   ```bash\n   env_reader -f /path/to/directory -e rb, erb\n   ```\n\n   You can exclude either one or both directory or extension if not necessary. Additionally you can also use other commands to read, find and validate the keys.\n\n3. **Optional Keys**\n\n   Some keys are optional and may not need validation (e.g., CI, RAILS_ENV). You can modify the list of optional keys in the `optional_keys` method:\n\n   To add custom optional keys during validation:\n\n   ```\n   env_reader -v --optional-keys MY_CUSTOM_KEY,ANOTHER_KEY\n   ```\n\n4. **Help Menu**\n   Run the `-h` or `--help` option to see the available commands.\n   ```\n   env_reader -h\n   ```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/ShirajShrestha/env_reader\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshirajshrestha%2Fenv_reader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshirajshrestha%2Fenv_reader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshirajshrestha%2Fenv_reader/lists"}