--json. The schema is small and stable, which makes
the CLI a comfortable building block for shell pipelines, automation, and
LLM-driven tools.
Output schemas
mulerouter list --json
--providers:
mulerouter params --json
mulerouter run --json
When waiting for completion:
videos, images, audios) matches the endpoint’s
result_key. With --no-wait, the response includes task_id, api_path,
and the full task info payload as returned by the upstream API.
mulerouter status --json
results array appears. When it fails, an error
string explains why.
Recipes
Pick a random SOTA modelmulerouter params <endpoint> --json plus
ajv on the parameter list lets you validate locally
before submitting.
Pin a model from package.json
Stdout vs stderr
- stdout is reserved for the JSON or text result. Safe to pipe.
- stderr carries progress lines (
[12s] status: queued), warnings, and errors. Use--quietto suppress progress lines while keeping real errors.
Exit codes
Check
$? before parsing JSON — a failed call may still emit JSON, but the
shape will contain an error field instead of results.
Using the CLI from an AI agent
The CLI’s combination of--json output, stable subcommand surface, and
deterministic exit codes makes it a clean tool to expose to an LLM agent. A
minimal tool spec:
mulerouter run <endpoint> <args...> --json --quiet
and reads the resulting JSON. Pair with mulerouter list --json and
mulerouter params <endpoint> --json so the model can discover available
options without hardcoding them.
