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

# Pair a machine

> Link a machine to your Alike account with a one-time code.

Pairing links one machine to your Alike account. After pairing, the hooks on that machine can send sessions to Alike and receive context back.

## How pairing works

**1. The installer prints a link and a code**

```text theme={null}
  Open:  https://alike.network/pair?code=K7QM-4XRT
  Code:  K7QM-4XRT
  waiting for approval…
```

The code has 8 characters in two groups of 4. It uses capital letters and the digits 2 to 9. It does not use the digits `0` or `1`.

**2. Open the link on any device**

Use the same machine, a laptop, or a phone. Sign in to Alike first. If you are not signed in, the link opens the Alike home page instead. If you have not finished setup in the web app, the link opens your setup page. In both cases, see [Enter the code by hand](#enter-the-code-by-hand).

**3. Approve the code**

Check that the code on the page is the code in your terminal. Then approve it.

**4. The installer continues**

The installer saves the machine's credential to `~/.alike/credentials.json`. Only your user account can read this file. The installer never prints the credential.

> [!WARNING]
>
> Approve only a code that you generated yourself, a moment ago. A person who sends you a pairing link can get access to your account if you approve their code.

## Enter the code by hand

You can also type the code in the web app:

* During setup: on the **Connect your agents** page, under **Enter your pairing code**.
* Later: in **Settings → AI Agents**.

When the code works, the web app shows `<hostname> paired — your agents are wired to this workspace.` If the code does not work, it shows `That code is invalid or has expired. Ask your installer for a fresh code and try again.`

## Time limits

A code is valid for **10 minutes**. The installer also stops waiting after 10 minutes. After that, you see one of these messages:

* `pairing timed out (10m)`
* `pairing code expired`

Your agents stay wired. To get a new code, run:

```bash theme={null}
npx @alikeai/setup --doctor
```

The doctor finds the wiring, sees that the machine is not paired, and starts a new pairing.

## If you close the browser or stop the installer

Nothing is lost. The installer wires your agents before it pairs, so a pairing problem never removes the wiring. Run `npx @alikeai/setup --doctor` to finish pairing.

## Headless machines and SSH

The installer does not open a browser. Open the printed link on another device and approve the code there. The code works from any device where you can sign in.

## Pair more than one machine

Run the installer on each machine. Each machine gets its own credential.

> [!WARNING]
>
> Give each machine a different hostname. When you pair a machine, Alike cancels your older credentials for machines with the same hostname. Two machines with the same name, for example two cloud VMs called `ubuntu`, disconnect each other each time one of them pairs.

Check a machine's hostname with `hostname`.

## Switch to a different Alike account

The installer always reuses a credential that still works. To pair the machine with a different account:

1. Delete the credential: `rm ~/.alike/credentials.json`
2. Run the installer again: `npx @alikeai/setup`
3. Sign in to the other account in your browser before you approve the code.

## When pairing happens again

| Situation | What the installer does |
| - | - |
| The stored credential works | Prints `Already paired with your Alike workspace — reusing the stored hook token.` |
| The stored credential expired or Alike refused it | Prints `· the stored credential has expired — re-pairing` and shows a new code |
| Alike could not be reached to check the credential | Starts a new pairing |
| No credential is stored | Starts a new pairing |

## Remove a machine from your account

You cannot remove a single machine from the Alike web app yet. To stop a machine from sending data, run the uninstaller on that machine. It deletes the machine's credential file. See [Uninstall](https://alike.help/install/update-and-uninstall.md#uninstall).

The uninstaller does not cancel the credential on Alike's side. If you think a copy of `~/.alike/credentials.json` was taken, or you do not have access to the machine anymore, contact [support@alike.work](mailto:support@alike.work).


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