{"record":{"id":"ee5ec6fd6fcf707c","repo":"jackwener/OpenCLI","slug":"channel-required-ee5ec6","errorCode":null,"errorMessage":"channel required","messagePattern":"channel required","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/slock/channel-info.js","lineNumber":24,"sourceCode":"import { SLOCK_SITE, SLOCK_DOMAIN, SLOCK_HOME_URL } from './shared.js';\n\ncli({\n  site: SLOCK_SITE,\n  name: 'channel-info',\n  access: 'read',\n  description: 'Show one channel\\'s details (GET /channels/:id)',\n  domain: SLOCK_DOMAIN,\n  strategy: Strategy.COOKIE,\n  browser: true,\n  siteSession: 'persistent',\n  args: [\n    { name: 'channel', positional: true, required: true, help: 'channelId UUID or #name' },\n    { name: 'server', help: 'Override active server' },\n  ],\n  columns: ['id', 'name', 'type', 'topic', 'joined', 'archivedAt'],\n  func: async (page, kwargs) => {\n    const channel = String(kwargs.channel ?? '').trim();\n    if (!channel) throw new ArgumentError('channel required');\n    await page.goto(SLOCK_HOME_URL);\n    const snippet = buildChannelScopedSnippet({\n      channelInput: channel,\n      method: 'GET',\n      serverIdOverride: kwargs.server,\n    });\n    const result = await page.evaluate(`(async () => { ${snippet} })()`);\n    const c = dispatchEvaluateResult(result) || {};\n    return [{\n      id: c.id ?? '',\n      name: c.name ?? c.slug ?? '',\n      type: c.type ?? '',\n      topic: c.topic ?? c.description ?? '',\n      joined: c.joined ?? null,\n      archivedAt: c.archivedAt ?? null,\n    }];\n  },\n});","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/slock/channel-info.js#L6-L42","documentation":"`channel-info` requires a target channel identifier. The CLI trims the `channel` kwarg and throws ArgumentError('channel required') when it is missing or empty, before resolving the channel via `buildChannelScopedSnippet`.","triggerScenarios":"Calling `slock channel-info` without the positional/`--channel` value, or with an empty string after trimming.","commonSituations":"Automation passing an unset variable, interactive users forgetting the positional argument (the arg is marked required:true but empty strings still slip through), or quoting bugs that yield \"\".","solutions":["Provide the channel: `slock channel-info '#ops'` or the channelId UUID","Guard variables in scripts: `: \"${CHANNEL:?channel not set}\"`","Run `slock channel-info --help` to confirm argument syntax"],"exampleFix":"// before\n$ slock channel-info\nError: channel required\n// after\n$ slock channel-info '#ops'","handlingStrategy":"validation","validationCode":"const channel = String(input.channel ?? '').trim();\nif (!channel) throw new Error('channel must be provided (#name or channelId UUID)');","typeGuard":"const hasChannel = (v) => typeof v === 'string' && v.trim().length > 0;","tryCatchPattern":"try {\n  await run(['slock', 'channel-info', channel]);\n} catch (e) {\n  if (e instanceof ArgumentError && e.message === 'channel required') {\n    console.error('Pass the channel positionally: slock channel-info <#name|uuid>.');\n  } else throw e;\n}","preventionTips":["Pass the channel as a positional argument, quoted if it starts with #","Validate variables before invoking in scripts","Quote #names so the shell does not treat # as a comment"],"tags":["argument-error","cli","validation","missing-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}