> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ellomas.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install Graft and set up dependencies.

# Installation

## Requirements

* **Go 1.21+** (for `go install`)
* **Docker** — Docker Desktop or OrbStack on macOS, Docker Engine on Linux
* **rsync** — Must be available on your PATH

### Check Dependencies

```bash theme={null}
# Verify Docker
docker ps

# Verify rsync
rsync --version
```

## Install via Go

```bash theme={null}
go install github.com/tomiwa-amole/graft/cmd/graft@latest
```

This places the `graft` binary in `$GOPATH/bin` (default: `~/go/bin/graft`). Ensure `$GOPATH/bin` is on your PATH.

## Build from Source

```bash theme={null}
git clone https://github.com/tomiwa-amole/graft.git
cd graft
go build -o graft ./cmd/graft
```

## Verify Installation

```bash theme={null}
graft --help
```

You should see:

```text theme={null}
Graft is a CLI tool that provides instant, local database branching
by manipulating Docker volumes at the file-system level.

Usage:
  graft [command]

Available Commands:
  checkout    Switch to a specific data branch
  commit      Create a save-point for the current active branch
  delete      Delete a specific data branch
  init        Initialize graft on a target container
  list        List all local data branches
  reset       Reset the current branch to main's current save-point
  rollback    Revert the current branch to a specific save-point
  verify      Verify integrity of a branch against its saved Merkle tree root
```

## Environment Variables

| Variable      | Default    | Description                           |
| ------------- | ---------- | ------------------------------------- |
| `GRAFT_HOME`  | `~/.graft` | Root directory for Graft project data |
| `GRAFT_RSYNC` | `rsync`    | Path to the rsync binary              |

## Notes for macOS

Docker Desktop (4.22+) and OrbStack both support bind mounts via virtio-fs, a high-performance filesystem sharing protocol. Graft's bind mount mode works on both.

On older Docker Desktop versions (before 4.22), bind mount performance may be noticeably slower due to the legacy osxfs filesystem sharing.
