jackwener/OpenCLI · error · CliError

CONFIG

CONFIG

Error message

team UUID required

What it means

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.

Source

Thrown at clis/ones/tasks.js:62

            name: 'assign',
            type: 'str',
            required: false,
            help: 'Filter by assignee user UUID (负责人 assign)',
        },
        {
            name: 'limit',
            type: 'int',
            default: 30,
            help: 'Max rows after flattening groups (default 30)',
        },
    ],
    columns: ['title', 'status', 'project', 'uuid', 'updated', '工时'],
    func: async (page, kwargs) => {
        const team = kwargs.team?.trim() ||
            process.env.ONES_TEAM_UUID?.trim() ||
            process.env.ONES_TEAM_ID?.trim();
        if (!team) {
            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).');
        }
        const project = kwargs.project?.trim();
        const assign = kwargs.assign?.trim();
        const limit = parsePeekLimit(kwargs.limit, 30);
        await gotoOnesHome(page);
        const body = defaultPeekBody(buildQuery(project, assign));
        const path = `team/${team}/filters/peek`;
        const parsed = (await onesFetchInPage(page, path, {
            method: 'POST',
            body: JSON.stringify(body),
            skipGoto: true,
        }));
        const entries = flattenPeekGroups(parsed, limit);
        const enriched = await enrichPeekEntriesWithDetails(page, team, entries, true);
        const labels = await resolveTaskListLabels(page, team, enriched, true);
        return enriched.map((e) => mapTaskEntry(e, labels));
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Pass the team UUID as the first argument or via --team <teamUUID>.
  2. Export ONES_TEAM_UUID=<teamUUID> in your environment.
  3. Get the UUID via `opencli ones token-info -f json` → teams[].uuid.

Example fix

// before
opencli ones tasks            // no team
// after
opencli ones tasks 9f8b...c21 # or: export ONES_TEAM_UUID=9f8b...c21
Defensive patterns

Strategy: validation

Validate before calling

const team = process.env.ONES_TEAM_UUID?.trim();
if (!team) { console.error('Usage: opencli ones tasks <teamUUID>'); process.exit(2); }

Type guard

function hasTeamArg(args) { return typeof args[0] === 'string' && /^[0-9a-f-]{8,}$/i.test(args[0].trim()); }

Try / catch

try {
  const rows = await opencli.ones.tasks(team);
} catch (e) {
  if (e.code === 'CONFIG') { console.error('Provide team UUID (teams[].uuid from token-info).'); }
  else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "X is required", "must be set", "cannot be empty": the missing-required-config error family, from Vertex AI project/location to WeChat keys — this error's family across 18 libraries.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/7e56d9d27c6f293e. Report an issue: GitHub.