{"id":31077701,"url":"https://github.com/linkorb/envoi","last_synced_at":"2025-09-16T07:59:40.674Z","repository":{"id":62517383,"uuid":"175810247","full_name":"linkorb/envoi","owner":"linkorb","description":"Envoi: Environment variables on steroids","archived":false,"fork":false,"pushed_at":"2024-11-05T19:18:34.000Z","size":78,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-04T11:57:01.665Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://engineering.linkorb.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linkorb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-15T11:46:39.000Z","updated_at":"2024-11-05T19:18:38.000Z","dependencies_parsed_at":"2024-01-11T23:04:59.695Z","dependency_job_id":"dd8ba9c4-53db-4b8f-bb7d-12484298fa7f","html_url":"https://github.com/linkorb/envoi","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/linkorb/envoi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Fenvoi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Fenvoi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Fenvoi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Fenvoi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkorb","download_url":"https://codeload.github.com/linkorb/envoi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Fenvoi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275384112,"owners_count":25454910,"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","status":"online","status_checked_at":"2025-09-16T02:00:10.229Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-09-16T07:59:37.995Z","updated_at":"2025-09-16T07:59:40.660Z","avatar_url":"https://github.com/linkorb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- Managed by https://github.com/linkorb/repo-ansible. Manual changes will be overwritten. --\u003e\nenvoi\n============\n\nEnvoi aims to ease the use and documentation of environment variables (env\nvars) in PHP applications.\n\nEnvoi features:\n\n- a Yaml schema to describe the env vars that may be used to configure an\n  application\n\n- tools to validate env vars against a schema\n\n- a tool to assist in the population of a `.env` file\n\n- a tool which converts a schema to markdown\n\nEnvoi sports a console command which validates a `.env` file against a schema\n(by convention, `.env.yaml`).  It also provides checkers that, when invoked\nearly in the start-up phase of an application, will halt an application which\ndoesn't have a complete and valid set of env vars.\n\n\n\n### Install\n\n```shell\ncomposer require linkorb/envoi\n```\n\n\n### Use\n\n#### Env Checkers\n\nA checker should be invoked as early as possible in the life-cycle of an\napplication.  The ideal time is immediately after the environment has been\npopulated with env vars.  For example, in a Symfony-based app, the checker\nshould be invoked right after the Dotenv component has loaded the env vars from\nthe various `.env*` files:\n\n```php\n\u003c?php\n\n// config/bootstrap.php\n\nuse Envoi\\EnvChecker;\nuse Symfony\\Component\\Dotenv\\Dotenv;\n\nrequire dirname(__DIR__).'/vendor/autoload.php';\n\n(new Dotenv(false))-\u003eloadEnv(dirname(__DIR__).'/.env');\n// check the env!\n(new EnvChecker())-\u003echeck(dirname(__DIR__).'/.env.yaml');\n```\n\nThe checker will throw an exception to halt the application when invalid env\nvars are found.  The list of validation errors is included in the exception\nmessage.\n\n`EnvChecker` treats the environment as immutable: it validates env vars, but\ndoes not modify them.  `MutableEnvChecker` validates env vars and can also\ntransform values, making it the ideal checker when you want to take advantage\nof the various env var transformation features of Envoi.\n\n#### Interpolation\n\nAssign one variable based on another in `.env` file\n\n```shell\nFOO=\"foo\"\nBAR=\"{FOO}/logs\"\n```\n\nMetadata environment example `.env.yaml`\nSupports types: `int`, `string`, `url`, `path`\n\n```yaml\nFOO:\n  description: Used to configure foo system\n  type: url\n  default: \"https://username:password@example.com/bla\"\n  required: true\nQUX:\n  description: path to qux files\n  type: path\n  example: \"some example value\"\n  make-absolute-path: true  #  \"Expands  relative paths to absolute paths (i.e. ~/qux becomes /home/joe/qux)\nBAR:\n  description: Used for bar things\n  type: string\n  options: RED,GREEN,BLUE # validates that input is one of the available options\n```\n\nInit environment variables from `.env`\n\n```php\nEnvoi::init();\n$foo = getenv('FOO');\n```\n\n#### CLI\n\n```shell\n./vendor/bin/envoi\n```\n\nAvailable commands:\n\n`validate`   Validate based on meta file `.env.yaml`.\u003cbr/\u003e\n`configure`  CLI wizard to ask + update .env file based on `.env.yaml`.\u003cbr/\u003e\n`markdown`   Output a GitHub Flavored Markdown documentation for the available variables.\nLook for a `\u003c!-- envoi start --\u003e` and `\u003c!-- envoi end --\u003e` tags in file (default to README.md), and insert/update the generated markdown between those tags.\n\n\n### Run tests\n\n```shell\n./vendor/bin/phpunit\n```\n\n## Contributing\n\nWe welcome contributions to make this repository even better. Whether it's fixing a bug, adding a feature, or improving documentation, your help is highly appreciated. To get started, fork this repository then clone your fork.\n\nBe sure to familiarize yourself with LinkORB's [Contribution Guidelines](/CONTRIBUTING.md) for our standards around commits, branches, and pull requests, as well as our [code of conduct](/.github/CODE_OF_CONDUCT.md) before submitting any changes.\n\nIf you are unable to implement changes you like yourself, don't hesitate to open a new issue report so that we or others may take care of it.\n## Brought to you by the LinkORB Engineering team\n\n\u003cimg src=\"http://www.linkorb.com/d/meta/tier1/images/linkorbengineering-logo.png\" width=\"200px\" /\u003e\u003cbr /\u003e\nCheck out our other projects at [linkorb.com/engineering](http://www.linkorb.com/engineering).\nBy the way, we're hiring!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkorb%2Fenvoi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkorb%2Fenvoi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkorb%2Fenvoi/lists"}