{"record":{"id":"14b5a12c0f79504a","repo":"jackwener/OpenCLI","slug":"describe-currently-requires-a-local-image-file","errorCode":null,"errorMessage":"describe currently requires a local image file","messagePattern":"describe currently requires a local image file","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/midjourney/describe.js","lineNumber":34,"sourceCode":"  name: 'describe',\n  access: 'write',\n  description: 'Upload one image and return Midjourney\\'s four Describe prompt suggestions without generating images',\n  example: 'opencli midjourney describe /path/reference.png -f json',\n  domain: 'www.midjourney.com',\n  strategy: Strategy.UI,\n  browser: true,\n  siteSession: 'persistent',\n  navigateBefore: MIDJOURNEY_IMAGINE_URL,\n  defaultWindowMode: 'background',\n  args: [\n    { name: 'image', positional: true, required: true, help: 'Local PNG, JPEG, WEBP, or GIF (10MB maximum)' },\n    { name: 'timeout', type: 'int', default: 60, help: 'Maximum seconds to wait for four suggestions' },\n  ],\n  columns: ['rank', 'prompt', 'source', 'created_at'],\n  func: async (page, kwargs) => {\n    await getMidjourneyAccount(page);\n    const refs = parseReferenceArgument(kwargs.image, 'image', { multiple: false });\n    if (refs[0]?.kind !== 'local') throw new ArgumentError('describe currently requires a local image file');\n    await validateLocalReferences(refs, 'image');\n    const timeout = Number(kwargs.timeout ?? 60);\n    if (!Number.isInteger(timeout) || timeout < 1 || timeout > 180) {\n      throw new ArgumentError('--timeout must be an integer from 1 to 180');\n    }\n\n    if (await isSettingsPanelVisible(page)) await toggleSettingsPanel(page);\n\n    const [sourceUrl] = await uploadReferenceLibrary(page, [refs[0].value]);\n    const baselineGroups = await page.evaluate(() => {\n      const visible = (node) => {\n        const rect = node.getBoundingClientRect();\n        return rect.width > 0 && rect.height > 0;\n      };\n      const groups = [];\n      const markers = [...document.querySelectorAll('div')]\n        .filter((node) => node.children.length === 0 && node.textContent?.trim() === 'Describe' && visible(node));\n      for (const marker of markers) {","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/midjourney/describe.js#L16-L52","documentation":"The describe command derives four prompt suggestions by uploading an image into the Midjourney web UI, and its current automation only supports local image files. parseReferenceArgument may return remote/URL references; if the first reference's kind is not 'local', this ArgumentError is thrown.","triggerScenarios":"Running describe with --image set to an http(s) URL, a data URI, or any reference that parseReferenceArgument classifies as non-local (multiple: false).","commonSituations":"Passing a CDN/image-board URL copied from the browser; piping a previously uploaded reference URL back into describe; CI environments where users assume remote images are supported.","solutions":["Download the image to a local file first and pass its filesystem path to --image","Check the reference kind before calling: parse the arg and confirm refs[0].kind === 'local'","Extend the workflow in describe.js to handle remote references if remote support is needed","Update documentation/help text to state describe requires a local image path"],"exampleFix":"// before\nopencli midjourney describe --image https://cdn.example.com/pic.png\n// after\ncurl -o /tmp/pic.png https://cdn.example.com/pic.png\nopencli midjourney describe --image /tmp/pic.png","handlingStrategy":"validation","validationCode":"import { parseReferenceArgument } from './clis/midjourney/...';\nconst refs = parseReferenceArgument(kwargs.image, 'image', { multiple: false });\nif (refs[0]?.kind !== 'local') {\n  throw new Error('describe requires a local image path; download the image first');\n}\nawait describeCommand.func(page, kwargs);","typeGuard":"function isLocalReference(ref) {\n  return Boolean(ref) && ref.kind === 'local' && typeof ref.value === 'string';\n}","tryCatchPattern":"try {\n  await describe(page, kwargs);\n} catch (err) {\n  if (err instanceof ArgumentError && err.message.includes('local image file')) {\n    console.error('Download the image locally and pass its file path to --image');\n  } else throw err;\n}","preventionTips":["Check the reference kind from parseReferenceArgument before invoking describe","Prefer explicit local paths over URLs in scripts using describe","Document that describe only supports local images","Add a wrapper that auto-downloads remote URLs to temp files before calling describe"],"tags":["argument-error","file-input","midjourney","describe"],"backgroundTag":"local-file-required","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}