> ## 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.

# Codex app

> Connect the Codex mobile or desktop app to an Amika rig.

Connect to a rig VM from Codex in two ways:

* **Desktop app:** add the rig as an SSH host and open its remote project.
* **Mobile app:** pair with the rig's remote-control daemon.

The rig must remain active while you use either connection. See
[Create a rig](https://docs.amika.dev/guides/create-a-rig.md).

## Connect the desktop app

You need the Codex desktop app, the
[authenticated Amika CLI](https://docs.amika.dev/quickstart.md#step-2-set-up-the-cli), and an SSH
identity. Create an identity with `amika secret ssh-keygen` if you do not
already have one.

**1. Add the rig as an SSH host**

Run this on the computer where you use the Codex desktop app. Replace
`dev-box` with your rig name.

```bash theme={null}
amika rig open dev-box --app codex
```

On CLI v0.23.0 and earlier, run `amika rig code dev-box --editor codex`.

The command adds a concrete host to your SSH configuration, enables Codex
remote connections, and opens the Codex app. It prints the SSH host name
and remote project folder to use in the next step.

**2. Enable the SSH host in Codex**

In the Codex desktop app, open **Settings > Connections**. Add or enable
the SSH host printed by the CLI, then choose the printed remote project
folder.

The desktop app starts and manages the remote Codex app-server over SSH. You do
not need to start `codex remote-control` or generate a pairing code for this
connection.

## Connect the mobile app

You need Codex remote control access for your ChatGPT account and workspace.
Sign in to the Codex mobile app with the same account and workspace you use on
Amika rigs.

**1. Open a shell in the rig**

Replace `dev-box` with your rig name.

```bash theme={null}
amika rig ssh dev-box
```

**2. Sign in to Codex**

Check whether the rig already has a Codex login:

```bash theme={null}
codex login status
```

If you are not logged in, use device authentication and follow the printed
instructions:

```bash theme={null}
codex login --device-auth
```

**3. Start remote control**

Start the app-server daemon in the rig:

```bash theme={null}
codex remote-control start
```

**4. Generate a pairing code**

Generate a short-lived code:

```bash theme={null}
codex remote-control pair
```

Open remote control in the mobile app and enter the code. Generate another
code if it expires before you finish pairing.

### Stop mobile remote control

Stop the rig's app-server daemon when you no longer want it available for
remote control:

```bash theme={null}
codex remote-control stop
```

Stopping or deleting the rig also makes it unavailable.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.