Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/Aquaticat/Monochromatic. TypeScript and Rust monorepo: Claude Code and Pi coding-agent plugins, a m
Something went wrong. Try again.
12345678910111213141516171819202122232425import type { ImageInput, } from './types.ts';
/** Parse a positional image argument into an {@link ImageInput}. URLs (starting with http:// or https://) become URL inputs; everything else is treated as a file path. @param arg - CLI positional argument @returns parsed image input @example ```ts parseImageArg('photo.png') // { path: 'photo.png' } parseImageArg('https://example.com/a.jpg') // { url: 'https://...' } ``` */export function parseImageArg(arg: string,): ImageInput { if (arg.startsWith('http://',) || arg .startsWith('https://',)) return { url: arg, }; return { path: arg, };}