{"record":{"id":"d75af4f95ea0224d","repo":"langgenius/dify","slug":"errorcode-usagemissingarg","errorCode":"ErrorCode.UsageMissingArg","errorMessage":"no workspace selected","messagePattern":"no workspace selected","errorType":"exception","errorClass":"BaseError","httpStatus":null,"severity":"error","filePath":"cli/src/workspace/resolver.ts","lineNumber":45,"sourceCode":"    if (!isValidUuid(inputs.env))\n      throw new BaseError({\n        code: ErrorCode.UsageInvalidFlag,\n        message: `DIFY_WORKSPACE_ID value ${JSON.stringify(inputs.env)} is not a valid UUID`,\n      })\n    return inputs.env\n  }\n  const wsId = inputs.active?.ctx.workspace?.id\n  if (truthy(wsId)) {\n    if (!isValidUuid(wsId)) {\n      throw new BaseError({\n        code: ErrorCode.UsageInvalidFlag,\n        message: `stored workspace ID ${JSON.stringify(wsId)} is not a valid UUID`,\n        hint: \"run 'difyctl use workspace' to update your active workspace\",\n      })\n    }\n    return wsId\n  }\n  throw new BaseError({\n    code: ErrorCode.UsageMissingArg,\n    message: 'no workspace selected',\n    hint: \"pass --workspace, set DIFY_WORKSPACE_ID, or run 'difyctl use workspace <id>'\",\n  })\n}\n\nfunction truthy(v: string | undefined): v is string {\n  return v !== undefined && v !== ''\n}\n","sourceCodeStart":27,"sourceCodeEnd":55,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/cli/src/workspace/resolver.ts#L27-L55","documentation":"Error \"no workspace selected\" thrown in langgenius/dify.","triggerScenarios":"Thrown at cli/src/workspace/resolver.ts:45 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}