{"record":{"id":"a8e8689b1011beb8","repo":"jackwener/OpenCLI","slug":"unknown-since-sincekey-valid-object-key","errorCode":null,"errorMessage":"Unknown --since \"${sinceKey}\". Valid: ${Object.keys(SINCE).join(', ')}","messagePattern":"Unknown --since \"(.+?)\"\\. Valid: (.+?)","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/github-trending/repos.js","lineNumber":117,"sourceCode":"cli({\n    site: 'github-trending',\n    name: 'repos',\n    access: 'read',\n    description: 'GitHub Trending repositories (public, no login). Filter by --language and --since.',\n    domain: 'github.com',\n    strategy: Strategy.PUBLIC,\n    browser: false,\n    args: [\n        { name: 'since', type: 'string', default: 'daily', help: 'Time range: daily / weekly / monthly' },\n        { name: 'language', type: 'string', default: '', help: 'Filter by programming language slug, e.g. python, rust, \"c++\"' },\n        { name: 'limit', type: 'int', default: 25, help: 'Number of repositories to return (max 25)' },\n    ],\n    columns: ['rank', 'repo', 'description', 'language', 'stars', 'forks', 'starsSince', 'url'],\n    func: async (args) => {\n        const sinceKey = String(args.since ?? 'daily').toLowerCase();\n        const since = SINCE[sinceKey];\n        if (!since) {\n            throw new ArgumentError(`Unknown --since \"${sinceKey}\". Valid: ${Object.keys(SINCE).join(', ')}`);\n        }\n\n        const n = Number(args.limit ?? 25);\n        if (!Number.isInteger(n) || n <= 0) {\n            throw new ArgumentError('--limit must be a positive integer');\n        }\n        if (n > 25) {\n            throw new ArgumentError('--limit must be <= 25 (GitHub Trending lists at most 25 repositories)');\n        }\n        const limit = n;\n\n        const language = String(args.language ?? '').trim();\n        const path = language ? `/trending/${encodeURIComponent(language)}` : '/trending';\n        const url = new URL(`https://github.com${path}`);\n        url.searchParams.set('since', since);\n\n        let resp;\n        try {","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/github-trending/repos.js#L99-L135","documentation":"The `opencli github-trending repos` command accepts a `--since` option that must be one of the keys in its SINCE map (daily/weekly/monthly). Any other value throws this ArgumentError listing the valid keys. It is an input-validation error thrown before any network request is made.","triggerScenarios":"Calling the command with `--since` set to a value not in SINCE — e.g. `--since day`, `--since Daily` handled only after lowercasing fails for other spellings like 'last-week', or an empty/garbage value.","commonSituations":"Guessing flag values instead of checking help output; scripting with a variable containing an unexpected default; typos like 'daiy' or 'week'; passing a date string ('2024-01-01') which the API does not support.","solutions":["Use one of the listed valid values, typically: daily, weekly, monthly (lowercase)","Run the command's help to see accepted --since values","In scripts, validate/normalize the since value against ['daily','weekly','monthly'] before invoking"],"exampleFix":"// before\nopencli github-trending repos --since last-week\n// after\nopencli github-trending repos --since weekly","handlingStrategy":"validation","validationCode":"const VALID_SINCE = ['daily', 'weekly', 'monthly'];\nconst since = String(rawSince ?? 'daily').toLowerCase();\nif (!VALID_SINCE.includes(since)) throw new Error(`--since must be one of: ${VALID_SINCE.join(', ')}`);","typeGuard":"function isArgumentError(e) { return e instanceof Error && e.name === 'ArgumentError'; }","tryCatchPattern":"try {\n  await run(['opencli', 'github-trending', 'repos', '--since', since]);\n} catch (e) {\n  if (e.name === 'ArgumentError') { console.error(e.message); process.exitCode = 2; }\n  else throw e;\n}","preventionTips":["Whitelist --since values in wrapper scripts before invoking","Always lowercase the value before passing it","Read the command's --help to discover accepted values"],"tags":["argument-validation","cli","input-error"],"backgroundTag":"invalid-argument-value","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}