58 lines
1.1 KiB
Markdown
58 lines
1.1 KiB
Markdown
# sandlot
|
|
|
|
A CLI for branch-based development using git worktrees and [Lima](https://github.com/lima-vm/lima) VMs. Each branch gets its own worktree and isolated VM.
|
|
|
|
## Prerequisites
|
|
|
|
- macOS on Apple Silicon
|
|
- [Bun](https://bun.sh)
|
|
- [Lima](https://github.com/lima-vm/lima) (`brew install lima`)
|
|
- Git
|
|
|
|
## Install
|
|
|
|
```bash
|
|
git clone https://github.com/your/sandlot
|
|
cd sandlot
|
|
bun install
|
|
bun link
|
|
```
|
|
|
|
## Usage
|
|
|
|
Run all commands from inside a cloned git repo.
|
|
|
|
### Start a session
|
|
|
|
```bash
|
|
sandlot new fix-POST
|
|
```
|
|
|
|
Creates a worktree at `.sandlot/fix-POST/`, boots a Lima VM mapped to it, and drops you into a shell.
|
|
|
|
### Other commands
|
|
|
|
```bash
|
|
sandlot list # show all sessions
|
|
sandlot open <branch> # re-enter a session's VM
|
|
sandlot stop <branch> # stop a VM without destroying it
|
|
sandlot rm <branch> # tear down session (VM, worktree, local branch)
|
|
```
|
|
|
|
Use git directly for commits, pushes, merges, etc. The worktree is a normal git checkout.
|
|
|
|
## Project config
|
|
|
|
Optionally add a `sandlot.json` to your repo root:
|
|
|
|
```json
|
|
{
|
|
"vm": {
|
|
"cpus": 4,
|
|
"memory": "8GB",
|
|
"image": "ubuntu:24.04",
|
|
"mounts": { "/path/to/deps": "/deps" }
|
|
}
|
|
}
|
|
```
|