langgenius/dify · error · BaseError

ErrorCode.UsageMissingArg

ErrorCode.UsageMissingArg

Error message

no workspace selected

What it means

Error "no workspace selected" thrown in langgenius/dify.

Source

Thrown at cli/src/workspace/resolver.ts:45

    if (!isValidUuid(inputs.env))
      throw new BaseError({
        code: ErrorCode.UsageInvalidFlag,
        message: `DIFY_WORKSPACE_ID value ${JSON.stringify(inputs.env)} is not a valid UUID`,
      })
    return inputs.env
  }
  const wsId = inputs.active?.ctx.workspace?.id
  if (truthy(wsId)) {
    if (!isValidUuid(wsId)) {
      throw new BaseError({
        code: ErrorCode.UsageInvalidFlag,
        message: `stored workspace ID ${JSON.stringify(wsId)} is not a valid UUID`,
        hint: "run 'difyctl use workspace' to update your active workspace",
      })
    }
    return wsId
  }
  throw new BaseError({
    code: ErrorCode.UsageMissingArg,
    message: 'no workspace selected',
    hint: "pass --workspace, set DIFY_WORKSPACE_ID, or run 'difyctl use workspace <id>'",
  })
}

function truthy(v: string | undefined): v is string {
  return v !== undefined && v !== ''
}

View on GitHub (pinned to ef8544b173)

When it happens

Trigger: Thrown at cli/src/workspace/resolver.ts:45 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of langgenius/dify@ef8544b173 (2026-08-12). Data as JSON: /api/errors/d75af4f95ea0224d. Report an issue: GitHub.