{"id":24860819,"url":"https://github.com/kawana77b/univenv","last_synced_at":"2026-05-04T03:35:26.512Z","repository":{"id":244673903,"uuid":"815911613","full_name":"kawana77b/univenv","owner":"kawana77b","description":"univenv is a tool for universal shell platforms that allows you to output your yaml as bash, fish or powershell.","archived":false,"fork":false,"pushed_at":"2026-04-01T19:11:27.000Z","size":93,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-04T17:29:09.397Z","etag":null,"topics":["shell"],"latest_commit_sha":null,"homepage":"","language":"Go","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/kawana77b.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}},"created_at":"2024-06-16T14:02:03.000Z","updated_at":"2026-03-08T12:06:31.000Z","dependencies_parsed_at":"2024-06-16T17:23:57.428Z","dependency_job_id":"8fafa551-4dd8-4ee4-89c9-528bc898fbe4","html_url":"https://github.com/kawana77b/univenv","commit_stats":null,"previous_names":["kawana77b/univenv"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/kawana77b/univenv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kawana77b%2Funivenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kawana77b%2Funivenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kawana77b%2Funivenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kawana77b%2Funivenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kawana77b","download_url":"https://codeload.github.com/kawana77b/univenv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kawana77b%2Funivenv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32593945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"online","status_checked_at":"2026-05-04T02:00:06.625Z","response_time":58,"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":["shell"],"created_at":"2025-01-31T21:48:22.731Z","updated_at":"2026-05-04T03:35:26.479Z","avatar_url":"https://github.com/kawana77b.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# univenv\n\n## Description\n\n`univenv` is a tool for universal shell platforms that allows you to output your `yml` as `bash`, `fish` or `powershell`.\n\n- Managed in a common `yml` to absorb OS and shell differences\n- Multiple `yml` files can be managed and read as you wish\n- Conditioning of OS, commands and shells.\n- They will be reflected in the configuration order you wrote them in\n- Run in a shell configuration file, which you can load whenever you want to start working with it\n\n## Motivation\n\nEach shell has its own syntax.\nIf you can work only with your favorite shell, no problem, but if you work in many different places, you have to consider the differences between operating systems and shells.\nFor example, if you are suddenly faced with a new environment, be it Windows or Mac, it will fluctuate, and there will be situations where you are comfortable with Bash but have to deal with it in PowerShell.\n\nDo I have to maintain my own `.bashrc`, `config.fish`, and `Profile.ps1` and translate and rewrite the `PATH` and `alias` in all of them? It was very complicated for me!\n\nThis tool does a simple language translation and makes it easy to accommodate each of them.\n\n## Install\n\nThis tool assumes Windows, Mac OS, and Linux as the operating system to be used.  \nBinaries are available on the [Release page](https://github.com/kawana77b/univenv/releases).\n\nIf you have a Go execution environment, the following is also available.\n\n```bash\ngo install github.com/kawana77b/univenv@latest\n```\n\n## Getting Started\n\nCreate folders and files.\n\n```bash\nmkdir -p ~/.config/univenv \u0026\u0026 touch ~/.config/univenv/config.yml\n```\n\nEdit File by Your Editor.\n\n```bash\nvim ~/.config/univenv/config.yml\n```\n\nPaste the following yaml.\n\n```yaml\nitems:\n  - type: alias\n    name: pip\n    value: pip3\n```\n\nLet's run it. The argument shell name can be `bash`, `fish`, or `pwsh`.\n\n```bash\nunivenv bash\n```\n\nIf you see the following, you have succeeded! Comments can also be hidden with `--no-comment/-n`.\n\n```bash\n# -------------------- Created By univenv --------------------\nalias pip='pip3'\n# -------------------- End Of Created By univenv --------------------\n```\n\nYou can check the default status at `univenv status`\n\n### Output script\n\nOutput and load the script as follows.\n\n```bash\nunivenv bash \u003e script.sh\n```\n\n### Specify a file\n\nTo change the referenced file:\n\n```bash\nunivenv bash --file ~/foo/baz/config.yml\n```\n\n### Called at shell startup\n\nIf you wish, this script can be set to run in the configuration file as is.\n\n#### bash\n\nAdd the following to `~/.bashrc`\n\n```bash\neval \"$(univenv bash)\"\n```\n\n#### fish\n\nAdd the following to `~/.config/fish/config.fish`\n\n```fish\nunivenv fish | source\n```\n\n#### powershell\n\nAdd the following to your `$PROFILE`\n\n```powershell\nInvoke-Expression (\u0026 {\n    (univenv pwsh | Out-String)\n})\n```\n\n## Configuration file location and target\n\n- Directory is the default, `~/.config/univenv`. This is common regardless of OS. However, you can change the directory to read by setting the environment variable `$UNIVENV_CONFIG_DIR` before using the tool.\n- The file name is fixed to `config.yml` unless you try to load it using the `--file/-f` option.\n- The `--target/-t` option allows you to switch which `yml` to use. That is, you can have more than one file to place in `~/.config/univenv`. For example, if you do not specify a target, it is `config.yml`, but if you do `--target homepc`, for example, it will try to read `config.homepc.yml`\n\n\u003e [!NOTE]\n\u003e In `pwsh`, if `~` is prefixed, the value is replaced by `$HOME`. Also, paths or commas are cleaned in some configurations.\n\u003e This is a specification.\n\n## Configuration\n\nYou can see concrete examples on the [Examples Page](https://github.com/kawana77b/univenv/tree/main/examples)\n\nThe definition of yml is as follows:\n\n```yaml\nitems:\n  - title: string # If specified, a comment will be added to this item. Also, a new line will be added above\n    type: env | path | alias | comment | source | raw | if-command | if-directory # Select the type of this item\n    name: string # Specify key names for environment variables and aliases\n    value: string # Various value. This is required\n    directory: string # Directory location. If specified, adds a script that checks if the location exists.\n    command: string # Command Name. If specified, adds a script that checks for the presence of the command.\n    shell: [bash | fish | pwsh] # If a shell name is specified, the script will be output only for the shell selected in the argument\n    os: [windows | darwin | linux] # If an OS name is specified, the script will be output only when the running OS corresponds to it.\n    lf: number # Add a line break with a description of 1 or more\n    disabled: bool # Specify with true to suppress output of this item\n    items: # Nests items when if-** is specified in type\n```\n\n### If Nested\n\n`type: if-command` etc. can create if-branches.\n\n```yaml\n- title: Docker\n  type: if-command\n  value: docker\n  items:\n    - type: alias\n      name: dc\n      value: docker compose\n    - type: alias\n      name: dcu\n      value: docker compose up\n```\n\n\u003e [!NOTE]\n\u003e Only one hierarchy can be nested.\n\n### Raw Script\n\nYou can add raw scripts by specifying `type: raw`.\n\n```yaml\nitems:\n  - title: test func\n    type: raw\n    value: |-\n      function foo {\n        echo \"foo\"\n      }\n    shell: [bash]\n```\n\n## NOTE\n\nBug reports, etc. can be sent to Issue. I would be very happy to receive your feedback or a star if you like it!  \nDue to my current circumstances, I may not be able to answer pull requests or other replies. Please use the fork. However, I would be happy to see some sort of indication that I am the original author.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkawana77b%2Funivenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkawana77b%2Funivenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkawana77b%2Funivenv/lists"}