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

# insights category link

> Link an intent category to intents

Link an intent category to one or more intents. Intents that already carry the category are ignored.

Intent IDs are returned by [`insights intent list`](/cli/insights-intent-list) in the `--json` output (`intentIds`).

## Usage

```bash theme={null}
alpic insights category link --intent-id <intentId>
```

Prompts for the category to link in the environment from the local `.alpic` configuration.

## Extended Usage

Link several intents to an explicit category:

```bash theme={null}
alpic insights category link \
  --category-id <categoryId> \
  --intent-id <intentId> \
  --intent-id <intentId>
```

Link in automation:

```bash theme={null}
alpic insights category link \
  --environment-id <environmentId> \
  --category-id <categoryId> \
  --intent-id <intentId> \
  --non-interactive
```

<Info>`--category-id` is required in non-interactive mode.</Info>

## Options

| Flag | Description | Default |
| - | - | - |
| `--environment-id` | Select an environment by ID | |
| `--environment-name` | Select an environment by name | |
| `--project-id` | Provide the project context by ID | |
| `--project-name` | Provide the project context by name | |
| `--category-id` | The ID of the intent category | |
| `--intent-id` | The ID of an intent to link. Repeatable. | |
| `--non-interactive` | Skip interactive prompts | |

<Tip>When the current directory is linked to an environment, the environment and project flags can be omitted.</Tip>


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