ErrLookup › Background articles › "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries
"Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries
"Invalid format", "must be in format 'platform:url'", "does not look like a valid id", "Expected format 'WIDTHxHEIGHT'" — these are invalid-argument-format errors, raised by CLI tools and libraries when an argument arrives with the wrong shape: a missing separator like a colon, an id pasted as a whole URL, a size string that will not parse, or a value matching no accepted pattern. You meet them in the first milliseconds of a command run, before any network call, when a flag value or positional argument fails the library's client-side shape check.
Distilled from 95 documented records across 17 repositories.
Background
This family sits at the outermost layer of a program: argument parsing and input validation. Before a CLI like mise, pnpm, or the OpenCLI adapters touches the network or the filesystem, it checks that each option value matches the shape it can actually work with. mise's generate tool-stub command splits platform specs on the first colon and rejects values that are neither 'platform:url' nor a detectable URL; pnpm's access grant/revoke splits the team argument on ':' to build a registry URL and rejects anything without one; OpenCLI's many adapters run regex checks (/^\d+$/, /^[A-Za-z0-9_-]+$/, /^[A-Z0-9]{1,32}$/, UUID patterns) over ids, handles, and timestamps. These checks exist to fail fast: a malformed train_no or security-id would only produce a garbage request against the upstream API, so the library refuses up front, usually with an ArgumentError or ValueError naming the offending value.
The dominant trigger across all 17 repositories is separator and shape confusion. Colon-delimited compound values are the clearest case: mise's 'platform:url' and 'platform:path' specs, pnpm's 'scope:team', ruflo's 'agent:<id>' or 'human:<id>' targets, and FD:DEST pairs in Codex's Linux sandbox all fail with a near-identical message when the colon is missing — typically because shell interpolation dropped one half, a value was copy-pasted without its prefix, or hand-built argv forgot the separator. A close second is pasting a whole URL where a bare identifier is expected: hotel ids, Zhihu answer ids, Twitter handles, BOSS security-ids, dianping shop ids, and list ids all get rejected when the caller passes 'https://...' instead of the extracted id. Some libraries deliberately accept both forms — OpenCLI's dianping and Kimi parsers extract ids from canonical URLs — but then enforce canonicality (https only, no fragments, the right host), so mobile or mirror links still fail.
Beyond separators and URLs, the family covers numeric and pattern-validated values: Trip.com hotel ids and X list ids must be pure digit strings, Coupang product ids need at least 6 digits, 12306 train_no must be 8-18 alphanumerics distinct from the public train code, Wayback timestamps must normalize to 4-14 digits, and limit/size arguments must be positive integers or 'WIDTHxHEIGHT' pairs. Note that behavior at the edges is library-specific: litellm's BFL mapper silently ignores size strings without an 'x' and only raises when an 'x' is present but the halves do not parse as integers, while matplotlib's axes_grid1 from_any raises on any unrecognized type outright, and its Grid rect check looks only at sequence length. Matplotlib also shows the family's variant of a subtle bug: unchecked string branches that push the real failure downstream to a different error (float() failing on '50 percent%').
The messages themselves follow a few recognizable templates: 'must be in format X' (mise, pnpm), 'does not look like a Y' (OpenCLI's 12306 train_no, dianping shop id), 'Expected format ...' (litellm), and rethrow wrappers that preserve an inner validator's message (OpenCLI's message-send and reaction-add commands prefix 'rethrown from ...'). Because most of these fire before any I/O, an error from this family almost always means the fix is entirely on the caller's side: reshape the argument, do not retry or look for a server problem.
Common causes
- Missing colon separator in a compound value. Colon-delimited specs — mise's 'platform:url' and 'platform:path', pnpm's 'scope:team', ruflo's 'agent:<id>'/'human:<id>', Codex's FD:DEST mount pairs — are split on ':' client-side, and a value with no colon is rejected before any request. Usually shell interpolation dropped one half, the prefix was omitted, or hand-built argv lost the separator.
- Passing a full URL instead of the bare identifier. Adapters for hotel ids, Zhihu answers, Twitter handles, BOSS security-ids, dianping shop ids, and X list ids expect the extracted id, but callers paste the whole page or profile URL. Some parsers accept canonical URLs as an alternative, but then enforce https, the official host, and no fragments, ports, or credentials — mobile and mirror links fail.
- Using a public or human-readable name where an internal id is required. 12306's 'price' command needs the internal train_no (8-18 alphanumerics from the 'trains' output), not the public code like G1; X list mutations need the numeric list REST id, not the slug 'my-list'; reaction commands need full UUIDs, not 8-hex short ids. The regex check rejects the familiar-looking value immediately.
- Wrong separator characters or extra characters in id strings. Ids contaminated by whitespace, quotes, commas, trailing punctuation, full-width characters, or invisible pasted characters fail character-class checks like /^[A-Za-z0-9_-]+$/. Siyuan's --ids made only of commas and spaces passes the non-empty check but yields zero usable segments after split-and-trim.
- Non-numeric or unparseable numeric arguments. Values like '1024' (missing height) or 'axb' for litellm's WIDTHxHEIGHT size, 'abc' or 2.5 or 0 for Coupang and crates limit flags, 'relu' where sglang's --diff-threshold expects a float, or an odd-digit-count Wayback timestamp all fail int/float/regex parsing. Some numeric strings fail merely because of units ('20 items') or thousands separators ('1,234,567').
- Wrong arity or wrong shape of structured values. matplotlib's Grid/ImageGrid rect must be a subplot code, a SubplotSpec, or a 3- or 4-element sequence — 2-tuples and 5+ element sequences raise 'Incorrect rect format'; its from_any rejects any non-number, non-'NN%' value with 'Unknown format'. Ruflo's --vector must parse as JSON and be a flat array of numbers — valid JSON of any other shape triggers its error.
- Wrong variant of an overloaded argument. Where a command accepts multiple forms, passing none of them cleanly fails: Zhihu answer-comments requires a numeric id, an answer URL, or 'answer:<qid>:<aid>'; nowcoder detail requires a numeric id, a 32-hex UUID, or a canonical URL; ruflo's claims target must use the 'agent' or 'human' prefix, not 'user:' or a bare id.
- Case and encoding mismatches in coded values. 12306 seat-type codes must be uppercase letters/digits ('om' fails, 'OM9' works), and pnpm warns that a full-width colon look-alike will not satisfy its includes(':') check. Chinese seat names and other localized labels are never accepted where letter codes are expected.
What usually fixes it
- [object Object]
- [object Object]
- [object Object]
- [object Object]
- [object Object]
- [object Object]
Documented occurrences
- Could not auto-detect platform from URL: {}. Please specify explicitly using 'platform:url' format. (jdx/mise)
- InvalidInput: descriptor-backed mount must contain FD:DEST: {mount} (openai/codex)
- Platform spec must be in format 'platform:url' or just 'url' (for auto-detection). Got: {} (jdx/mise)
- Unknown format (matplotlib/matplotlib)
- Invalid size format: '{size}'. Expected format 'WIDTHxHEIGHT' (e.g., '1024x1024'). (BerriAI/litellm)
- <train-no> "${trainNo}" does not look like a 12306 internal train_no (jackwener/OpenCLI)
- --${name} must be a numeric Trip.com hotel id, got ${JSON.stringify(raw)} (jackwener/OpenCLI)
- Platform bin spec must be in format 'platform:path', got: {} (jdx/mise)
- ACCESS_GRANT_INVALID_TEAM: Invalid team "${scopeTeam}". Format must be "scope:team". (pnpm/pnpm)
- Incorrect rect format (matplotlib/matplotlib)
- --seat-types must contain only 12306 seat letters/digits (A-Z, 0-9) (jackwener/OpenCLI)
- archive wayback timestamp must be YYYY[MM[DD[hh[mm[ss]]]]] or an ISO date (jackwener/OpenCLI)
- must be a Kimi chat id or https://www.kimi.com/chat/<id> URL (jackwener/OpenCLI)
- twitter ${commandName} username must be a valid Twitter/X handle (jackwener/OpenCLI)
- boss security-id contains unsupported characters (jackwener/OpenCLI)
- ${e.message} (rethrown from classifyTarget; e.g. target required / dm target forms) (jackwener/OpenCLI)
- ${raw}' does not look like a dianping shop id (jackwener/OpenCLI)
- --vector must be a JSON array of numbers, got: ${raw} (ruvnet/ruflo)
- Invalid listId: ${JSON.stringify(kwargs.listId)}. Expected numeric ID. (jackwener/OpenCLI)
- no valid IDs provided (siyuan-note/siyuan)
…and 75 more across the corpus — use search.
Honest provenance: generated on 2026-08-29 from AI-assisted analysis of the linked records. See how records are made.