Three flags are accepted by every Mercadona CLI command and can appear anywhere after the subcommand name — before or after positional arguments. This is by design: placingDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ivorpad/mercadona-cli/llms.txt
Use this file to discover all available pages before exploring further.
--max or --json at the end of a long command line works reliably, and safety flags like --max are never silently dropped.
Global Flags
| Flag | Default | Description |
|---|---|---|
--wh <code> | config [defaults].warehouse, else mad1 | Warehouse code. Product IDs and prices are per-warehouse. |
--lang <code> | config [defaults].lang, else es | Language for product names and API responses. Options: es, en, ca, eu, vai. |
--json | false | Emit data as raw JSON to stdout. Logs and errors always go to stderr. |
Flag Position Flexibility
Flags can appear before positional arguments, after them, or mixed in between. All of the following are equivalent:--max cannot be silently ignored if placed after product IDs or quantities. This matters for safety: a misplaced --max in a script would otherwise be dropped without warning.
Exit Codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Error (authentication failure, budget exceeded, API error, invalid args) |
2 | Usage error (unknown command, missing required argument) |
Output Routing
All Mercadona CLI commands follow a strict output routing convention:- stdout — command output (human-readable summaries, or JSON when
--jsonis set) - stderr — logs, progress messages, warnings, and error messages
Warehouse Code Precedence
The active warehouse is resolved in this order:--wh <code>flag on the current command[defaults].warehousein~/.mercadona/config.toml(set byset-postalorimport-har)- Built-in default:
mad1
Language Code Precedence
The active language is resolved in the same order:--lang <code>flag on the current command[defaults].langin~/.mercadona/config.toml(set byimport-harwhen a language is detected in the session)- Built-in default:
es