> This page is for DevLink.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.webflow.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.webflow.com/_mcp/server.

# Webflow CLI

> Learn about the Webflow CLI and DevLink.

The [Webflow CLI](/cli/reference/webflow-cli) is the command line interface for developers to interact with Webflow. Use the CLI to manage DevLink by:

* Authenticating with your Webflow workspace or site
* Bundling components into importable libraries
* Exporting components from Webflow
* Importing components into Webflow

You can use the CLI directly in your project or in CI/CD pipelines to automate library imports.

## Installation

The Webflow CLI is available as a package on npm. You can install it to your project with the following command:

```bash
npm install -D @webflow/webflow-cli@latest
```

DevLink Export requires `@webflow/webflow-cli` v1.19.0 or later, running on Node.js v22 or higher.

## Commands

### Export

Export Webflow components to your local React project. The first run walks you through an interactive setup and saves your settings to `webflow.json`, so subsequent runs — manual or in CI — execute without prompts.

```bash
webflow devlink export
```

This command will:

* **Authorize the site:** The CLI reads `WEBFLOW_API_TOKEN` from your `.env` file. If it isn't set, the CLI opens a browser window for OAuth.
* **Resolve the site:** The CLI reads `siteId` from `webflow.json` (or `WEBFLOW_SITE_ID` from your `.env` file as a fallback). If neither is set, the CLI prompts you to pick a site from the workspaces the token can access and writes the choice back to `webflow.json`.
* **Resolve the export configuration:** On a first run with no `devlink-export` block in `webflow.json`, the CLI prompts you for each field and writes the result back. On subsequent runs, the saved configuration is reused without prompts.
* **Fetch and write components:** The CLI exports the components matching your manifest's `components` and `componentGroups` filters and writes them to `rootDir` (default: `./webflow`), along with the `DevLinkProvider`, generated CSS, and shared modules.

#### Options

| Command Option         | Description                                                                                                             | Default                                                                       |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `--api-token <token>`  | API token to use for the export.                                                                                        | Uses `WEBFLOW_API_TOKEN` from the `.env` file or the OAuth session.           |
| `-s, --site <site-id>` | Site ID to export from.                                                                                                 | Uses `siteId` from `webflow.json`, or `WEBFLOW_SITE_ID` from the `.env` file. |
| `--manifest <path>`    | Path to a `webflow.json` file or directory containing one.                                                              | Scans the current directory for `webflow.json`.                               |
| `--no-input`           | Skip interactive prompts. The export fails fast if any required configuration is missing. Use this for CI/CD pipelines. | Interactive                                                                   |
| `--skip-update-check`  | Skip checking for updates to `@webflow` packages.                                                                       | Off                                                                           |
| `--verbose`            | Display additional logs for debugging.                                                                                  | Off                                                                           |

See [Configuration options](/devlink/docs/component-export/installation#configuration-options) for the full list of `webflow.json` fields the export reads.

#### Example: CI/CD usage

In automated workflows, commit your `webflow.json` and pass the token via environment variable so the export runs unattended:

```bash
WEBFLOW_API_TOKEN=$WEBFLOW_API_TOKEN webflow devlink export --no-input
```

#### Example: Scoped export

To export a subset of components, set the `components` and/or `componentGroups` regex filters in `webflow.json` before running. For example, to export only buttons and cards:

**`webflow.json`**

```json title="webflow.json"
{
  "siteId": "<your-site-id>",
  "devlink-export": {
    "rootDir": "./webflow",
    "components": "^(Button|Card).*$"
  }
}
```

### Sync

> **Deprecated**
>
> `webflow devlink sync` is deprecated and removed. Use [`webflow devlink export`](#export) instead. If you're upgrading an older project, see [Migrating to DevLink Export](/devlink/docs/reference/migrate-from-sync).

### Import

To share your library to your Workspace, use the following command:

```bash
webflow devlink import
```

This command will:

* **Authorize your workspace:** The CLI will check for a Workspace authentication token in your `.env` file. If one isn't found, the CLI will prompt you to authenticate by opening a browser window to the Workspace authorization page.
* **Bundle your library:** The CLI will bundle your library, and ask you to confirm the components you want to share.
* **Upload your library to your Workspace**

#### Options

You can use the following options to customize sharing:

| Command Option        | Description                                                                                    | Default                                         |
| --------------------- | ---------------------------------------------------------------------------------------------- | ----------------------------------------------- |
| `--api-token <token>` | Pass a Workspace API token.                                                                    | Uses `WEBFLOW_API_TOKEN` from the `.env` file.  |
| `-f`, `--force`       | Force the bundler to finish compiling, even if there are warnings or type errors.              | Off                                             |
| `--debug-bundler`     | Display the final bundler configurations for debugging purposes.                               | Off                                             |
| `--dev`               | Bundle in development mode for debugging purposes. This disables minification and source maps. | Off                                             |
| `--no-input`          | Avoid prompting or doing anything interactive. Use this for CI/CD pipelines.                   | Interactive                                     |
| `--manifest <path>`   | Path to a `webflow.json` file or directory containing one.                                     | Scans the current directory for `webflow.json`. |
| `--skip-update-check` | Skip checking for updates to `@webflow` packages.                                              | Off                                             |
| `--verbose`           | Display more information for debugging purposes.                                               | Off                                             |

### Bundle

Bundle your library locally for debugging and testing. The `import` command automatically bundles your library, but you can use `bundle` for local development.

```bash
webflow devlink bundle --public-path http://localhost:4000/
```

#### Options

| Command Option         | Description                                                                                    | Default                                         |
| ---------------------- | ---------------------------------------------------------------------------------------------- | ----------------------------------------------- |
| `--public-path <path>` | Required. The URL where you can serve your library.                                            | None                                            |
| `--output-path <path>` | Override the output path for the bundle.                                                       | `./dist`                                        |
| `-f`, `--force`        | Force the bundler to finish compiling, even if there are warnings or type errors.              | Off                                             |
| `--debug-bundler`      | Display the final bundler configurations for debugging purposes.                               | Off                                             |
| `--dev`                | Bundle in development mode for debugging purposes. This disables minification and source maps. | Off                                             |
| `--no-input`           | Avoid prompting or doing anything interactive. Use this for CI/CD pipelines.                   | Interactive                                     |
| `--manifest <path>`    | Path to a `webflow.json` file or directory containing one.                                     | Scans the current directory for `webflow.json`. |
| `--skip-update-check`  | Skip checking for updates to `@webflow` packages.                                              | Off                                             |
| `--verbose`            | Display more information for debugging purposes.                                               | Off                                             |

### Log

Get the logs with debug information for your last library import.

```bash
webflow log
```

## CI/CD workflows

Use the CLI in automated workflows by adding the `--no-input` option to avoid interactive prompts.

DevLink commands return `0` on success and a non-zero exit code on failure. Check for any non-zero exit code to stop your pipeline when a command fails.

With `--force`, bundling continues even if there are warnings or type errors. Omit this option to fail on type errors.

**Important:** Implement change detection before sharing to avoid unintentionally removing components:

* Compare current library state with previous import
* Only share when components have actually changed

```bash
webflow devlink import --no-input
```

## Troubleshooting

#### Authentication

If you're having trouble authenticating with your Workspace, try the following:

* Check your `.env` file for the `WEBFLOW_API_TOKEN` variable. Be sure to use a Workspace API token, not a Site API token.

* Try running the share command with the `--verbose` flag to see if there is additional information in the output.
  ```bash
  webflow devlink import --verbose
  ```

* If you're still having trouble, try running the share command with the `--api-token` flag to manually pass in your API token.
  ```bash
  webflow devlink import --api-token <your-api-token>
  ```

#### Prompts for component removal

If the CLI is warning you that you're about to remove components, it's because the CLI is comparing the current library state with the previous import. Be sure your component name matches the name in the previous . Otherwise, the CLI will create a new component and remove the old one.