{"record":{"id":"7e56d9d27c6f293e","repo":"jackwener/OpenCLI","slug":"config-7e56d9","errorCode":"CONFIG","errorMessage":"team UUID required","messagePattern":"team UUID required","errorType":"error_code","errorClass":"CliError","httpStatus":null,"severity":"error","filePath":"clis/ones/tasks.js","lineNumber":62,"sourceCode":"            name: 'assign',\n            type: 'str',\n            required: false,\n            help: 'Filter by assignee user UUID (负责人 assign)',\n        },\n        {\n            name: 'limit',\n            type: 'int',\n            default: 30,\n            help: 'Max rows after flattening groups (default 30)',\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 as first argument or set ONES_TEAM_UUID (see `opencli ones token-info -f json` → teams[].uuid).');\n        }\n        const project = kwargs.project?.trim();\n        const assign = kwargs.assign?.trim();\n        const limit = parsePeekLimit(kwargs.limit, 30);\n        await gotoOnesHome(page);\n        const body = defaultPeekBody(buildQuery(project, assign));\n        const path = `team/${team}/filters/peek`;\n        const parsed = (await onesFetchInPage(page, path, {\n            method: 'POST',\n            body: JSON.stringify(body),\n            skipGoto: true,\n        }));\n        const entries = flattenPeekGroups(parsed, limit);\n        const enriched = await enrichPeekEntriesWithDetails(page, team, entries, true);\n        const labels = await resolveTaskListLabels(page, team, enriched, true);\n        return enriched.map((e) => mapTaskEntry(e, labels));\n    },\n});","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/ones/tasks.js#L44-L80","documentation":"This CONFIG error is thrown by the ONES tasks listing command (clis/ones/tasks.js) when no team UUID is supplied. The command builds a team-scoped task query, so it resolves --team, ONES_TEAM_UUID, then ONES_TEAM_ID, and throws if all are empty.","triggerScenarios":"Calling the tasks list command without the team argument, with an empty/whitespace --team value, and with neither ONES_TEAM_UUID nor ONES_TEAM_ID exported.","commonSituations":"Fresh machines/CI runners without env setup; users passing a team name or project name where a UUID is expected; forgetting that this subcommand takes the team as its first argument.","solutions":["Pass the team UUID as the first argument or via --team <teamUUID>.","Export ONES_TEAM_UUID=<teamUUID> in your environment.","Get the UUID via `opencli ones token-info -f json` → teams[].uuid."],"exampleFix":"// before\nopencli ones tasks            // no team\n// after\nopencli ones tasks 9f8b...c21 # or: export ONES_TEAM_UUID=9f8b...c21","handlingStrategy":"validation","validationCode":"const team = process.env.ONES_TEAM_UUID?.trim();\nif (!team) { console.error('Usage: opencli ones tasks <teamUUID>'); process.exit(2); }","typeGuard":"function hasTeamArg(args) { return typeof args[0] === 'string' && /^[0-9a-f-]{8,}$/i.test(args[0].trim()); }","tryCatchPattern":"try {\n  const rows = await opencli.ones.tasks(team);\n} catch (e) {\n  if (e.code === 'CONFIG') { console.error('Provide team UUID (teams[].uuid from token-info).'); }\n  else throw e;\n}","preventionTips":["Always pass team as the first argument in scripts.","Set ONES_TEAM_UUID in CI as a secret.","Treat team names as display-only; use UUIDs everywhere."],"tags":["config","cli","missing-argument","ones"],"backgroundTag":"missing-required-config","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}