# Chalk CLI Reference: Integrations
source: https://docs.chalk.ai/cli#integrations

Manage external [data source integrations](https://docs.chalk.ai/docs/sql) including databases, warehouses, and streaming platforms.

## `chalk integration install`
source: https://docs.chalk.ai/cli?command=integration_install

```bash
chalk integration install herdr
```

Install a Herdr plugin that calls the Chalk CLI for provisioning and session restoration. Replaces the older chalk.sandbox JavaScript plugin registration. Run again after moving the Chalk binary.

## `chalk integration list`
source: https://docs.chalk.ai/cli?command=integration_list

```bash
chalk integration list [--decrypt]
```

Use the `chalk integration list` command to view the integrations that are available in this environment.

Integrations can be deleted with `chalk integration delete`.

**Flags**

- `--decrypt <decrypt>` (bool, default `false`)
  Decrypt the integration secrets.

**Example**

```
$ chalk integration list --decrypt
✓ Fetched integrations
 Name      Kind        Secrets                          Updated
────────────────────────────────────────────────────────────────
 pgdemo    POSTGRESQL  PGDATABASE, PGHOST, PGPASSWORD  1mo ago
 bqprod    BIGQUERY    CREDENTIALS_JSON                2mo ago
```

## `chalk integration get`
source: https://docs.chalk.ai/cli?command=integration_get

```bash
chalk integration get [--name] [--decrypt]
```

Use the 'chalk integration get' command to retrieve a specific integration by name or ID.

You can either specify the integration name/ID with the '--name' flag or select from a list.

**Flags**

- `--name <name>` (string)
  Name or ID of the integration to get.
- `--decrypt <decrypt>` (bool, default `false`)
  Decrypt the integration secrets.

**Example**

```
$ chalk integration get --name my-integration --decrypt
✓ Fetched integration
Name: my-integration
Kind: POSTGRESQL
Secrets:
  PGHOST: localhost
  PGPORT: 5432
Updated: 1mo ago
```

## `chalk integration insert`
source: https://docs.chalk.ai/cli?command=integration_insert

```bash
chalk integration insert [flags]
```

Use the `chalk integration insert` command to create a new integration.

This command allows you to create integrations for various data sources like PostgreSQL, Snowflake, BigQuery, etc. You'll be prompted to provide the necessary environment variables for the integration type you select.

**Interactive Mode (recommended)**

If no arguments are provided, `chalk integration insert` will enter interactive mode, which will prompt you for the integration name, type, and required environment variables.

```
chalk integration insert
```

**With Flags**

You can also provide the integration name and kind as flags:

```
chalk integration insert --name my-postgres --kind postgresql
```

Available integration kinds:

- athena
- aws
- bigquery
- clickhouse
- cohere
- databricks
- dynamodb
- gcp
- kafka
- kinesis
- mysql
- openai
- postgresql
- pubsub
- redshift
- snowflake
- spanner
- trino

**Flags**

- `--name <name>` (string)
  Name of the integration.
- `--kind <kind>` (string)
  Kind of integration (e.g., postgresql, snowflake, bigquery).

**Example**

```
$ chalk integration insert --name my-postgres --kind postgresql
✓ Integration created
```

## `chalk integration delete`
source: https://docs.chalk.ai/cli?command=integration_delete

```bash
chalk integration delete [--name]
```

Use the `chalk integration delete` command to delete an integration.

You can either specify the integration name or ID with the `--name` flag, select an integration from a list, or specify the integration names/IDs as arguments.

**Flags**

- `--name <name>` (string[], default `[]`)
  Names or IDs of the integrations to delete.

**Example**

```
$ chalk integration delete --name my-integration
✓ Deleted integration
```

## `chalk integration apply`
source: https://docs.chalk.ai/cli?command=integration_apply

```bash
chalk integration apply --file <config.yaml>
```

Use the `chalk integration apply` command to create or update an integration from a YAML configuration file.

If an integration with the given name already exists, it will be updated. Otherwise, a new integration will be created.

The YAML file should contain:

- `name`: The integration name (required)
- `kind`: The integration kind, e.g. postgresql, snowflake (required)
- `environment_variables`: A map of environment variable key-value pairs

**Flags**

- `--file <file>` (string)
  Path to a YAML file containing 'name', 'kind', and 'environment_variables' for the integration.

**Example**

```
$ chalk integration apply --file config.yaml
# where config.yaml contains:
# name: my-postgres
# kind: postgresql
# environment_variables:
#   PGHOST: localhost
#   PGPORT: "5432"
#   PGDATABASE: mydb
#   PGUSER: myuser
#   PGPASSWORD: mypassword
```
