# Getting started

Build twin, install macOS from Apple once, and make a twin that answers commands.

## What it needs

- A Mac with Apple silicon, on macOS 15 or newer.
- Rust (the version in `rust-toolchain.toml` is installed by `rustup` on the first build).
- About 25 GB of free disk for the first image: the download from Apple is 18 GB and is removed
  once the image is made.

## Build

```sh
git clone https://github.com/localixai/localix-twin
cd localix-twin
cargo build --release
scripts/sign target/release/twin
```

A program that runs virtual machines needs Apple's virtualization entitlement, and a build
removes it: `scripts/sign` signs the binary with it again. Run it after every build. Without it,
`twin up` stops with a message that names the fix.

Put `target/release/twin` on your `PATH`, or call it by its path.

## Install macOS

```sh
twin image install tahoe
```

This asks Apple for the newest macOS this Mac can run, downloads it (resuming if the download is
cut), installs it into a new image, and prints its progress. On a 24 GB Mac it took 17 minutes:
about 14 to download and 3 to install. The image is about 21 GB on disk.

A fresh image starts at Apple's setup assistant. The steps that make it ready for an agent are in
[Images](https://twin.localix.ai/docs/images).

## Make a twin

```sh
twin create work --from tahoe-dev     # a clone: a hundredth of a second, almost no disk
twin up work --wait                   # back once the guest's agent answers, about 16 s
twin sh work -- 'node -v && bun -v'
twin screenshot work -o work.png
twin down work                        # about 6 s
twin rm work
```

Every command takes `--json` for a machine-readable answer. Exit codes and errors are the same in
every command: see [Commands](https://twin.localix.ai/docs/commands#exit-codes).

## Use it from Claude Code

```sh
claude plugin marketplace add localixai/localix-twin
claude plugin install localix-twin@localix-twin
```

The plugin starts `twin mcp` and gives Claude two skills, driving a twin and styling one. See
[Agents](https://twin.localix.ai/docs/agents).
