# Amp {#amp}

> [!IMPORTANT]
> **Invite-only**
>
> Tuist Sandboxes, both Linux and macOS, are currently invite-only. [Reach out](mailto:contact@tuist.dev) or ping us in the [community Slack](https://slack.tuist.dev) to request access for your account.

[Amp](https://ampcode.com) runs each thread's tools in an [orb](https://ampcode.com/docs/orbs), a machine with the thread's repository checked out. Tuist can be your Amp workspace's [self-hosted orb provider](https://ampcode.com/docs/orbs/self-hosted): every thread that picks it runs in its own Tuist <.localized_link href="/guides/features/sandboxes">sandbox</.localized_link>, on Linux or macOS. You don't run or host anything yourself.

To keep your threads on their current orbs and only build, test and run Apple-platform code on a Mac, use the [Tuist Mac plugin](#remote-mac) instead.

## Connect Amp {#connect}

You need to be an administrator of both the Amp workspace and the Tuist account.

1. In Amp, open your workspace's **Settings → Orbs**, click **Add Orb Provider**, and name it, for example `tuist`. Members pick the provider by this name. Copy the `aop_live_…` token; Amp shows it only once.
2. In the provider's **Edit** dialog in Amp, add the **Orb types** you want to offer and pick the default. The Linux types match the memory of [Amp's own orbs](https://ampcode.com/docs/orbs/sizes-and-costs). Each one is guaranteed a quarter of a vCPU per GiB of memory and bursts to 16 vCPUs when its machine has idle cores (see <.localized_link href="/guides/features/sandboxes#guaranteed-cpu">Guaranteed CPU</.localized_link>):

   | Type | Shape |
   | --- | --- |
   | `linux` | Linux, 8 GiB RAM, 2 guaranteed vCPUs |
   | `linux-tiny` | Linux, 2 GiB RAM, 0.5 guaranteed vCPUs |
   | `linux-small` | Linux, 4 GiB RAM, 1 guaranteed vCPU |
   | `linux-medium` | Same as `linux` |
   | `linux-large` | Linux, 16 GiB RAM, 4 guaranteed vCPUs |
   | `linux-xxlarge` | Linux, 32 GiB RAM, 8 guaranteed vCPUs |
   | `linux-3xlarge` | Linux, 44 GiB RAM, 11 guaranteed vCPUs |
   | `macos` | macOS with the default Xcode, 8 vCPU, 8 GiB RAM |
   | `macos-xcode-<version>` | macOS with that [Xcode](#xcode), 8 vCPU, 8 GiB RAM |

   Linux types have a 10 GB workspace, macOS types 30 GB.

3. In Tuist, open **Sandboxes** in your account's dashboard, click **Connect** on the Amp card, and paste the token.

The card shows **Connected** once Tuist is serving the provider. One Tuist account serves one provider. Anyone who can use the provider in Amp runs orbs on, and charged to, the connected Tuist account. To stop, click **Disconnect** on the card, or turn the provider off in Amp.

## Start a thread {#start-a-thread}

In Amp's new-thread composer, click **Orb**, choose the Tuist provider under **Self-Hosted**, and pick a type, such as `linux-small` for a repository that needs less than `linux`, or `linux-large` for one that needs more. From the Amp CLI:

```bash
amp -ox "Fix the failing snapshot tests" --orb-provider tuist --orb-size macos
```

A thread keeps its orb type for life. Without a type, it gets the provider's default. To use one type for every new thread, choose the provider and its type under **Default Orb** in Amp's **Settings → Orbs**.

### Choose an Xcode {#xcode}

`macos` runs the default <.localized_link href="/guides/features/sandboxes#xcode">Xcode</.localized_link>. For another one, add an orb type named after it, with the dots replaced by dashes: `macos-xcode-26-1-1` runs Xcode 26.1.1, `macos-xcode-27-0` Xcode 27.0. Add one for each Xcode your repositories pin, and pick it per thread like any other type:

```bash
amp -ox "Fix the failing snapshot tests" --orb-provider tuist --orb-size macos-xcode-26-1-1
```

A type for an Xcode Tuist doesn't offer fails when a new orb starts. An orb Tuist already started on it keeps resuming after Tuist stops offering that Xcode.

Amp clones the repository, runs your `.agents/setup` script and sets up Git credentials, as it does for every orb. Each orb can also read your account's Tuist <.localized_link href="/guides/features/cache">cache</.localized_link>.

## Pausing and retention {#retention}

When a thread goes idle, Amp pauses its orb. The next message resumes it with its files intact.

- **Linux:** Running processes survive a pause. An orb that has been paused for a long time moves to archive storage and is restored on the next message, without its processes. Linux orbs keep their files until Amp deletes the thread's orb.
- **macOS:** An orb paused, or in an error state, for 7 days is deleted. The thread's next message starts a fresh orb, and Amp runs `.agents/setup` again. The first macOS orb on a machine installs the Amp CLI, so it can take up to two minutes to start.

An orb that stays idle without Amp pausing it, for example because a pause never arrived, is paused after ten minutes with almost no CPU use.

## Use a Mac from any Amp thread {#remote-mac}

The Tuist Mac plugin gives an Amp thread a macOS sandbox with Xcode, the iOS simulators and Homebrew while the thread keeps running where it is, for example on one of Amp's own Linux orbs. Ask Amp for the work, and it starts a Mac when it needs one:

> Add a dark mode toggle to the settings screen, run the app in the iOS Simulator, and show me a screenshot.

Amp keeps editing code where it runs. Before each command on the Mac, the plugin runs `tuist sandbox sync`, which copies the files Git doesn't ignore, committed or not, and afterwards only the ones that changed. Build products and other ignored files the Mac creates stay there, so builds stay incremental. The plugin adds these tools, and a `remote-mac` skill that tells Amp when and how to use them:

| Tool | What it does |
| --- | --- |
| `tuist_mac_start` | Creates the thread's Mac, or reuses it, and syncs |
| `tuist_mac_shell` | Syncs, then runs a command on the Mac |
| `tuist_mac_screenshot` | Shows the simulator or the screen in the thread |
| `tuist_mac_download` | Copies a file back, such as a built `.app` |
| `tuist_mac_stop` | Deletes the thread's Mac |

The Mac has the Tuist CLI, and runs the project's own version when it pins one through mise; `tuist_mac_shell` puts mise's shims first on `PATH`. Each command on the Mac is <.localized_link href="/guides/features/sandboxes#tuist-in-sandbox">signed in to your account's cache</.localized_link> on its own with Tuist 4.218.0 or later; with 4.215.0 to 4.217.x, Amp runs `tuist auth login` first.

A thread uses one Mac. Amp passes `tuist_mac_start` the <.localized_link href="/guides/features/sandboxes#xcode">Xcode</.localized_link> the repository pins, such as in `.xcode-version`, or you can ask for one ("use Xcode 26.1.1"); without one, the Mac runs the default. The Mac keeps its Xcode, so switching means stopping it and starting another. Tuist pauses it when it's idle and the next command resumes it. Amp deletes it when the task is done; a Mac left behind is deleted after 14 days paused. Macs count toward your Tuist account like any other sandbox.

### Set it up {#remote-mac-setup}

1. **Install the plugin.** It's one file, [`tuist-mac.ts`](https://github.com/tuist/tuist/blob/main/.amp/plugins/tuist-mac.ts). To make it available to everyone in your Amp workspace, a workspace admin asks Amp in a thread:

   > Add https://raw.githubusercontent.com/tuist/tuist/main/.amp/plugins/tuist-mac.ts to our workspace plugins.

   Amp commits it to the workspace's [plugin repository](https://ampcode.com/docs/customize/global-plugins-and-skills) and asks before pushing it. Ask for "my personal plugins" instead to install it only for yourself, or save the file as `.amp/plugins/tuist-mac.ts` in a repository to use it only there. The plugin is a copy: to update it, ask Amp to replace it with the latest version from the same URL.
2. **Install the Tuist CLI** where Amp runs. On orbs, add it to the repository's [`.agents/setup`](https://ampcode.com/docs/orbs/customizing) script, for example `mise use -g tuist@latest`, or `curl -fsSL https://github.com/tuist/tuist/releases/download/<version>/tuist-linux-x86_64.tar.gz | tar -xz -C /usr/local/bin tuist`.
3. **Let the CLI use your account's sandboxes.** On orbs, connect your Amp workspace to your Tuist account as described in <.localized_link href="/guides/server/authentication#amp-orbs">Amp orbs</.localized_link>. The orbs then sign in on their own, with access to sandboxes. Elsewhere, such as the Amp CLI on a Linux machine, run `tuist auth login` as an account member, or set `TUIST_MAC_TOKEN` to an <.localized_link href="/guides/server/authentication#account-tokens">account token</.localized_link> with the `account:sandboxes:write` scope, plus `ci` for the Mac to use the cache. The plugin passes `TUIST_MAC_TOKEN` to the CLI in place of `TUIST_TOKEN`, so also set it when your orbs already have a `TUIST_TOKEN` without that scope.
4. **Tell it which account to use**, if the repository has no `tuist.toml` with `project = "<account>/<project>"`. On Linux, the CLI can't read the account from `Tuist.swift`. Set `TUIST_MAC_ACCOUNT` to your account handle in your Amp project's environment variables. Without it, Amp passes the account from `Tuist.swift`'s `fullHandle` to `tuist_mac_start`.

The CLI reaches the Mac only through `tuist.dev`, so an environment that restricts network access needs to allow only that domain. To use a CLI that isn't on `PATH`, set `TUIST_MAC_CLI` to its path.

Agents that don't support Amp plugins, such as Claude Code or Cursor, can do the same through the Tuist MCP server and the CLI, as described in <.localized_link href="/guides/features/sandboxes#coding-agents">Build on a Mac from a coding agent</.localized_link>.

### Use Tuist Macs instead of Amp's macOS Satellites {#remote-mac-satellites}

Amp also has its own cloud Macs, [macOS Satellites](https://ampcode.com/docs/orbs/mac), in beta for workspaces that joined its waitlist. When a thread can start both, Amp's built-in instructions send macOS work to its satellites, so it rarely picks the plugin. To have threads use Tuist Macs, do one of these:

- **Turn off macOS Satellites for yourself.** Each member turns them off under **Mac Satellites** in Amp's [Settings → Experimental Features](https://ampcode.com/settings/experimental-features).
- **Turn them off for the workspace.** When your workspace's orbs [run on Tuist](#connect), a workspace admin can set **Where Orbs Run** to **Self-Hosted Only** in Amp's workspace settings, under **Orbs**. Agents then can't start Amp-hosted satellites, but members also can't use Amp's built-in orbs, so only do this when all your threads run on your own orb providers.
- **Ask for Tuist Macs.** Add "Use the `tuist_mac_*` tools for macOS work, not macOS Satellites." to the prompt, or to your workspace's agent guidance in Amp's workspace settings so every thread follows it.
