{"record":{"id":"16b5323053186bdb","repo":"nexu-io/open-design","slug":"schedule-kind-must-be-hourly-daily-weekdays-week","errorCode":null,"errorMessage":"--schedule kind must be hourly|daily|weekdays|weekly (got \"${kind}\")","messagePattern":"--schedule kind must be hourly\\|daily\\|weekdays\\|weekly \\(got \"(.+?)\"\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/cli.ts","lineNumber":10538,"sourceCode":"      throw new Error('--schedule weekly requires :DAY:HH:MM[:TZ] (DAY is 0-6 or sun/mon/...)');\n    }\n    const dayToken = String(parts[1]).toLowerCase();\n    let weekday;\n    if (/^[0-6]$/.test(dayToken)) {\n      weekday = Number(dayToken);\n    } else if (AUTOMATION_WEEKDAY_TOKENS[dayToken] !== undefined) {\n      weekday = AUTOMATION_WEEKDAY_TOKENS[dayToken];\n    } else {\n      throw new Error(`--schedule weekly day must be 0-6 or sun..sat (got \"${parts[1]}\")`);\n    }\n    const time = `${parts[2].padStart(2, '0')}:${parts[3].padStart(2, '0')}`;\n    if (!/^[0-2]\\d:[0-5]\\d$/.test(time)) {\n      throw new Error('--schedule weekly time must be HH:MM (24h)');\n    }\n    const timezone = parts.slice(4).join(':') || 'UTC';\n    return { kind: 'weekly', weekday, time, timezone };\n  }\n  throw new Error(`--schedule kind must be hourly|daily|weekdays|weekly (got \"${kind}\")`);\n}\n\nfunction parseAutomationTarget(flags) {\n  const raw = flags.target;\n  if (raw == null) {\n    if (flags.project) return { mode: 'reuse', projectId: String(flags.project) };\n    return { mode: 'create_each_run' };\n  }\n  const value = String(raw);\n  if (\n    value === 'worktree' ||\n    value === 'new-project' ||\n    value === 'create-each-run' ||\n    value === 'create_each_run'\n  ) {\n    return { mode: 'create_each_run' };\n  }\n  if (value === 'reuse') {","sourceCodeStart":10520,"sourceCodeEnd":10556,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/cli.ts#L10520-L10556","documentation":"Thrown by parseScheduleFlag when the schedule kind — the first colon-separated segment — is not one of `hourly`, `daily`, `weekdays`, or `weekly`. This is the fall-through after all four kind branches have been checked, so the value is genuinely unrecognized rather than malformed for a known kind.","triggerScenarios":"Running `--schedule monthly:1:09:30`, `--schedule cron:0 9 * * *`, `--schedule once:2024-01-01T09:00:00`, or any typo like `--schedule dailt:09:30`.","commonSituations":"Expecting the CLI to support a cadence it does not (monthly, yearly, cron, one-shot), or misspelling a supported kind. There is no monthly/yearly/cron form.","solutions":["Use one of the supported kinds: hourly, daily, weekdays, or weekly.","For monthly cadence, approximate with weekly runs on the target weekdays, or run multiple weekly schedules.","Check the spelling of the kind prefix exactly (all lowercase)."],"exampleFix":"// before\n--schedule monthly:1:09:30\n// after\n--schedule weekly:1:09:30","handlingStrategy":"validation","validationCode":"const SCHEDULE_KINDS = new Set(['hourly','daily','weekdays','weekly']);\nfunction isKnownScheduleKind(raw: string): boolean {\n  const kind = raw.split(':')[0];\n  return SCHEDULE_KINDS.has(kind);\n}","typeGuard":null,"tryCatchPattern":"try {\n  parseScheduleFlag(raw);\n} catch (err) {\n  if (err instanceof Error && /kind must be hourly\\|daily/.test(err.message)) {\n    // offer the supported kinds to the user\n  }\n  throw err;\n}","preventionTips":["There is no monthly/yearly/cron/once form — plan accordingly.","Spell the kind prefix exactly and in lowercase."],"tags":["cli","validation","automation","schedule","flag-parsing"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}