After you sign in, difyctl saves your workspace and runs every command against it. For the full resolution order, see How difyctl Picks a Workspace.
difyctl get workspace shows the workspace you belong to, and accepts the global flags.
Show Your Workspace
difyctl get workspace [flags]
Flags
| Flag | Type | Default | Description |
|---|
-o <format> | string | none | Output format: json, yaml, name, or wide. Omit the flag for the default table. |
Examples
See your workspace:
Get it as JSON for scripts:
difyctl get workspace -o json
Print the workspace ID only:
difyctl get workspace -o name
Output
| Format | What stdout gets |
|---|
| default | An aligned table. CURRENT marks your active workspace with *, and ROLE is your role. |
-o wide | The same columns. Workspaces have no wide-only columns. |
-o json, -o yaml | A workspaces array, each entry carrying id, name, role, status, and current. |
-o name | The workspace ID. |
Default table:
ID NAME ROLE STATUS CURRENT
b4e8d2a6-7c3f-4a1e-9d5b-8f2c6e0a4d7b Acme Team owner normal *
-o json:
{
"workspaces": [
{
"id": "b4e8d2a6-7c3f-4a1e-9d5b-8f2c6e0a4d7b",
"name": "Acme Team",
"role": "owner",
"status": "normal",
"current": true
}
]
}
Exit Codes
| Code | Meaning |
|---|
0 | Success |
1 | Network or server error |
2 | Usage error, such as an unsupported -o value |
4 | Authentication failure |
7 | Rate limited (HTTP 429) |
See Output Formats and Exit Codes for the full scheme.
How difyctl Picks a Workspace
Apps live in exactly one workspace, so every command runs against one. Normally that’s the workspace saved when you signed in. difyctl resolves it in this order, taking the first value it finds:
- The
DIFY_WORKSPACE_ID environment variable, an optional override.
- Your stored default, written to
hosts.yml in the config directory when you sign in.
If neither yields a workspace, the command fails with exit code 2.
Workspace IDs are UUIDs, so use the ID from get workspace, not a workspace name. A value that isn’t a UUID fails as a usage error. Last modified on June 25, 2026