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

# Connect your project

> Enroll one project and line, then explicitly activate the connector.

These steps apply to both CLI modes after local setup. Enrollment creates a **standby** connection; activation changes where new calls are delivered.

<Note>
  Enrollment is a coordinated private-pilot step. Ask Chert to confirm the enabled control-plane and relay origins and provide the owner/admin authentication procedure. There is no `chert login` command yet. A FaceTime project API key cannot replace the required user access token.
</Note>

## 1. Select your project and line

Inject `CHERT_USER_ACCESS_TOKEN` securely into a management shell. Replace uppercase placeholders below with values confirmed by Chert. `CONTROL_ORIGIN` is the HTTPS origin, without `/api`.

```bash theme={null}
npx --no-install chert projects --config "$PWD/chert.json" \
  --backend https://CONTROL_ORIGIN --json
npx --no-install chert lines --config "$PWD/chert.json" \
  --backend https://CONTROL_ORIGIN --project PROJECT_UUID --json
npx --no-install chert bindings --config "$PWD/chert.json" \
  --backend https://CONTROL_ORIGIN --project PROJECT_UUID --json
```

For create-room mode, substitute `chert-room.json`. Confirm the exact project and line IDs. The preview requires **exactly one line in the project**; the CLI does not automatically choose one or activate every project.

## 2. Enroll in standby

```bash theme={null}
install -d -m 700 "$PWD/.chert"
npx --no-install chert enroll --config "$PWD/chert.json" \
  --backend https://CONTROL_ORIGIN --project PROJECT_UUID --line LINE_UUID \
  --relay-origin https://RELAY_ORIGIN \
  --output-config "$PWD/chert.enrolled.json" \
  --credentials-file "$PWD/.chert/credentials.json" \
  --environment production --json
```

This writes a new config and protected connection/recovery credentials. Keep both private. If enrollment or saving the response fails, inspect `bindings` before retrying; do not blindly enroll again.

## 3. Check and connect

In the runtime shell, remove `CHERT_USER_ACCESS_TOKEN` from the environment. The connector uses the saved credentials instead. Run your agent normally, then:

```bash theme={null}
npx --no-install chert check --config "$PWD/chert.enrolled.json" --json
npx --no-install chert byor --config "$PWD/chert.enrolled.json" --json
```

Use `chert create-room` for a create-room config. A successful welcome confirms transport connectivity. `check` currently exits **3** for partial diagnostics; neither command proves a real call works.

## 4. Activate the selected line

In the management shell, refresh the line and binding listings from step 1. After confirming the target with Chert, supply the current assignment generation:

```bash theme={null}
npx --no-install chert activate --config "$PWD/chert.enrolled.json" \
  --expected-binding none --assignment-generation CURRENT_GENERATION --json
```

Use `none` only when there is no previous active binding. For a replacement, use the previous binding's UUID. A stale generation or mismatched binding is rejected.

Activation closes the standby connection. Restart the same runtime command, or let its supervisor restart it, before making a test call. Installation, checks, and reconnects never activate routing by themselves.

## Keep it running

Run the connector alongside your application under your host's process supervisor. Keep **one writer per state directory** on durable local disk, including across deployments. Never share one directory between replicas or delete it to clear an error.

To stop new calls going to this binding:

```bash theme={null}
npx --no-install chert drain --config "$PWD/chert.enrolled.json" --json
```

Drain returns future calls to the line's saved webhook route. Keep the original connector available to finish active calls and recovery. See [Commands](/facetime-cli/commands) for saved status, revocation, and cleanup diagnostics.
