Files
dify-docs/en/cli/reference/environment-variables.mdx
Riskey 2f88f0f7d2 docs: sync Cloud documentation for Dify 1.15.0 (#835)
* docs: add Human Input file inputs and Service API to Cloud docs

Port the Phase 2 Human Input docs (file inputs and the Service API integration flow) to the Cloud docs, mirroring the self-host pages.

- human-input.mdx (en/zh/ja): add the Single File / File List field type and the file-handling notes; the upload-limit callout states Cloud's fixed limits (documents 15 MB, images 10 MB, audio 50 MB, video 100 MB, up to 10 files) instead of self-host env vars.
- hitl-api-integration-flow.mdx (en/zh/ja): new; identical to self-host since the Service API is the same.
- docs.json: nest the integration-flow under the Human Input group in all three navs.
- zh/ja reuse the self-host translations; only the callout and the /self-host/ links changed.

* docs: rewrite Cloud model providers around AI Credits

* docs: rewrite Cloud subscription management for 1.15.0

* docs: update Cloud code node limits and XLSX image extraction note

* docs: rewrite Cloud team members management for 1.15.0

* docs: apply the 1.15.0 Integrations redesign to Cloud docs

* docs: fix workflow API reference for run-level logs and streaming

* docs: sync self-host use-dify pages and fix translation debt

* docs: align shared tutorials and quick start with 1.15.0

* docs: refine difyctl install examples and workspace reference

* docs: rewrite hotkeys page to match current shortcuts

* fix: correct broken anchor links for badged headings and tabs

* fix: correct env link and Human Input resume identifier

* feat: handle heading badges in link-checker slugs

* fix: repoint publish-mcp cross-links to the merged MCP section

* docs: rename plugin dev CLI to Dify Plugin CLI

* docs: refine CLI reference readability and expand --agent

* feat: stop format checkers flagging indented list-item content

* fix: correct zh/ja custom-endpoint spacing and a list blank line

* docs: clarify Cloud model provider install and AI Credits coverage
2026-07-02 19:51:55 +08:00

92 lines
3.5 KiB
Plaintext

---
title: Environment Variables
description: Set difyctl defaults for the current shell session with environment variables
---
Environment variables set defaults for the current shell session: every `difyctl` command you run in it picks them up. A command flag wins, then an environment variable. They're shell-scoped and last only as long as the session.
## Variables difyctl Reads
| Variable | What it controls | Default |
|:---|:---|:---|
| `DIFY_CONFIG_DIR` | Where `difyctl` keeps its configuration (`hosts.yml`). | macOS and Linux: `~/.config/difyctl` (Linux honors `XDG_CONFIG_HOME`)<br></br><br></br>Windows: `%APPDATA%\difyctl` |
| `DIFY_LIMIT` | Default page size, 1 to 200, for list commands (`get app`, `auth devices list`). The `--limit` flag wins, then this variable. | `20` |
| `DIFY_WORKSPACE_ID` | The workspace `difyctl` commands run against. Must be a UUID. See [How difyctl Picks a Workspace](/en/cli/reference/workspaces#how-difyctl-picks-a-workspace) for the resolution order. | none |
| `DIFYCTL_HTTP_RETRY` | Retry attempts for idempotent requests on transient failures (`0` disables retries). [`--http-retry`](/en/cli/reference/global-flags#http-retries) overrides it. | `3` |
An invalid value fails as a usage error (exit code `2`) rather than being silently ignored, for example a non-UUID `DIFY_WORKSPACE_ID`.
<Info>
Only the variables above change `difyctl`'s behavior. The others reported by the `env list` command are recognized but currently have no effect.
</Info>
## See What's Set
```text
difyctl env list [flags]
```
`env list` shows the current value of each `difyctl` environment variable in your shell. It reads only your local environment and never calls the server, so it works before you sign in.
### Flags
| Flag | Type | Default | Description |
|:---|:---|:---|:---|
| `--json` | boolean | `false` | Print the inventory as a JSON array instead of a table. |
<Note>
`env list` takes `--json`, not the [`-o` global flag](/en/cli/reference/global-flags).
</Note>
### Examples
Check which variables are set in the current shell:
```bash
difyctl env list
```
Get the same inventory as JSON:
```bash
difyctl env list --json
```
### Output
Unset variables show `<unset>`, and sensitive variables never print their value (only `<set>` or `<unset>`). With `DIFY_LIMIT=50` exported:
```text
NAME VALUE DESCRIPTION
DIFY_CONFIG_DIR <unset> Override the config-dir resolution (precedes XDG_CONFIG_HOME on Linux).
DIFY_FORMAT <unset> Default output format for list commands (table | json | yaml | wide | name).
DIFY_HOST <unset> Default Dify host (overridden by --host).
DIFY_LIMIT 50 Default page size for list commands (1..200).
DIFY_NO_PROGRESS <unset> Suppress progress spinners. Truthy values: 1, true, yes.
DIFY_PLAIN <unset> Disable ANSI colors and decorative output. Truthy values: 1, true, yes.
DIFY_TOKEN <unset> Bearer token for non-interactive auth.
DIFY_WORKSPACE_ID <unset> Workspace ID used for difyctl commands.
DIFYCTL_HTTP_RETRY <unset> HTTP retry count for GET/PUT/DELETE. 0 disables. Overrides --http-retry flag.
```
`--json` prints a JSON array, one entry per variable, masked the same way:
```json
[
{
"name": "DIFY_CONFIG_DIR",
"description": "Override the config-dir resolution (precedes XDG_CONFIG_HOME on Linux).",
"sensitive": false,
"value": "<unset>"
}
]
```
### Exit Codes
| Code | Meaning |
|:---|:---|
| `0` | Success |
See [Output Formats and Exit Codes](/en/cli/reference/output-formats-and-exit-codes) for the full scheme.