The Webflow CLI is the command line interface for developers to interact with Webflow. Use the CLI to manage DevLink by:
You can use the CLI directly in your project or in CI/CD pipelines to automate library imports.
The Webflow CLI is available as a package on npm. You can install it to your project with the following command:
DevLink Export requires @webflow/webflow-cli v1.19.0 or later, running on Node.js v22 or higher.
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.
This command will:
WEBFLOW_API_TOKEN from your .env file. If it isn’t set, the CLI opens a browser window for OAuth.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.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.components and componentGroups filters and writes them to rootDir (default: ./webflow), along with the DevLinkProvider, generated CSS, and shared modules.See Configuration options for the full list of webflow.json fields the export reads.
In automated workflows, commit your webflow.json and pass the token via environment variable so the export runs unattended:
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:
Sync Webflow components to your local filesystem using the configuration saved in webflow.json.
By default, all components are synced. To sync specific components, pass their names as arguments:
To share your library to your Workspace, use the following command:
This command will:
.env file. If one isn’t found, the CLI will prompt you to authenticate by opening a browser window to the Workspace authorization page.You can use the following options to customize sharing:
Bundle your library locally for debugging and testing. The import command automatically bundles your library, but you can use bundle for local development.
Get the logs with debug information for your last library import.
Use the CLI in automated workflows by adding the --no-input option to avoid interactive prompts.
Important: Implement change detection before sharing to avoid unintentionally removing components:
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.
If you’re still having trouble, try running the share command with the --api-token flag to manually pass in your API token.
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.