{"id":13529825,"url":"https://github.com/janitha/zenv","last_synced_at":"2025-04-01T17:31:11.772Z","repository":{"id":248034349,"uuid":"827543239","full_name":"janitha/zenv","owner":"janitha","description":"Shell utility designed to create isolated working environments. It allows you to run arbitrary commands and set environment variables to configure your workspace effortlessly.","archived":false,"fork":false,"pushed_at":"2024-08-22T16:25:02.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-22T18:47:58.851Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","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/janitha.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}},"created_at":"2024-07-11T21:27:19.000Z","updated_at":"2024-08-22T16:25:06.000Z","dependencies_parsed_at":"2024-08-22T18:18:18.340Z","dependency_job_id":"c50d2fb0-c691-4ed0-a2c7-a57343dcb20a","html_url":"https://github.com/janitha/zenv","commit_stats":null,"previous_names":["janitha/zenv"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janitha%2Fzenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janitha%2Fzenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janitha%2Fzenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janitha%2Fzenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janitha","download_url":"https://codeload.github.com/janitha/zenv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222748159,"owners_count":17031897,"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":[],"created_at":"2024-08-01T07:00:39.711Z","updated_at":"2024-11-02T16:31:17.294Z","avatar_url":"https://github.com/janitha.png","language":"Shell","readme":"# Zenv\n\n`zenv` is a shell extension designed to create isolated working environments. It allows you to run arbitrary commands and set environment variables to configure your workspace effortlessly.\n\nIsolation is achieved by creating a new subshell when entering a zenv-aware directory or workspace, preserving the original environment. This approach differentiates `zenv` from tools like `dotenv` and `autoenv`\n\n## Prerequisites\n\n- Zsh\n\n# Usage\n\nTo mark a directory as a zenv environment, create a .zenv file in that directory. This file will be sourced within the context of the new subshell.\n\nExample `.zenv. file\n\n```sh\n# Set enviornment variables\nexport MY_APP_KEY=value\n# Run commands\nsource .venv/bin/activate\n```\n\n## Activating\n\nTo enter a zenv-aware workspace, `zenv` must be activated explicitly.\n\n```\n[user@host ~]% zenv ~/foo/bar\n\u003e\u003e\u003e Entered a state of Zenv: /home/user/foo/bar \u003e\u003e\u003e\n\n[user@host (bar)](ž)(main±)% cd cat/dog\n[user@host (bar)/cat/dog](ž)(main±)%\n```\n\n## Deactivating\n\nTo leave the zenv-aware directory:\n\n```\n[user@host (bar)](ž)(main±)% exit\n\u003c\u003c\u003c Exited a state of Zenv: /Users/janitha/dotfiles \u003c\u003c\u003c\n\n[user@host ~]%\n```\n\n## Misc\n\nOnce zenv is activated on a directory, the root name of the directory will be cached as a shortcut, which can be used in subsequent invocations as a shorthand.\n\n```\n[user@host ~]% zenv ~/xxx/yyy/zzz\n[user@host (zzz)](ž)(main±)% exit\n\n[user@host ~]% zenv zzz\n[user@host (zzz)](ž)(main±)% exit\n```\n\nBy default, the name of the zenv-aware enviornment is the base most directory. However it can be overriden by specifying a `ZENV_NAME` in the `.zenv` file. This will also be used as the shortcut name.\n\n# Prompt Integration\n\n## Oh-My-Zsh like Prompts\n\nUse the `_zenv_prompt_info` in the prompt theme.\n\n## Zen-prompt\n\nPrompt hooks will automatically be added to the zen-prompt. A marker `(ž)` will denote that the zenv is active, with multiple markers indicating deeper levels of nesting. Additionally, the directory path will be substituted with the zenv environment path.\n","funding_links":[],"categories":["Plugins","Recently Updated"],"sub_categories":["ZSH on Windows","[Jul 14, 2024](/content/2024/07/14/README.md)"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanitha%2Fzenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanitha%2Fzenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanitha%2Fzenv/lists"}