jackwener/OpenCLI · error · ArgumentError

describe currently requires a local image file

Error message

describe currently requires a local image file

What it means

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.

Source

Thrown at clis/midjourney/describe.js:34

  name: 'describe',
  access: 'write',
  description: 'Upload one image and return Midjourney\'s four Describe prompt suggestions without generating images',
  example: 'opencli midjourney describe /path/reference.png -f json',
  domain: 'www.midjourney.com',
  strategy: Strategy.UI,
  browser: true,
  siteSession: 'persistent',
  navigateBefore: MIDJOURNEY_IMAGINE_URL,
  defaultWindowMode: 'background',
  args: [
    { name: 'image', positional: true, required: true, help: 'Local PNG, JPEG, WEBP, or GIF (10MB maximum)' },
    { name: 'timeout', type: 'int', default: 60, help: 'Maximum seconds to wait for four suggestions' },
  ],
  columns: ['rank', 'prompt', 'source', 'created_at'],
  func: async (page, kwargs) => {
    await getMidjourneyAccount(page);
    const refs = parseReferenceArgument(kwargs.image, 'image', { multiple: false });
    if (refs[0]?.kind !== 'local') throw new ArgumentError('describe currently requires a local image file');
    await validateLocalReferences(refs, 'image');
    const timeout = Number(kwargs.timeout ?? 60);
    if (!Number.isInteger(timeout) || timeout < 1 || timeout > 180) {
      throw new ArgumentError('--timeout must be an integer from 1 to 180');
    }

    if (await isSettingsPanelVisible(page)) await toggleSettingsPanel(page);

    const [sourceUrl] = await uploadReferenceLibrary(page, [refs[0].value]);
    const baselineGroups = await page.evaluate(() => {
      const visible = (node) => {
        const rect = node.getBoundingClientRect();
        return rect.width > 0 && rect.height > 0;
      };
      const groups = [];
      const markers = [...document.querySelectorAll('div')]
        .filter((node) => node.children.length === 0 && node.textContent?.trim() === 'Describe' && visible(node));
      for (const marker of markers) {

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Download the image to a local file first and pass its filesystem path to --image
  2. Check the reference kind before calling: parse the arg and confirm refs[0].kind === 'local'
  3. Extend the workflow in describe.js to handle remote references if remote support is needed
  4. Update documentation/help text to state describe requires a local image path

Example fix

// before
opencli midjourney describe --image https://cdn.example.com/pic.png
// after
curl -o /tmp/pic.png https://cdn.example.com/pic.png
opencli midjourney describe --image /tmp/pic.png
Defensive patterns

Strategy: validation

Validate before calling

import { parseReferenceArgument } from './clis/midjourney/...';
const refs = parseReferenceArgument(kwargs.image, 'image', { multiple: false });
if (refs[0]?.kind !== 'local') {
  throw new Error('describe requires a local image path; download the image first');
}
await describeCommand.func(page, kwargs);

Type guard

function isLocalReference(ref) {
  return Boolean(ref) && ref.kind === 'local' && typeof ref.value === 'string';
}

Try / catch

try {
  await describe(page, kwargs);
} catch (err) {
  if (err instanceof ArgumentError && err.message.includes('local image file')) {
    console.error('Download the image locally and pass its file path to --image');
  } else throw err;
}

Prevention

When it happens

Trigger: Running describe with --image set to an http(s) URL, a data URI, or any reference that parseReferenceArgument classifies as non-local (multiple: false).

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

Related errors


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