clorb is a CLI command that uses orbctl to clone OrbStack VMs based on the name of a git branch.
At work, we do all our work inside OrbStack VMs. It's like docker or vagrant, but better :)
Cloning an orb is fast and practical. It only takes 1-3 seconds, and it accomplishes this by copying an existing orb without duplicating all of its data. A super practical feature is that it will clone any databases you might have inside the orb. This means that if your branch depends on making non-reversible database migrations, those migrations stay within the orb.
Without this clorb tool, you can run:
orbctl clone my-orb my-new-orb-clone
What clorb offers is simple: you only provide the name of the git branch and if the clone already exists it doesn't do anything. That means that running clorb my-new-orb-clone is idempotent.
How it was created
The code is available at https://github.com/peterbe/clorb and it's a Bun program. It compiles down to a single binary.
Installing it is possible with:
curl -fsSL https://raw.githubusercontent.com/peterbe/clorb/main/install.sh | bash
that command will download the latest binary, for your operating system, and put the executable clorb in your ~/bin/ directory.
Please consider installing it and contributing. It's easy to debug the functionality. All you need is just and bun. See the README.md for instructions for how to dev on the project.