{"id":13587333,"url":"https://github.com/mroth/evalcache","last_synced_at":"2025-08-25T15:08:10.936Z","repository":{"id":19864086,"uuid":"88092241","full_name":"mroth/evalcache","owner":"mroth","description":":hatching_chick: zsh plugin to cache eval loads to improve shell startup time","archived":false,"fork":false,"pushed_at":"2023-09-06T12:33:14.000Z","size":19,"stargazers_count":215,"open_issues_count":3,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-10T04:05:55.289Z","etag":null,"topics":["zsh","zsh-plugin"],"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/mroth.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}},"created_at":"2017-04-12T20:12:39.000Z","updated_at":"2025-04-01T13:01:02.000Z","dependencies_parsed_at":"2024-01-03T04:16:48.679Z","dependency_job_id":"7260b0a9-471b-4c7e-a673-85b4b796edd0","html_url":"https://github.com/mroth/evalcache","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mroth/evalcache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mroth%2Fevalcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mroth%2Fevalcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mroth%2Fevalcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mroth%2Fevalcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mroth","download_url":"https://codeload.github.com/mroth/evalcache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mroth%2Fevalcache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272084830,"owners_count":24870584,"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","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"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":["zsh","zsh-plugin"],"created_at":"2024-08-01T15:06:09.756Z","updated_at":"2025-08-25T15:08:10.905Z","avatar_url":"https://github.com/mroth.png","language":"Shell","readme":"# evalcache\n\n\u003e zsh plugin to cache the output of a binary initialization command, intended\n\u003e to help lower shell startup time.\n\n## What it does\n\nThere are lots of shell wrapper tools that follow the pattern of asking you to\neval a specific init command in your shell startup, for example, rbenv asks:\n\n    eval \"$(hub alias -s)\"\n\nWhile this is very convenient, the reality is there is a small amount of\noverhead associated with shelling out to this, and the output is almost always\nactually static in all of the tools I know. So why bear this cost every time\nyou open a new tab in your shell?\n\nInstead, after you load this plugin, you can replace that same command with:\n\n    _evalcache hub alias -s\n\nThe first time this runs, it will cache the output of the command to a file,\nwhich will be sourced in the future instead when it exists.\n\nIf you update a tool and expect for some reason that it's initialization might\nhave changed, you can simply clear the cache and it will be regenerated.\n\nIt also gracefully degrades to a no-op if the tool is no longer installed.\n\n## Benchmarks\n\nSome informal benchmarks from my MacBook on my .zshrc:\n\n| command      | without | first run | subsequent runs | savings |\n| ------------ | ------: | --------: | --------------: | ------: |\n| rbenv init   |   ~65ms |     ~65ms |            ~8ms |     88% |\n| hub alias    |   ~30ms |     ~30ms |            ~6ms |     80% |\n| scmpuff init |   ~24ms |     ~25ms |           ~10ms |     58% |\n\nThe difference isn't huge, but can be handy in shaving down shell startup time,\nespecially if you use a bunch of these tools. Every millisecond counts!\n\n## Options\n\n- `$ZSH_EVALCACHE_DIR`: cache files storage, default `$HOME/.zsh-evalcache`.\n- `$ZSH_EVALCACHE_DISABLE`: set to `true` if you wish to bypass evalcache.\n\nThere is a convenience function to clear the cache called `_evalcache_clear`.\n\n## Installation\n\n### [Antigen](https://github.com/zsh-users/antigen)\n\nAdd `antigen bundle mroth/evalcache` to your `.zshrc` with your other bundle commands.\n\nAntigen will handle cloning the plugin for you automatically the next time you start zsh. You can also add the plugin to a running zsh with `antigen bundle mroth/evalcache` for testing before adding it to your `.zshrc`.\n\n### [Fig](https://fig.io)\n\nFig adds apps, shortcuts, and autocomplete to your existing terminal.\n\nInstall `evalcache` in just one click.\n\n\u003ca href=\"https://fig.io/plugins/other/evalcache_mroth\" target=\"_blank\"\u003e\u003cimg src=\"https://fig.io/badges/install-with-fig.svg\" /\u003e\u003c/a\u003e\n\n### [Oh-My-Zsh](http://ohmyz.sh/)\n\n1. Clone this repository into `$ZSH_CUSTOM/plugins` (by default `~/.oh-my-zsh/custom/plugins`)\n\n   ```sh\n   git clone https://github.com/mroth/evalcache ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/evalcache\n   ```\n\n2. Edit `~/.zshrc` to add _evalcache_ to your plugin list,\n   ```diff\n   - plugins=(...)\n   + plugins=(... evalcache)\n   ```\n\n### [Zgen](https://github.com/tarjoilija/zgen)\n\nAdd `zgen load mroth/evalcache` to your `.zshrc` file in the same function you're doing your other `zgen load` calls in. Zgen will handle automatically cloning the plugin for you the next time you do a `zgen save`.\n","funding_links":[],"categories":["Plugins","Shell"],"sub_categories":["ZSH on Windows","Zinit (née zplugin)"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmroth%2Fevalcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmroth%2Fevalcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmroth%2Fevalcache/lists"}