> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-cli-section.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# CometChat CLI

> Authenticate against the CometChat dashboard, provision app credentials, toggle features, and manage the AI agent skills — all from your terminal, with JSON output for scripting and CI.

CometChat ships two complementary command-line tools:

| CLI                 | Package                 | What it does                                                             |
| ------------------- | ----------------------- | ------------------------------------------------------------------------ |
| **Credentials CLI** | `@cometchat/skills-cli` | Dashboard authentication + app-credential provisioning + feature toggles |
| **Skills CLI**      | `@cometchat/skills`     | Install, list, and verify the [AI Agent Skills](/agent-skills)           |

<Note>
  Neither CLI writes framework code. The credentials CLI is a pure dashboard/API
  client — it authenticates and hands your app credentials to the
  [agent skills](/agent-skills), which own all framework detection, env-file
  writing, and code generation.
</Note>

Both run through `npx` with no global install, and every command accepts `--json`
for machine-readable output.

## Prerequisites

* **Node.js 18+** — both CLIs run through `npx`.
* A **CometChat account** — [sign up free](https://app.cometchat.com). `auth login` opens the dashboard in your browser to authenticate.

***

## Credentials CLI — `@cometchat/skills-cli`

Its only job is authenticating against the CometChat dashboard and fetching your
**App ID / Region / Auth Key**, then writing a neutral `.cometchat/config.json`
the skills build on.

### Quick start

```bash theme={null}
# 1. Authenticate against the dashboard (opens your browser)
npx @cometchat/skills-cli auth login

# 2. List the apps on your account
npx @cometchat/skills-cli provision list --json

# 3. Pick or create an app, fetch creds, write .cometchat/config.json
npx @cometchat/skills-cli provision run

# 4. Inspect the local config the skills read
npx @cometchat/skills-cli config show --json
```

### Authenticate

```bash theme={null}
npx @cometchat/skills-cli auth login
```

Opens your browser at the CometChat dashboard for device authentication and
stores the bearer token in your OS keychain (falling back to a `chmod 600` file).

| Command       | Purpose                                 |
| ------------- | --------------------------------------- |
| `auth login`  | Sign in via the dashboard (device auth) |
| `auth status` | Show whether you're signed in           |
| `auth me`     | Print the authenticated account         |
| `auth logout` | Clear the stored token                  |
| `auth signup` | Create a CometChat account              |

### Provision credentials

```bash theme={null}
npx @cometchat/skills-cli provision run
```

Fetches your **App ID / Region / Auth Key**, prints them as JSON, and writes a
neutral `.cometchat/config.json`. It writes **no** framework env file — the skill
reads `config.json` and writes the framework-specific env (`.env` / `VITE_` /
`NEXT_PUBLIC_` …) itself.

| Command                       | Purpose                                                       |
| ----------------------------- | ------------------------------------------------------------- |
| `provision run`               | Interactive: pick or create an app, fetch creds, write config |
| `provision list`              | List the apps on your account                                 |
| `provision create`            | Create a new app                                              |
| `provision use --app-id <id>` | Select a specific app by id                                   |

The config file `provision` writes:

```json theme={null}
{
  "version": 1,
  "appId": "…",
  "region": "us",
  "authKey": "…",
  "appName": "My Chat",
  "plan": "…",
  "industry": "…"
}
```

<Warning>
  `.cometchat/config.json` contains your **Auth Key** — add it to `.gitignore`. The
  Auth Key is for **development only**; in production, mint a per-user **auth
  token** on your backend and log in with `loginWithAuthToken()` instead of
  shipping the Auth Key to a client.
</Warning>

### Manage config

Read and edit the local `.cometchat/config.json` (credential/app state only):

| Command                    | Purpose                        |
| -------------------------- | ------------------------------ |
| `config init`              | Create an empty config         |
| `config get <key>`         | Read a single value            |
| `config set <key> <value>` | Write a single value           |
| `config show`              | Print the full config          |
| `config path`              | Print the config file location |

### Toggle features

Enable or disable app features from the terminal:

| Command                      | Purpose                                 |
| ---------------------------- | --------------------------------------- |
| `features list`              | List available features and their state |
| `features enable <feature>`  | Turn a feature on                       |
| `features disable <feature>` | Turn a feature off                      |
| `features ai-key`            | Manage the AI provider key              |

***

## Skills CLI — `@cometchat/skills`

Installs and manages the [AI Agent Skills](/agent-skills) that let your coding
agent build with CometChat.

```bash theme={null}
npx @cometchat/skills add
```

| Command               | Purpose                                                          |
| --------------------- | ---------------------------------------------------------------- |
| `detect`              | Probe the current project (framework, UI Kit, version conflicts) |
| `add [--ide <agent>]` | Install the skills for an AI agent (default: Claude Code)        |
| `list`                | List the skills this pack ships                                  |
| `info <skill>`        | Show a skill's triggers + compatibility                          |
| `verify [tier]`       | Run the skill quality gates                                      |
| `catalog`             | Refresh the component catalog from the installed UI Kit          |
| `doctor`              | Environment health check                                         |

See [Agent Skills](/agent-skills) for the install picker, supported agents, and
the prompt-driven workflow.

***

## Scripting and CI

Every command supports `--json`, and `add` can be pinned to one agent with
`--ide`, so the whole flow runs non-interactively:

```bash theme={null}
# Authenticate, select a known app, and install the skills for Claude Code
npx @cometchat/skills-cli auth login
npx @cometchat/skills-cli provision use --app-id "$COMETCHAT_APP_ID" --json
npx @cometchat/skills add --ide claude
```

Commands **exit non-zero on failure** and surface dashboard errors verbatim (for
example `ACCESS_DENIED`, `EXPIRED`, `TIMEOUT`, `ABORTED`), so a broken auth or
provisioning step fails the CI job loudly instead of continuing with empty
credentials.

## Next steps

<CardGroup cols={2}>
  <Card title="Agent Skills" icon="robot" href="/agent-skills">
    Install the skills and build CometChat from natural-language prompts
  </Card>

  <Card title="MCP Integration" icon="plug" href="/mcp-server">
    Connect CometChat to any Model Context Protocol–compatible agent
  </Card>

  <Card title="React Integration" icon="react" href="/ui-kit/react/integration-react">
    The manual React UI Kit setup, credentials and all
  </Card>

  <Card title="Get your credentials" icon="key" href="https://app.cometchat.com">
    Open the CometChat dashboard
  </Card>
</CardGroup>
