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
- Mac
- Linux
- Windows
Create a Plugin Project
Create a new plugin project with:python and press Enter to use the Python plugin template, then select the type of plugin you want to build:
Run the Plugin
From thehello-world directory, copy the example environment file:
.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.