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

# CLI

> Connect Claude Code and Codex to Carbon — the interactive setup and the connect, status, and disconnect commands.

`@carbon-js/connect` (the [`@carbon-js/connect`](https://www.npmjs.com/package/@carbon-js/connect) package) wires your AI coding apps' built-in OpenTelemetry exporters to Carbon. It runs from `npx` — no install — and edits each app's own config, so there's no daemon and no changes to your projects.

## Interactive setup

With no arguments it walks you through setup: it detects the apps installed on your machine, lets you pick which to connect, and prompts for your API key.

<CodeGroup>
  ```bash npm theme={null}
  npx @carbon-js/connect@latest
  ```

  ```bash pnpm theme={null}
  pnpm dlx @carbon-js/connect@latest
  ```

  ```bash bun theme={null}
  bunx @carbon-js/connect@latest
  ```
</CodeGroup>

Restart each app afterward so it reloads its config and starts exporting.

<Note>When only one supported app is detected, the picker is skipped and that app is connected directly.</Note>

## Commands

```
@carbon-js/connect                          interactive setup (detect → pick → connect)
@carbon-js/connect connect [codex|claude-code]
                                        connect an app (interactive when no app is given)
@carbon-js/connect status                   show which apps are connected, as a table
@carbon-js/connect disconnect [codex|claude-code]
                                        disconnect an app (interactive when none is given)
```

### connect

Connect a single app directly by naming it, passing the key inline:

```bash theme={null}
npx @carbon-js/connect@latest connect codex --key crb_…
```

Each app's key is written into *its own* config, so you can point different apps at different Carbon spaces. Key resolution and per-app keys are covered in [API keys](/documentation/connect/api-keys); the exact config edit in [How it works](/documentation/connect/how-it-works).

### status

Print a table of every supported app and whether it's connected. Pass an app name to narrow it to one:

```bash theme={null}
@carbon-js/connect status            # all apps
@carbon-js/connect status codex      # just Codex
```

### disconnect

Cleanly revert the connection — removing exactly the keys it added and leaving the rest of the config untouched:

```bash theme={null}
@carbon-js/connect disconnect claude-code
```

## Requirements

* Node ≥ 18
* Claude Code and/or Codex installed locally

Restart an app after connecting or disconnecting for the change to take effect.
