Install Options#
Set these variables on the install command:
| Variable | Description | Example |
|---|---|---|
DIFY_VERSION | The Dify release to install difyctl from. Set it to your server’s version.Defaults to the latest Dify release. | 1.18.0 |
DIFYCTL_PREFIX | The install directory. The binary lands in <prefix>/bin. Add that folder to your PATH if it isn’t on it.Defaults to ~/.local on macOS and Linux, %LOCALAPPDATA%\difyctl on Windows. | $HOME/tools |
GITHUB_TOKEN or GH_TOKEN | A GitHub token. It needs no scopes. Set it if the installer stops at GitHub’s limit of 60 requests per hour, which everyone behind the same IP address shares. |
For example, to install the build for Dify 1.18.0 into ~/tools/bin:
Environment Variables#
Set these variables in the shell or job that runs difyctl:
| Variable | Description |
|---|---|
DIFY_CONFIG_DIR | The config folder to use instead of the default one. Set it to stay signed in to several servers at once, one folder each. |
DIFY_OUTPUT | The format of errors and help output: json or text. Without it, they’re text in a terminal and JSON when sent to a file or another program. Results are always JSON. Set DIFY_OUTPUT=json in scripts so errors are JSON wherever they run.--json wins over DIFY_OUTPUT=text. |
DIFY_SERVER | The address of the server to send commands to, such as https://dify.example.com. Used only together with DIFY_TOKEN. |
DIFY_TOKEN | The token from a difyctl sign-in. Set it with DIFY_SERVER and DIFY_WORKSPACE_ID, and commands use them instead of your saved sign-in. While DIFY_TOKEN is set, login and logout refuse to run.Without DIFY_SERVER, commands fail with exit code 2. Without DIFY_WORKSPACE_ID, commands that work in a workspace fail.To get a token for a job and keep it safe, see Use difyctl in CI and Automation. |
DIFY_WORKSPACE_ID | The ID of the workspace for commands that work in one, such as get console_app. difyctl get workspace lists it as id. Set it whenever you set DIFY_TOKEN: a sign-in from variables has no saved workspace.--workspace-id wins over this variable, and this variable wins over your saved sign-in’s workspace. |
HTTP_PROXY, HTTPS_PROXY, NO_PROXY | The proxy to send difyctl’s requests through: HTTPS_PROXY for an https:// server, HTTP_PROXY for an http:// one. The lowercase http_proxy and https_proxy work too.To skip the proxy for a server, such as an internal one, put its host in NO_PROXY (or no_proxy). |
NO_COLOR | Set it to any value, such as 1, to turn off colors in terminal text. |
Settings#
http.timeout sets how long, in milliseconds, difyctl waits for the server to start responding before the command fails. The default is 30000.
Raise it if commands time out on a slow server or network, or while sending large files. It limits only the wait for the server’s first response, not how long the command takes. So an app run that lasts several minutes, with or without --stream, doesn’t need a higher value.
To change it, for example to 60 seconds:
To put it back to its default, run difyctl unset config http.timeout. To see your settings and the file they’re saved in, run difyctl get config.
Files difyctl Keeps#
difyctl keeps these files in its config folder:
| File | Holds |
|---|---|
login.yml | Your saved sign-in: the server, account, and workspace, and where your token is kept. |
login-pending.yml | A sign-in started with login --no-wait, until login --resume finishes it. |
tokens.yml | Your token, when it’s kept in a file instead of the OS keychain. |
config.yml | Your settings, once you’ve changed one. |
catalog/<server>.json | The saved command list for each server you use. Safe to delete: the next command fetches it again. |