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

# Create a rig

> Spin up a rig pre-loaded with your repo and agent credentials.

This guide walks through creating a rig, waiting for it to become ready,
and tearing it down. By default everything runs on the hosted platform at
[app.amika.dev](https://app.amika.dev).

## Prerequisites

<Note>
  * An Amika account and an API token. The CLI uses `amika auth login`; the
    SDK expects you to source a token via `accessToken` or `tokenSource`.
  * (For the `--git` flow) Git installed and a repo to mount.
  * For the SDK: `npm install @amika/sdk`.
</Note>

## Step 1 — Create the rig

The simplest rig uses the `coder` preset (Ubuntu 24.04 with Node, Python,
and the Claude Code / Codex / OpenCode CLIs pre-installed).

<CodeGroup>
  ```bash CLI theme={null}
  amika rig create --name dev-box --preset coder
  ```

  ```ts TypeScript theme={null}
  import { AmikaClient } from "@amika/sdk";

  const amika = new AmikaClient({
    baseUrl: process.env.AMIKA_API_URL ?? "https://app.amika.dev",
    accessToken: process.env.AMIKA_API_KEY!,
  });

  const sb = await amika.createRig({
    name: "dev-box",
    preset: "coder",
  });
  ```
</CodeGroup>

To clone a repo into the rig, pass `--git` (CLI) or `repoUrl` (SDK). The
CLI's `--git` accepts a local path or a git URL; the SDK accepts a URL.

<CodeGroup>
  ```bash CLI theme={null}
  # Clone the repo in the current directory
  amika rig create --name dev-box --preset coder --git

  # Or clone a remote URL
  amika rig create --name dev-box --preset coder \
    --git https://github.com/gofixpoint/example-repo.git
  ```

  ```ts TypeScript theme={null}
  const sb = await amika.createRig({
    name: "dev-box",
    preset: "coder",
    repoUrl: "https://github.com/gofixpoint/example-repo.git",
    branch: "main",
  });
  ```
</CodeGroup>

### How the CLI picks a repo

* Run `amika rig create` **from inside a git repo** and that repo is used
  automatically — no flag needed.
* **Outside a repo** (or to target a different one), pass `--git <path-or-URL>`.
  The value accepts a local path or a git URL (HTTPS or SSH).
* Pass `--no-git` to skip auto-detection and create a **repo-less rig** — a
  rig with no repository mounted. This is useful for scratch environments or
  when you clone repos yourself after connecting.

<Note>
  A repo-less rig still boots a full environment; it just starts without a
  checked-out repository. Configuration for multi-repo and repo-less rigs is
  covered in the [Repository configuration](/reference/repository-configuration)
  guide.
</Note>

## Step 2 — Wait until it's ready

A new rig starts in state `initializing` and transitions to `active` /
`running` / `started` once it's reachable.

<CodeGroup>
  ```bash CLI theme={null}
  # `rig create` blocks until the rig is ready — no extra step needed.
  ```

  ```ts TypeScript theme={null}
  // `createRig` returns immediately with state "initializing".
  // `waitForRig` polls every 3 seconds until ready (no client timeout).
  await amika.waitForRig(sb.name);
  ```
</CodeGroup>

<Note>
  `waitForRig` throws an `AmikaError` if the rig reaches the `failed`
  state. New `state` values can appear over time — the wait helper treats
  `active`, `running`, and `started` as ready and anything else (except
  `failed`) as still working.
</Note>

## Step 3 — Tear it down

When you're done, delete the rig to free its resources.

<CodeGroup>
  ```bash CLI theme={null}
  amika rig delete dev-box --force
  ```

  ```ts TypeScript theme={null}
  await amika.deleteRig("dev-box");
  ```
</CodeGroup>

## Next steps

<CardGroup>
  <Card title="Send a message to an agent" href="/guides/send-a-message-to-an-agent" icon="paper-plane" />

  <Card title="Inject credentials" href="/guides/inject-credentials" icon="syringe" />

  <Card title="Rig lifecycle" href="/guides/rig-lifecycle" icon="rotate" />

  <Card title="Rig configuration reference" href="/reference/rig-configuration" icon="sliders" />
</CardGroup>
