Skip to main content
The Dify Plugin CLI manages your plugin development workflow, from project initialization to packaging. This guide covers installing the CLI, scaffolding a plugin project, and running it against a Dify instance.
This is the Dify Plugin CLI (the dify command) for building plugins. It is not the Dify CLI (difyctl), which runs and manages Dify apps from the command line.

Prerequisites

Before you begin, make sure you have:
  • Python 3.12
  • Homebrew (macOS only, used to install the CLI)

Install the CLI

Verify the installation:

Create a Plugin Project

Create a new plugin project with:
Fill in the required fields when prompted:
Choose python and press Enter to use the Python plugin template, then select the type of plugin you want to build:
When prompted for the minimal Dify version, leave it blank to use the latest version:
The CLI creates a new directory named after your plugin and sets up the basic project structure. Move into it:

Run the Plugin

From the hello-world directory, copy the example environment file:
Edit the .env file to set your plugin’s environment variables, such as API keys or other configurations. To get the debugging credentials, log in to your Dify environment, click Plugins in the top-right corner, then click the debug icon. In the pop-up window, copy the API Key and Host Address.
REMOTE_INSTALL_URL combines host and port in host:port form. The host and port are shown together in the API Key card on the Plugins page.
Install the dependencies and run your plugin:
Last modified on July 2, 2026