{"id":20162587,"url":"https://github.com/zdharma-continuum/zinit-annex-bin-gem-node","last_synced_at":"2025-06-26T08:03:40.031Z","repository":{"id":39901415,"uuid":"423393550","full_name":"zdharma-continuum/zinit-annex-bin-gem-node","owner":"zdharma-continuum","description":"Unmaintained mirror of zinit-zsh/z-a-bin-gem-node","archived":false,"fork":false,"pushed_at":"2025-02-15T14:17:33.000Z","size":243,"stargazers_count":7,"open_issues_count":8,"forks_count":12,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T00:36:48.160Z","etag":null,"topics":["zinit","zinit-annex","zsh"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zdharma-continuum.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":"2021-11-01T08:40:03.000Z","updated_at":"2025-02-15T14:17:37.000Z","dependencies_parsed_at":"2023-12-01T02:26:13.635Z","dependency_job_id":"652a5873-4fc4-4adb-8947-94a9ffcda71b","html_url":"https://github.com/zdharma-continuum/zinit-annex-bin-gem-node","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zdharma-continuum/zinit-annex-bin-gem-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdharma-continuum%2Fzinit-annex-bin-gem-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdharma-continuum%2Fzinit-annex-bin-gem-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdharma-continuum%2Fzinit-annex-bin-gem-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdharma-continuum%2Fzinit-annex-bin-gem-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zdharma-continuum","download_url":"https://codeload.github.com/zdharma-continuum/zinit-annex-bin-gem-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdharma-continuum%2Fzinit-annex-bin-gem-node/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262026904,"owners_count":23246951,"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":["zinit","zinit-annex","zsh"],"created_at":"2024-11-14T00:25:50.625Z","updated_at":"2025-06-26T08:03:40.004Z","avatar_url":"https://github.com/zdharma-continuum.png","language":"Shell","funding_links":[],"categories":["Plugins"],"sub_categories":["ZSH on Windows"],"readme":"# zinit-annex-bin-gem-node\u003ca name=\"zinit-annex-bin-gem-node\"\u003e\u003c/a\u003e\n\n\u003c!-- mdformat-toc start --slug=github --maxlevel=3 --minlevel=2 --\u003e\n\n- [Installation](#installation)\n- [How it works](#how-it-works)\n- [Ices](#ices)\n  - [sbin](#sbin)\n    - [Usage](#usage)\n    - [Example](#sbin-example)\n    - [Bypass parsing RC config files](#sbin-bypass-rc)\n    - [sbin vs. lbin](#sbin-vs-lbin)\n  - [fbin](#fbin)\n  - [gem](#gem)\n  - [node](#node)\n  - [pip](#pip)\n  - [fmod](#fmod)\n  - [fsrc](#fsrc)\n- [shim-list](#shim-list)\n- [Cygwin Support](#cygwin-support)\n  - [Example](#example-6)\n\n\u003c!-- mdformat-toc end --\u003e\n\nA Zsh-Zinit annex (i.e., an extension) that provides functionality that allows to:\n\n1. Run programs and scripts without adding anything to `$PATH`,\n1. Install and run Ruby [gems](https://github.com/rubygems/rubygems), [Node](https://github.com/npm/cli) and\n   [Python](https://python.org) modules from within a local directory with\n   [$GEM_HOME](https://guides.rubygems.org/command-reference/#gem-environment) ,\n   [$NODE_PATH](https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders) and\n   [$VIRTUALENV](https://docs.python.org/3/tutorial/venv.html) automatically set,\n1. Run programs, scripts, and functions with automatic `cd` into the plugin or snippet directory, plus also with\n   automatic standard output \u0026 standard error redirecting.\n1. Source scripts through an automatically created function with the above `$GEM_HOME`, `$NODE_PATH`, `$VIRTUALENV` and\n   `cd` features available,\n1. Create the so-called `shims` known from [rbenv](https://github.com/rbenv/rbenv) – the same feature as the first item\n   of this enumeration – of running a program without adding anything to `$PATH` with all of the above features, however\n   through an automatic **script** created in `$ZPFX/bin`, not a **function** (the first item uses a function-based\n   mechanism),\n1. Automatic updates of Ruby gems and Node modules during regular plugin and snippet updates with `zinit update …`.\n\n## Installation\u003ca name=\"installation\"\u003e\u003c/a\u003e\n\nLoad like a regular plugin, i.e.:\n\n```zsh\nzinit light zdharma-continuum/zinit-annex-bin-gem-node\n```\n\nAfter executing this command, you can use the new ice mods provided by the annex.\n\n\n## How it works\u003ca name=\"how-it-works\"\u003e\u003c/a\u003e\n**Note:** The README is somewhat outdated – the `sbin''` ice that creates forwarder scripts (shim) instead of\nforwarder-functions (created by the `fbin''` ice and elaborated in this `How it works …` section) turned out to be the\nproper, best method for exposing binary programs and scripts. You can jump to the `sbin''` ice\n[section](#5-sbingncneopath-to-binary---name-of-the-script-) if you want or read on, as the forwarder-scripts are pretty\nsimilar to the forwarder-functions elaborated on in the following text:\n\nBelow is a diagram explaining the major feature – exposing a binary program or script through a Zsh function of the same\nname:\n\n![diagram](https://raw.githubusercontent.com/zdharma-continuum/zinit-annex-bin-gem-node/main/images/diag.png)\n\nThis way, there is no need to add anything to `$PATH` – `zinit-annex-bin-gem-node` will automatically create a function\nthat will wrap the binary and provide it on the command line as if it was being placed in the `$PATH`.\n\nAlso, as mentioned in the enumeration, the function can automatically export `$GEM_HOME`, `$NODE_PATH`, `$VIRTUALENV`\nshell variables and also automatically cd into the plugin or snippet directory right before executing the binary and\nthen cd back to the original directory after the execution is finished.\n\nAlso, as already mentioned, instead of the function, an automatically created script – so-called `shim` – can be used\nfor the same purpose and with the same functionality so that the command is accessible practically fully and normally –\nnot only in the live Zsh session (only within which the functions created by `fbin''` exist) but also from any Zsh\nscript.\n\nSuppose that you want to install the `junegunn/fzf-bin` plugin from GitHub Releases, which contains only a single file –\nthe `fzf` binary for the selected architecture. It is possible to do it in the standard way – by adding the plugin's\ndirectory to the `$PATH`:\n\n```zsh\nzinit ice as\"command\" from\"github-rel\"\nzinit load junegunn/fzf-bin\n```\n\nAfter this command, the `$PATH` variable will contain e.g.:\n\n```zsh\n% print $PATH\n/home/sg/.zinit/plugins/junegunn---fzf-bin:/bin:/usr/bin:/usr/sbin:/sbin\n```\n\nFor many such programs loaded as plugins, the PATH can become quite cluttered. I've had 26 entries before switching to\n`zinit-annex-bin-gem-node`. To solve this, load with the use of `sbin''` ice provided and handled by\n`zinit-annex-bin-gem-node`:\n\n```zsh\nzinit ice from\"gh-r\" sbin\"fzf\"\nzinit load junegunn/fzf-bin\n```\n\nThe `$PATH` will remain unchanged, and a `fzf` forwarder-script, so-called *shim*, will be created in `$ZPFX/bin`\n(`~/.zinit/polaris/bin` by default), which is already being added to the `$PATH` by Zinit when it is being sourced:\n\n```zsh\n% cat $ZPFX/bin/fzf\n#!/usr/bin/env zsh\n\nfunction fzf {\n    local bindir=\"/home/sg/.zinit/plugins/junegunn---fzf-bin\"\n    \"$bindir\"/\"fzf\" \"$@\"\n}\n\nfzf \"$@\"\n```\n\nRunning the script will forward the call to the program accessed through an embedded path to it. Thus, no `$PATH`\nchanges are needed!\n\n### sbin\u003ca name=\"sbin\"\u003e\u003c/a\u003e\n\n#### Usage\u003ca name=\"usage\"\u003e\u003c/a\u003e\n\n```zsh\nsbin'[{g|n|c|N|E|O}:]{path-to-binary}[ -\u003e {name-of-the-script}];' \n```\n\nIt creates the so-called `shim` known from `rbenv` – a wrapper script that forwards the call to the actual binary. The\nscript is always created under the same standard and single `$PATH` entry: `$ZPFX/bin` (which is `~/.zinit/polaris/bin`\nby default).\n\nThe flags have the same meaning as with `fbin''` ice.\n\n#### Example\u003ca name=\"sbin-example\"\u003e\u003c/a\u003e\n\n```zsh\n% zinit delete junegunn/fzf-bin\nDelete /home/sg/.zinit/plugins/junegunn---fzf-bin?\n[yY/n…]\ny\nDone (action executed, exit code: 0)\n% zinit ice from\"gh-r\" sbin\"fzf\"\n% zinit load junegunn/fzf-bin\n…installation messages…\n% cat $ZPFX/bin/fzf\n#!/usr/bin/env zsh\n\nfunction fzf {\n    local bindir=\"/home/sg/.zinit/plugins/junegunn---fzf-bin\"\n    \"$bindir\"/\"fzf\" \"$@\"\n}\n\nfzf \"$@\"\n```\n\nRunning the script will forward the call to the program accessed through an embedded path to it. Thus, no `$PATH`\nchanges are needed!\n\n---\n\n#### Empty `sbin` ICE\u003ca name=\"empty-sbin\"\u003e\u003c/a\u003e\n\n**The ice can be empty**. It will then try to create the shim for:\n\n- trailing component of the `id_as` ice, e.g., `id_as'exts/git-my'` → it'll check if a file `git-my` exists, and if yes,\n  create the shim `git-my`,\n- the plugin name, e.g., for `paulirish/git-open`, it'll check if a file `git-open` exists and if yes, create the shim\n  `git-open`,\n- trailing component of the snippet URL,\n- for any alphabetically first executable file.\n\n---\n\n#### Modifier `!` for `sbin` ICE\u003ca name=\"sbin-bypass-rc\"\u003e\u003c/a\u003e\n\nBy default, the generated shim uses the shebang `#!/usr/bin/env zsh`, which starts `zsh` with all user and system configuration files.\n\nWhen the `sbin` ICE is prefixed with `!`, the generated shim is instead created with:\n\n```zsh\n#!/usr/bin/env -S zsh -fd\n```\n\nThis starts `zsh` in **NO RCS mode**, which means that both `zshenv` and `zshrc` (local and global) are skipped. This can significantly **reduce startup time by 100-200ms**, as no unnecessary shell initialization occurs.\n\n**When to use `!`:**\n- Use `!` when launching a **command-line program** where startup speed is important.\n- Avoid `!` if the binary depends on configuration from `.zshrc` or `.zshenv`.\n- **Edge case:** If the shim is executed from an external GUI launcher (e.g., desktop icons), omitting `!` may be necessary to load expected shell environment variables.\n\n**Example usage:**\n\n```zsh\n% zinit ice from\"gh-r\" sbin\"!fzf\"\n% zinit load junegunn/fzf-bin\n```\n\nThe resulting shim will start with the shebang:\n\n```zsh\n#!/usr/bin/env -S zsh -fd\n```\n\n---\n\n#### When to Use `sbin` vs. `lbin`\u003ca name=\"sbin-vs-lbin\"\u003e\u003c/a\u003e\n\nFor simple binaries with no dependencies, `sbin` may not be necessary. Instead, a **symlink-based** approach can be used via the `lbin` ICE provided by the [`zinit-annex-binary-symlink`](https://github.com/zdharma-continuum/zinit-annex-binary-symlink) annex.\n\nIn practice, you can safely use `lbin` instead of `sbin` if:\n- The binary **does not** spawn subprocesses.\n- The binary **does not** require sourcing anything from the plugin directory.\n- The binary **does not** need to modify `$PATH`.\n\nRemember: the modifier `!` together with `lbin` creates a soft instead of a hard link.\n\nFor example:\n\n```zsh\nzinit ice from\"gh-r\" lbin'!bat(.exe|) -\u003e bat'\nzinit load @sharkdp/bat\n```\n\nThis method avoids unnecessary shims and simply links the binary into `$ZPFX/bin`, making it directly executable.\n\nIf your binary requires a proper execution environment (e.g., `$GEM_HOME`, `$NODE_PATH`, or `cd` to the plugin directory), use `sbin` instead.\n\n### fbin\u003ca name=\"fbin\"\u003e\u003c/a\u003e\n\n```\nfbin'[{g|n|c|N|E|O}:]{path-to-binary}[ -\u003e {name-of-the-function}]; …' \n```\n\nCreates a wrapper function of the name the same as the last segment of the path or as `{name-of-the-function}`. The\noptional preceding flags mean:\n\n- `g` – set `$GEM_HOME` variable to `{plugin-dir}`,\n- `n` – set `$NODE_PATH` variable to `{plugin-dir}/node_modules`,\n- `p` – set `$VIRTUALENV` variable to `{plugin-dir}/venv`,\n- `c` – cd to the plugin's directory before running the program and then cd back after it has been run,\n- `N` – append `\u0026\u003e/dev/null` to the call of the binary, i.e. redirect both standard output and standard error to\n  `/dev/null`,\n- `E` – append `2\u003e/dev/null` to the call of the binary, i.e., redirect standard error to `/dev/null`,\n- `O` – append `\u003e/dev/null` to the call of the binary, i.e., redirect standard output to `/dev/null`.\n\n#### Example:\u003ca name=\"example\"\u003e\u003c/a\u003e\n\n```zsh\n% zinit ice from\"gh-r\" fbin\"g:fzf -\u003e myfzf\"\n% zinit load junegunn/fzf-bin\n% which myfzf\nmyfzf () {\n        local bindir=\"/home/sg/.zinit/plugins/junegunn---fzf-bin\"\n        local -x GEM_HOME=\"/home/sg/.zinit/plugins/junegunn---fzf-bin\"\n        \"$bindir\"/\"fzf\" \"$@\"\n}\n```\n\n**The ice can be empty**. It will then try to create the function for:\n\n- trailing component of the `id_as` ice, e.g., `id_as'exts/git-my'` → it'll check if a file `git-my` exists, and if yes,\n  create the function `git-my`,\n- the plugin name, e.g., for `paulirish/git-open`, it'll check if a file `git-open` exists and if yes, create the\n  function `git-open`,\n- trailing component of the snippet URL,\n- for any alphabetically first executable file.\n\n### gem\u003ca name=\"gem\"\u003e\u003c/a\u003e\n\n#### Usage\u003ca name=\"usage-1\"\u003e\u003c/a\u003e\n\n```\ngem'{gem-name};' \n```\n\n```\ngem\"[{path-to-binary} \u003c-] !{gem-name} [-\u003e {name-of-the-function}]; …\"\n```\n\nInstalls the gem of the name `{gem-name}` with `$GEM_HOME` set to the plugin's or snippet's directory. In other words,\nthe gem and its dependencies will be installed locally in that directory.\n\nIn the second form, it also creates a wrapper function identical to the one created with `fbin''` ice.\n\n#### Example\u003ca name=\"example-1\"\u003e\u003c/a\u003e\n\n```zsh\n% zinit ice gem'!asciidoctor'\n% zinit load zdharma-continuum/null\n% which asciidoctor\nasciidoctor () {\n        local bindir=\"/home/sg/.zinit/plugins/zdharma---null/bin\" \n        local -x GEM_HOME=\"/home/sg/.zinit/plugins/zdharma---null\" \n        \"$bindir\"/\"asciidoctor\" \"$@\"\n}\n```\n\n### node\u003ca name=\"node\"\u003e\u003c/a\u003e\n\n#### Usage\u003ca name=\"usage-2\"\u003e\u003c/a\u003e\n\n```\nnode'{node-module}; …'\n```\n\nnode'\\[{path-to-binary} \\\u003c-\\] !{node-module} \\[-\u003e {name-of-the-function}\\];\n\nInstalls the node module of name `{node-module}` inside the plugin's or snippet's directory.\n\nIn the second form it also creates a wrapper function identical to the one created with `fbin''` ice.\n\n#### Example\u003ca name=\"example-2\"\u003e\u003c/a\u003e\n\n```zsh\nzi for \\\n    as'null' \\\n    id-as'remark' \\\n    node'remark \u003c- !remark-cli -\u003e remark; remark-man' \\\n  @zdharma-continuum/null\n```\n\nVerify:\n\n```console\n$ type remark\nremark is a shell function\n\n$ which remark\nremark () {\n        local bindir=\"/Users/e109082/.local/share/zinit/plugins/remark/node_modules/.bin\"\n        local -x NODE_PATH=\"/Users/e109082/.local/share/zinit/plugins/remark\"/node_modules\n        local -xU PATH=\"/Users/e109082/.local/share/zinit/plugins/remark\"/node_modules/.bin:\"$bindir\":\"$PATH\"\n        \"$bindir\"/\"remark\" \"$@\"\n}\n\n$ remark --version\nremark: 14.0.3, remark-cli: 11.0.0\n```\n\nIn this case, the name of the binary program provided by the node module is different from its name, hence the second\nform with the `b \u003c- a -\u003e c` syntax has been used.\n\n### pip\u003ca name=\"pip\"\u003e\u003c/a\u003e\n\n#### Usage\u003ca name=\"usage-3\"\u003e\u003c/a\u003e\n\nInstall the Python package of the name `{pip-package}` inside a plugin or snippet directory.\n\n```zsh\npip'{pip-package}`\n```\n\nCreate a wrapper function identical to the one created with `fbin` ice.\n\n```zsh\npip'[{path-to-binary} \u003c-] !{pip-package} [-\u003e {name-of-the-function}]'\n```\n\n#### Example\u003ca name=\"example-3\"\u003e\u003c/a\u003e\n\n```zsh\nzi for \\\n    as'null' \\\n    id-as'ansible' \\\n    pip'ansible \u003c- !ansible -\u003e ansible; ansible-lint' \\\n  @zdharma-continuum/null\n```\n\nVerify:\n\n```console\n$ type ansible\nansible is a shell function\n\n$ which ansible\nansible () {\n        local bindir=\"/Users/e109082/.local/share/zinit/plugins/ansible/venv/bin\"\n        local -x VIRTUALENV=\"/Users/e109082/.local/share/zinit/plugins/ansible\"/venv\n        local -xU PATH=\"/Users/e109082/.local/share/zinit/plugins/ansible\"/venv/bin:\"$bindir\":\"$PATH\"\n        \"$bindir\"/\"ansible\" \"$@\"\n}\n\n$ ansible --version\nansible [core 2.15.4]\n  config file = None\n  configured module search path = ['/Users/e109082/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']\n  ansible python module location = /Users/e109082/.local/share/zinit/plugins/ansible/venv/lib/python3.9/site-packages/ansible\n  ansible collection location = /Users/e109082/.ansible/collections:/usr/share/ansible/collections\n  executable location = /Users/e109082/.local/share/zinit/plugins/ansible/venv/bin/ansible\n  python version = 3.9.6 (default, Aug 12, 2023, 04:13:21) [Clang 15.0.0 (clang-1500.0.40.1)] (/Users/e109082/.local/share/zinit/plugins/ansible/venv/bin/python3)\n  jinja version = 3.1.2\n  libyaml = True\n```\n\nIn this case, the name of the binary program provided by the pip package is different from its name,; the second form\nwith the `b \u003c- a -\u003e c` syntax has been used.\n\n### fmod\u003ca name=\"fmod\"\u003e\u003c/a\u003e\n\n#### Usage\u003ca name=\"usage-4\"\u003e\u003c/a\u003e\n\nThe meaning of the `g`,`n`, and `c` flags is the same as in the `fbin''` ice.\n\n```zsh\nfmod'[{g|n|c|N|E|O}:]{function-name}'\n```\n\nYou can wrap the given function with the ability to set `$GEM_HOME`.\n\n```\nfmod'[{g|n|c|N|E|O}:]{function-name} -\u003e {wrapping-function-name}'\n```\n\n#### Example\u003ca name=\"example-4\"\u003e\u003c/a\u003e\n\n```zsh\nfoobar(){ +zi-log -n '{m} foobar function -\u003e '; pwd; }\nzi for \\\n    as'null' \\\n    fmod'cgn:foobar' \\\n    id-as'fmod-demo' \\\n  @zdharma-continuum/null\n```\n\nVerify:\n\n```console\n$ foobar\n==\u003e foobar function -\u003e /Users/e109082/.local/share/zinit/plugins/fmod-demo\n```\n\n```console\n$ which foobar\nfoobar () {\n    local -x GEM_HOME=\"/Users/e109082/.local/share/zinit/plugins/fmod-demo\"\n    local -x NODE_PATH=\"/Users/e109082/.local/share/zinit/plugins/fmod-demo\"/node_modules\n    local oldpwd=\"/Users/e109082/.local/share/zinit/plugins/zdharma-continuum---zinit-annex-bin-gem-node\"\n    () {\n        setopt localoptions noautopushd\n        builtin cd -q \"/Users/e109082/.local/share/zinit/plugins/fmod-demo\"\n    }\n    \"foobar--za-bgn-orig\" \"$@\"\n    () {\n        setopt localoptions noautopushd\n        builtin cd -q \"$oldpwd\"\n    }\n}\n```\n\n### fsrc\u003ca name=\"fsrc\"\u003e\u003c/a\u003e\n\n#### Usage\u003ca name=\"usage-5\"\u003e\u003c/a\u003e\n\n```\nfsrc'\\[{g|n|c|N|E|O}:\\]{path-to-script}\\[ -\u003e {name-of-the-function}\\];'\n```\n\n```\nferc'[{g|n|c|N|E|O}:]{path-to-script}[ -\u003e {name-of-the-function}]; …'\n```\n\nCreates a wrapper function that, at each invocation, sources the given file. The second ice, `ferc''` works the same\nwith the single difference that it uses `eval \"$(\u003c{path-to-script})\"` instead of `source \"{path-to-script}\"` to load the\nscript.\n\n#### Example\u003ca name=\"example-5\"\u003e\u003c/a\u003e\n\nCreate a sample script:\n\n```zsh\ncat \u003c\u003c 'EOF' \u003e foo-script\n+zi-log \"I am ${0} running in ${PWD}\"\nEOF\n```\n\nTest `bar-func` is not currently defined.\n\n```console\n$ type bar-func\nbar-func not found\n```\n\nDefine `bar-func` with `ferc` ice:\n\n```zsh\nzinit for \\\n    id-as'fsrc-demo' \\\n    fsrc\"$PWD/foo-script -\u003e bar-func\" \\\n    ferc\"$PWD/foo-script\" \\\n    as'null' \\\n  @zdharma-continuum/null\n```\n\nTest `bar-func` is now defined and run it\n\n```console\n$ type bar-func\nbar-func is a shell function\n\n$ bar-func\nI am /Users/e109082/foo-script running in /Users/e109082\n```\n\nThe contents of `bar-func`\n\n```console\n$ which bar-func\nbar-func () {\n        local bindir=\"/Users/e109082\"\n        local -xU PATH=\"$bindir\":\"$PATH\"\n        () {\n                source \"$bindir\"/\"foo-script\"\n        } \"$@\"\n}\n```\n\n**The ices can be empty**. They will then try to create the function for the trailing component of the `id-as` ice and\nthe other cases, in the same way as with the `fbin` ice.\n\n## shim-list\u003ca name=\"shim-list\"\u003e\u003c/a\u003e\n\nThere's an additional Zinit command that's provided by this annex –`shim-list`. It searches for and displays any shims\nthat are currently being stored under `$ZPFX/bin`. Example invocation:\n\n![shim-list invocation](https://raw.githubusercontent.com/zdharma-continuum/zinit-annex-bin-gem-node/main/images/shim-list.png)\n\nAvailable options are:\n\n| Option           | Description                                                                                                                                                                                                                                                                                                                                                     |\n| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `-c/--cat`       | displays the contents of each of the found shim (unimplemented yet).                                                                                                                                                                                                                                                                                            |\n| `-h/--help`      | shows a usage information                                                                                                                                                                                                                                                                                                                                       |\n| `-i/--from-ices` | normally, the code looks for the shim files by examining their contents (shims created by BGN annex have a fixed structure); this option instructs Zinit to show the list of shims that result from the `sbin''` ice of the loaded plugins; i.e., if a plugin has `sbin'git-open'`, for example, then this means that there has to be such shim already created |\n| `-o/--one-line`  | display the list of shim files without line breaks, in a single line, after spaces                                                                                                                                                                                                                                                                              |\n| `-s/--short`     | don't show the plugin/snippet that the shim belongs to,                                                                                                                                                                                                                                                                                                         |\n| `-t/--this-dir`  | instructs Zinit to look for shims in the current directory instead of `$ZPFX/bin`,                                                                                                                                                                                                                                                                              |\n\n## Cygwin Support\u003ca name=\"cygwin-support\"\u003e\u003c/a\u003e\n\nThe `sbin''` ice has an explicit Cygwin support – it creates additional, **extra shim files** – Windows batch scripts\nthat allow running the shielded applications from, e.g., Windows run dialog – if the `~/.zinit/polaris/bin` directory is\nbeing added to the Windows `PATH` environment variable, for example (it is a good idea to do so, IMHO). The Windows\nshims have the same name as the standard ones (which are also being created, normally), plus the `.cmd` extension.\n\n### Example\u003ca name=\"example-6\"\u003e\u003c/a\u003e\n\n```zsh\nzinit pack=bgn for firefox\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzdharma-continuum%2Fzinit-annex-bin-gem-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzdharma-continuum%2Fzinit-annex-bin-gem-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzdharma-continuum%2Fzinit-annex-bin-gem-node/lists"}