- On Dify Cloud, follow the Cloud CLI docs instead.
- If you used
difyctlbefore your server moved to Dify 1.18.0, its commands and sign-in have changed, so start from Upgrade Across Dify 1.18.0.
Before You Start
- Your Dify server runs version 1.18.0 or later. If it runs 1.17.x or earlier, use the docs for that Dify version.
OPENAPI_ENABLEDandENABLE_OAUTH_BEARERare set totrueon your server.
Install
brew install dify gets you Dify’s plugin development CLI, not difyctl.1
Run the Installer
- macOS / Linux
- Windows
- Manual Download
Supported on x64 and arm64.This installs the build from the latest Dify release. If your server runs an older one, set The script checks the download’s checksum and installs to
DIFY_VERSION to its version:~/.local/bin/difyctl.2
Verify the Install
command not found, the install directory isn’t on your PATH. Add it:Sign In
difyctl signs in through your browser. A sign-in lasts 14 days by default (adjustable with OAUTH_TTL_DAYS).
1
Start the Sign-In
Pass the address you open Dify at in your browser:If no browser opens, for example over SSH, open the URL
difyctl prints on any device.For a local server on http:// or with a self-signed certificate, add --insecure. It applies to every later command until you sign in again without it, so keep it to local development.2
Approve in Your Browser
On the Authorize difyctl page, enter the code and click Continue. The code expires after 15 minutes.When the page shows your account, check it before you click Authorize.
difyctl and your coding agent will act as this account and can do anything it can. If it’s not the account you want, click Cancel, sign in to Dify as the right one, and start the sign-in again.List Your Apps
Check thatdifyctl works by listing the apps in your workspace:
Set Up Your Coding Agent
Thedifyctl skill teaches your coding agent to use difyctl. Install it into the skills folder of each coding agent you use:
Keep Control of Commands and Keys
Keep your agent’s own approval for shell commands turned on:difyctl runs each command without asking first. The skill tells your agent to check with you before it deletes anything, installs an integration, or publishes an app. Whether it does depends on the AI model your agent runs on.
Anything you type into the chat, such as a model provider’s API key, passes through your agent’s model. To keep a key out of it, add the key in Dify yourself before the agent needs it, or tell the agent you’ll add it yourself when it asks.
Find Commands Yourself
Describe the job tohelp in a few words, and it lists the commands that match. For example, to find the command that publishes an app:
difyctl help. For how to pass values to a command and follow the hints in its results, see Find and Run Commands.
Next Steps
Ask your agent for any of these, or do them yourself:- Build, change, and publish Workflow and Chatflow apps
- Run your apps
- Create or update apps from DSL files
- Use
difyctlin CI and automation