Skip to main content
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

FlagTypeDefaultDescription
-o <format>stringnoneOutput format: json, yaml, name, or wide. Omit the flag for the default table.

Examples

See your workspace:
difyctl get workspace
Get it as JSON for scripts:
difyctl get workspace -o json
Print the workspace ID only:
difyctl get workspace -o name

Output

FormatWhat stdout gets
defaultAn aligned table. CURRENT marks your active workspace with *, and ROLE is your role.
-o wideThe same columns. Workspaces have no wide-only columns.
-o json, -o yamlA workspaces array, each entry carrying id, name, role, status, and current.
-o nameThe 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

CodeMeaning
0Success
1Network or server error
2Usage error, such as an unsupported -o value
4Authentication failure
7Rate 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:
  1. The DIFY_WORKSPACE_ID environment variable, an optional override.
  2. 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