# Connect

**Build, validate, and manage commercetools Connect connectors and deployments from the terminal.**

The `connect` topic provides commands for the full Connector development lifecycle, from scaffolding a new connector project locally to creating and monitoring live deployments. Commands are grouped into four areas: local development, staged connector management, deployment management, and application utilities.

Commands that call the API need an authenticated session. For how to log in, see [Authentication](/dev-tooling/cli/overview.md#authentication).

## Local development

### `connect init`

Scaffolds a new Connect project from a template.

```bash title="Scaffold a Connect project"
commercetools connect init [<directory>] [--template <template>]
```

| Argument or flag | Description |
| --- | --- |
| `<directory>` | Target directory for the project (prompts if omitted) |
| `--template` | Template to bootstrap the project with (prompts if omitted) |

### `connect validate`

Validates the connector configuration and applications in a local project directory.

```bash title="Validate a Connect project"
commercetools connect validate [<directory>] [--skip <step>]
```

| Argument or flag | Description |
| --- | --- |
| `<directory>` | Connect project directory (defaults to current directory) |
| `--skip` | Skip a validation step: `test` or `analysis` |

### `connect bundle`

Bundles all Connect applications in the project into deployable images.

```bash title="Bundle the applications"
commercetools connect bundle
```

## Staged connectors

Staged connectors are private, editable versions of a connector that go through a review lifecycle before being published. The `describe`, `update`, `preview`, `publish`, and `certify` commands of `connectorstaged` accept `--id` or `--key` to identify the target connector.

### `connect connectorstaged list`

Lists staged connectors.

```bash title="List staged connectors"
commercetools connect connectorstaged list [--limit <n>] [--offset <n>] [--sort <expr>]
```

| Flag | Description |
| --- | --- |
| `--limit` | Maximum number of results |
| `--offset` | Number of results to skip |
| `--sort` | Sort expression |

### `connect connectorstaged describe`

Gets a staged connector.

```bash title="Get a staged connector"
commercetools connect connectorstaged describe (--id <id> | --key <key>)
```

### `connect connectorstaged create`

Creates a staged connector.

```bash title="Create a staged connector"
commercetools connect connectorstaged create 
  --key <key> 
  --repository-url <url> 
  --repository-tag <tag> 
  --creator-email <email> 
  --name <name> 
  [--description <text>] 
  [--supported-regions <regions>] 
  [--integration-types <types>]
```

| Flag | Description |
| --- | --- |
| `--key` | Unique key for the connector |
| `--repository-url` | Git repository URL |
| `--repository-tag` | Git tag or branch to deploy |
| `--creator-email` | Email of the connector creator |
| `--name` | Display name |
| `--description` | Short description |
| `--supported-regions` | Comma-separated list of supported Regions |
| `--integration-types` | Comma-separated list of integration types |

### `connect connectorstaged update`

Updates a staged connector.

```bash title="Update a staged connector"
commercetools connect connectorstaged update 
  (--id <id> | --key <key>) 
  [--repository-url <url>] 
  [--repository-tag <tag>] 
  [--creator-email <email>] 
  [--name <name>] 
  [--description <text>] 
  [--supported-regions <regions>] 
  [--integration-types <types>]
```

### `connect connectorstaged preview`

Runs the required validations and creates a preview deployment of the staged connector, so you can test it without publishing it.

```bash title="Preview a staged connector"
commercetools connect connectorstaged preview 
  (--id <id> | --key <key>) 
  --deployment-key <key> 
  --region <region> 
  [--configuration <key=value>...]
```

### `connect connectorstaged publish`

Initiates the publishing process for a staged connector.

```bash title="Publish a staged connector"
commercetools connect connectorstaged publish (--id <id> | --key <key>)
```

### `connect connectorstaged certify`

Initiates the certification process for a staged connector.

```bash title="Certify a staged connector"
commercetools connect connectorstaged certify (--id <id> | --key <key>)
```

## Deployment

Deployments are running instances of a connector in a Project.

### `connect deployment list`

Lists deployments.

```bash title="List deployments"
commercetools connect deployment list [--limit <n>] [--offset <n>] [--sort <expr>]
```

### `connect deployment describe`

Gets a deployment.

```bash title="Get a deployment"
commercetools connect deployment describe (--id <id> | --key <key>)
```

### `connect deployment create`

Creates a deployment of a connector.

```bash title="Create a deployment"
commercetools connect deployment create 
  [--key <key>] 
  (--connector-id <id> | --connector-key <key>) 
  --region <region> 
  [--connector-staged] 
  [--type preview|sandbox|production] 
  [--configuration <key=value>...]
```

| Flag | Description |
| --- | --- |
| `--key` | Key for the new deployment |
| `--connector-id` | ID of the connector to deploy |
| `--connector-key` | Key of the connector to deploy |
| `--connector-staged` | Deploy the staged version instead of the published version |
| `--type` | The type of the deployment: `preview`, `sandbox`, or `production` |
| `--region` | Target Region (for example, `europe-west1.gcp`) |
| `--configuration` | Configuration key-value pairs. Can be repeated. |

### `connect deployment redeploy`

Redeploys an existing deployment, optionally updating its connector version or configuration.

```bash title="Redeploy a deployment"
commercetools connect deployment redeploy 
  (--id <id> | --key <key>) 
  [--configuration <key=value>...] 
  [--update-connector] 
  [--skip-scripts]
```

| Flag | Description |
| --- | --- |
| `--configuration` | Updated configuration key-value pairs |
| `--update-connector` | Pull the latest version of the connector |
| `--skip-scripts` | Skip pre/post-deployment scripts |

### `connect deployment logs`

Retrieves logs for a deployment.

```bash title="Get deployment logs"
commercetools connect deployment logs 
  (--id <id> | --key <key>) 
  [--application <name>] 
  [--start-date <date>] 
  [--end-date <date>]
```

| Flag | Description |
| --- | --- |
| `--application` | Filter logs by application name |
| `--start-date` | Start date for log retrieval |
| `--end-date` | End date for log retrieval |

### `connect deployment delete`

Deletes a deployment.

```bash title="Delete a deployment"
commercetools connect deployment delete (--id <id> | --key <key>) [--yes] [--dry-run]
```

| Flag | Description |
| --- | --- |
| `--id` | Unique identifier of the deployment. Specify either `--id` or `--key`. |
| `--key` | User-defined unique identifier of the deployment. Specify either `--id` or `--key`. |
| `--yes`, `-y` | Skip the confirmation prompt. Required for non-interactive use, for example in CI or from an AI agent. |
| `--dry-run` | Show what would be deleted without deleting anything |

## Application utilities

These commands operate on the local application source code within a Connect project.

| Command | Description |
| --- | --- |
| `connect application add` | Adds a new application to an existing Connect project |
| `connect application build` | Builds a Connect application |
| `connect application start` | Starts a Connect application locally |
| `connect application test` | Runs tests for a Connect application |

## Workflow example

```bash title="Connector development workflow"
# 1. Scaffold a new connector
commercetools connect init my-connector

# 2. Develop and validate locally
cd my-connector
commercetools connect validate

# 3. Create a staged connector
commercetools connect connectorstaged create 
  --key my-connector 
  --name "My Connector" 
  --repository-url https://example.com/org/my-connector 
  --repository-tag v1.0.0 
  --creator-email dev@example.com

# 4. Preview the staged connector (validates it and creates a preview deployment)
commercetools connect connectorstaged preview 
  --key my-connector 
  --deployment-key my-connector-preview 
  --region europe-west1.gcp

# 5. Deploy to a Project
commercetools connect deployment create 
  --key my-connector-prod 
  --connector-key my-connector 
  --region europe-west1.gcp 
  --configuration "API_KEY=abc123"

# 6. Check logs
commercetools connect deployment logs --key my-connector-prod
```

## Related pages

- [Area overview page with navigation](/dev-tooling.md)
- [Previous page: Commerce Integration Layer](/dev-tooling/cli/integration-layer.md)
- [Next page: Import](/dev-tooling/cli/import.md)
- [Search documentation and API specs](/search.md)