{"id":43551228,"url":"https://github.com/canmi21/envflag","last_synced_at":"2026-02-06T22:00:40.080Z","repository":{"id":335727039,"uuid":"1146776036","full_name":"canmi21/envflag","owner":"canmi21","description":"A strict, zero-boilerplate env manager with dotenvy support and validation.","archived":false,"fork":false,"pushed_at":"2026-02-02T19:32:50.000Z","size":77,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-06T04:51:33.896Z","etag":null,"topics":["12-factor","config","env","filter","parser"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/envflag","language":"Rust","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/canmi21.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-31T16:58:23.000Z","updated_at":"2026-02-02T19:33:17.000Z","dependencies_parsed_at":"2026-02-04T20:04:01.139Z","dependency_job_id":null,"html_url":"https://github.com/canmi21/envflag","commit_stats":null,"previous_names":["canmi21/envflag"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/canmi21/envflag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canmi21%2Fenvflag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canmi21%2Fenvflag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canmi21%2Fenvflag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canmi21%2Fenvflag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/canmi21","download_url":"https://codeload.github.com/canmi21/envflag/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canmi21%2Fenvflag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29178535,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T20:14:21.878Z","status":"ssl_error","status_checked_at":"2026-02-06T20:14:21.443Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["12-factor","config","env","filter","parser"],"created_at":"2026-02-03T19:33:36.794Z","updated_at":"2026-02-06T22:00:40.022Z","avatar_url":"https://github.com/canmi21.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Envflag\n\nA strict, zero-boilerplate environment variable manager with `.env` support and validation.\n\n`envflag` enforces a disciplined approach to configuration: you must explicitly initialize the library (which loads `.env` files via `dotenvy`), and then query typed values through a validated builder API or simple convenience functions.\n\n## Features\n\n- **Strict Initialization**: All queries panic if `init()` has not been called — no silent misconfiguration.\n- **Dotenv Support**: Seamlessly loads `.env` files upon initialization, or from a custom path.\n- **Prefix Filtering**: Keep only environment variables matching configured prefixes (e.g. `APP_`, `SVC_`).\n- **Validated Builder API**: Chain `.default()`, `.validate()`, and `.get()` for type-safe, validated lookups that return `Result`.\n- **Built-in Validators**: `is_port`, `is_integer`, `is_positive_integer`, `is_positive_number`, `is_bool`, `is_non_empty`, `is_url`, `is_integer_in_range`, and more.\n- **Custom Validators**: Pass any `Fn(\u0026str) -\u003e bool` closure as a validator.\n- **Zero Boilerplate**: No built-in logging or printing; you control how to display your config.\n\n## Usage Examples\n\nCheck the `examples` directory for runnable code:\n\n- **Basic Usage**: [`examples/basic.rs`](examples/basic.rs) - Initialize and query with convenience API.\n- **Validation**: [`examples/validation.rs`](examples/validation.rs) - Chain validators on environment variables.\n- **Prefix Filtering**: [`examples/prefixes.rs`](examples/prefixes.rs) - Filter and scope variables by prefix.\n- **Custom Init**: [`examples/custom_init.rs`](examples/custom_init.rs) - Load from a specific `.env` file path.\n\n## Installation\n\n```toml\n[dependencies]\nenvflag = { version = \"0.1\", features = [\"full\"] }\n```\n\n## Feature Flags\n\n| Feature | Description |\n|---------|-------------|\n| `url` | Enables strict URL validation in `is_url` via the `url` crate (WHATWG URL Standard). |\n| `regex` | Enables `matches_regex` validator via `fancy-regex`. |\n| `tracing` | Enables optional `tracing::warn` on validation failures and parse fallbacks in convenience API. |\n| `full` | Enables all features above. |\n\n## License\n\nReleased under the MIT License © 2026 [Canmi](https://github.com/canmi21)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanmi21%2Fenvflag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcanmi21%2Fenvflag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanmi21%2Fenvflag/lists"}