Webflow CLI
The Webflow CLI streamlines the development process for creating Webflow Designer Extensions. Regularly check for updates to the CLI and the Designer Extension Type Definitions to ensure compatibility and take advantage of the latest features.
Prerequisites
Before installing the Webflow CLI, please be sure to have Node.js and npm installed.
Installation
To install the Webflow CLI, use the following npm command:
Commands Overview
There are the three primary commands you’ll use:
Starting Your Project
Strongly recommended. Always start your project with webflow extension init
.
This command will create a foundation tailored for Webflow Designer Extensions, and also ensures all necessary dependencies and configurations are installed correctly.
If you choose not to initialize your project with the above command, be sure to save the Designer Extension type definitions as a development dependency to take advantage of type checking and the autocomplete functionality of your IDE:
Designer Extension Templates
The CLI also supports initializing a Designer Extension to work with specific libraries and languages via a template, including React and TypeScript. To view all available templates, enter the following command:
After the project folder is created, navigate into the folder and run npm install
to install all dependencies needed for your template.
Running your Designer Extension Locally
Before you can publish your extension, you need to build it with the Webflow CLI. This process compiles your code into a format that can be executed by the browser. Building your extension will create a file named bundle.zip, which contains the built version of your extension.
If you’ve built your project using the webflow extension init command, you can build your code using npm:
Otherwise, navigate to your project folder and use the following CLI command:
Working with Frameworks
For frameworks that generate browser-ready file structures (i.e. Next.js), build using the framework first. Then, process the output using webflow extension bundle. Consider adding this as a script in your package.json file. See our guide for more information on successfully working with frameworks.
Now that you’ve built your Designer Extension, it’s time to share it! Refer to our guide on uploading your Designer Extension, and publishing to the Webflow Marketplace.