{"id":13897587,"url":"https://github.com/numToStr/zenv","last_synced_at":"2025-07-17T14:32:21.754Z","repository":{"id":40577845,"uuid":"339110422","full_name":"numToStr/zenv","owner":"numToStr","description":"Dotenv (.env) loader written in rust 🦀","archived":false,"fork":false,"pushed_at":"2023-01-16T22:02:23.000Z","size":99,"stargazers_count":33,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-06T01:08:04.031Z","etag":null,"topics":["cli","config","crate","dotenv","env","environment","loader","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/numToStr.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}},"created_at":"2021-02-15T14:53:11.000Z","updated_at":"2024-10-21T00:16:42.000Z","dependencies_parsed_at":"2023-02-10T06:30:45.670Z","dependency_job_id":null,"html_url":"https://github.com/numToStr/zenv","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/numToStr/zenv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numToStr%2Fzenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numToStr%2Fzenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numToStr%2Fzenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numToStr%2Fzenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/numToStr","download_url":"https://codeload.github.com/numToStr/zenv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numToStr%2Fzenv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265616808,"owners_count":23798902,"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":["cli","config","crate","dotenv","env","environment","loader","rust"],"created_at":"2024-08-06T18:03:43.191Z","updated_at":"2025-07-17T14:32:21.465Z","avatar_url":"https://github.com/numToStr.png","language":"Rust","readme":"\u003ch1 align=\"center\"\u003e\n    \u003ccode\u003e.zenv\u003c/code\u003e\n\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\u003cb\u003eDotenv (.env) loader written in rust 🦀\u003c/b\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca aria-label=\"build\" href=\"https://github.com/numToStr/zenv/actions/workflows/build.yml\"\u003e\n    \u003cimg alt=\"build\" src=\"https://github.com/numToStr/zenv/actions/workflows/build.yml/badge.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"docs\" href=\"https://docs.rs/zenv\"\u003e\n    \u003cimg alt=\"docs\" src=\"https://docs.rs/zenv/badge.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"crates.io\" href=\"https://crates.io/crates/zenv\"\u003e\n    \u003cimg alt=\"crates.io\" src=\"https://img.shields.io/crates/v/zenv.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## ✨ Features\n\n- Fast as it is written in rust\n- Use as lib/crate or as a standalone cli\n- Support variable expansion\n\n## 🚀 Installation\n\n### Crate\n\nAdd [`zenv`](https://crates.io/crates/zenv) with a version of your choice in the `Cargo.toml`\n\n```toml\n[dependencies]\nzenv = \"\u003cversion\u003e\" # Make sure it's the latest version\n```\n\n### CLI\n\n- **Using `cargo`**\n\n```bash\ncargo install zenv --features=cli\n```\n\n- **Arch Linux**\n\n```bash\n# Using `yay`\nyay -S zenv\n\n# Using `pamac`\npamac build zenv\n```\n\n- **From binaries**\n\nCheck out the [Release page](https://github.com/numToStr/zenv/releases) for prebuild binaries for `zenv`, available for different operating systems.\n\n## 🤞 Usage\n\n### Crate\n\n```rust\nfn main() {\n    zenv::Zenv::new(\".env\", false).configure().ok();\n\n    // or use macro, which expands to above statement\n\n    zenv::zenv!()\n}\n```\n\n\u003e Read the full [documention](https:://docs.rs/zenv)\n\n### CLI\n\n```\nzenv\nDotenv (.env) loader written in rust\n\nUSAGE:\n    zenv [FLAGS] [OPTIONS] -- \u003ccommand\u003e [args]...\n\nFLAGS:\n    -v, --version       Prints version\n    -h, --help          Prints help information\n    -x, --expand        Enable variable expansion\n\nOPTIONS:\n    -f, --file          Path to .env file\n\nARGS:\n    \u003ccommand\u003e            Command that needs to be executed\n    [args]...           Arguments for the command\n\nExamples:\n    zenv -f .env -- node index.js\n    zenv -f .env -- npm run dev\n    zenv -f .env -- terraform apply\n```\n\n## 🙌 Good to Know\n\n### Basic\n\n```bash\nPORT=5000\nNODE_ENV=production\n\n# Single and double quotes are also supported\nS_QUOTE='single_quoted'\nD_QUOTE=\"double_quoted\"\n```\n\n### Comments\n\nComments can be added by using `#` character.\n\n```bash\n# COMMENTED=commented\nAT_THE_END=comment_at_the_end # I am here\n\n# If you want # in you value then wrap the value in single or double quotes\nQUOTED=\"quote_#_quoted\" # I'll be removed\n```\n\n### New Line and Escaping\n\nNew lines can added by new line (`\\n`) character and this only works if the values is surrounded by double quotes.\n\n```bash\nPRIVATE_KEY=\"-----BEGIN RSA PRIVATE KEY-----\\nadflhsdlfsjkldfjklsdjf\\n-----END RSA PRIVATE KEY-----\"\n\n# or like this\nPRIVATE_KEY=\"-----BEGIN RSA PRIVATE KEY-----\nadflhsdlfsjkldfjklsdjf\nasdffwejdjf983283lk\n-----END RSA PRIVATE KEY-----\"\n```\n\nIf you want to escape the new line character you can use the escape (`\\`)\n\n```bash\nESCAPED=\"escaped\\\\nnew\\\\nline\"\n```\n\n### Export and sourcing\n\nYou may also add export in front of each line so you can source the file in bash:\n\n```bash\nexport BASIC=BASIC\n```\n\n### Substitution\n\n`Zenv` also supports variable substitution (off by default) from the current file or from the operating system. Substitution only works if the values is double quoted ie.e `\"` and can be achieved by the following:\n\n- Using `${VAR}` pattern (recommended)\n- Starting the variable name by `$` character, which terminates after reaching a character which is not `_` or alphanumeric.\n\n```bash\nBASIC=basic\nEXPANDED='${BASIC}_expanded' # expands to 'basic_expanded'\n\n# System variables (assuming `PATH` is available)\nSYSTEM_VARIABLE=\"${PATH},/this/is/new/path\"\n```\n\n## 🙏 Credits\n\n- [motdotla/dotenv](https://github.com/motdotla/dotenv) (Javascript)\n- [joho/godotenv](https://github.com/joho/godotenv) (Golang)\n- [bkeepers/dotenv](https://github.com/bkeepers/dotenv) (Ruby)\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FnumToStr%2Fzenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FnumToStr%2Fzenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FnumToStr%2Fzenv/lists"}