Project
Command-line tool that pulls individual tools out of a monorepo into any project, with no submodules and no copy-paste
Everyone keeps a folder of useful scripts copied from project to project. Over time they drift: a fix lands in one place and nowhere else, and you lose track of which version is the good one.
grab solves this with one rule: the monorepo is the source of truth, and every project pulls only what it needs.
In practice, a mix between
npm installandgit sparse-checkout.
--filter=blob:none and sparse-checkout): only the requested tool is downloaded.grabfile): anyone cloning the project runs grab install and gets the same toolspost-grab.sh that finishes its own installation, for example moving a .devcontainer/ to the project rootgrab publish . sends a tool built on its own into the monorepo, without copy-pastegrab init git@github.com:me/tools.git # once per project
grab add stripe-cli # pull a tool
grab add docker-utils @v2.1 # pinned to a tag
grab exec stripe-cli listen # run it
On add, the script sparse-clones the monorepo into a local cache, materializes only the requested directory, copies it into .grab/tools/, records it in .grabfile and adds .grab/ to .gitignore. Cache and tools stay out of the project repository.
Two traps took me longer than the rest. grab publish . run from a folder already managed by grab copied its own cache into the monorepo, so publishing now goes through a throwaway clone, never the project cache. And nested .git directories are dropped during the copy, otherwise you publish a repository inside a repository.
Hooks ask for confirmation before running, since they come from the monorepo and touch the project: --hook and --no-hook settle it once and for all.
A single-file bash script with no dependency beyond git. It is exactly the kind of tool grab exists to distribute: it distributes itself.
Experience : Personal