{"record":{"id":"cb2e949568094564","repo":"jackwener/OpenCLI","slug":"config-cb2e94","errorCode":"CONFIG","errorMessage":"team UUID required","messagePattern":"team UUID required","errorType":"error_code","errorClass":"CliError","httpStatus":null,"severity":"error","filePath":"clis/ones/my-tasks.js","lineNumber":76,"sourceCode":"            type: 'int',\n            default: 100,\n            help: 'Max rows (default 100, max 500)',\n        },\n        {\n            name: 'mode',\n            type: 'str',\n            default: 'assign',\n            choices: ['assign', 'field004', 'owner', 'both'],\n            help: 'assign=负责人(顶层 assign)；field004=负责人(筛选器示例里的 field004)；owner=创建者；both=负责人∪创建者(两次 peek 去重)',\n        },\n    ],\n    columns: ['title', 'status', 'project', 'uuid', 'updated', '工时'],\n    func: async (page, kwargs) => {\n        const team = kwargs.team?.trim() ||\n            process.env.ONES_TEAM_UUID?.trim() ||\n            process.env.ONES_TEAM_ID?.trim();\n        if (!team) {\n            throw new CliError('CONFIG', 'team UUID required', 'Pass team from URL …/team/<team>/… or set ONES_TEAM_UUID.');\n        }\n        const limit = parsePeekLimit(kwargs.limit, 100);\n        const mode = String(kwargs.mode ?? 'assign');\n        await gotoOnesHome(page);\n        const userUuid = await resolveOnesUserUuid(page, { skipGoto: true });\n        let entries = [];\n        if (mode === 'both') {\n            const cap = Math.min(500, limit * 2);\n            const asAssign = await peekTasks(page, team, queryAssign(userUuid), cap);\n            const asOwner = await peekTasks(page, team, queryOwner(userUuid), cap);\n            entries = dedupeByUuid([...asAssign, ...asOwner]).slice(0, limit);\n        }\n        else {\n            const queryByMode = () => {\n                switch (mode) {\n                    case 'field004':\n                        return queryAssignField004(userUuid);\n                    case 'owner':","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/ones/my-tasks.js#L58-L94","documentation":"The `opencli ones my-tasks` command requires a team UUID to scope the filters/peek query. It resolves it from --team, ONES_TEAM_UUID, or ONES_TEAM_ID; if all are empty it throws CONFIG before any network activity. The team uuid appears in ONES web URLs as …/team/<team>/…. ","triggerScenarios":"Running `opencli ones my-tasks` with no --team flag and neither ONES_TEAM_UUID nor ONES_TEAM_ID exported.","commonSituations":"First-time setup where only ONES_BASE_URL was configured; team uuid exported under a different variable name; whitespace-only value (trimmed to empty); forgetting that team uuid (a short id from the URL) differs from the user uuid.","solutions":["Pass --team <teamUUID>, copying the segment from your ONES URL …/team/<team>/….","Export ONES_TEAM_UUID in your shell profile so all ONES commands inherit it.","Confirm the value is non-empty after trimming and is the team id, not the user uuid."],"exampleFix":"// before\nopencli ones my-tasks\n// after\nexport ONES_TEAM_UUID='AbCd1234'\nopencli ones my-tasks","handlingStrategy":"validation","validationCode":"const team = process.env.ONES_TEAM_UUID?.trim() || process.env.ONES_TEAM_ID?.trim();\nif (!team) {\n  throw new Error('Set ONES_TEAM_UUID (from your ONES URL …/team/<team>/…) before running my-tasks commands.');\n}","typeGuard":null,"tryCatchPattern":"try {\n  const rows = await opencli.ones.myTasks({});\n} catch (e) {\n  if (e.code === 'CONFIG' && e.message === 'team UUID required') {\n    console.error('Pass --team <teamUUID> or export ONES_TEAM_UUID.');\n  } else throw e;\n}","preventionTips":["Add ONES_TEAM_UUID to your shell profile during initial ONES CLI setup.","Copy the team id directly from the …/team/<team>/… URL segment.","Do not confuse the team uuid with the user uuid."],"tags":["config","cli","missing-argument","ones"],"backgroundTag":"missing-env-var","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}