Skip to content

Generate, Run & Replay

The core generate → run loop, plus exporting chains to disk and replaying past runs.

Generate a CARL chain from a free-form task via MAGE.

Terminal window
care generate "weather report for SF" --save weather --output weather.json
FlagPurpose
--mode fast|deepMAGE generation mode (defaults to MAGE’s own default).
--save NAMESave the generated chain to Memory under NAME (new entity).
--output PATHWrite the chain to a file (format inferred from .json / .py).
--output-format json|pythonOverride the export format.
--jsonEmit the chain as JSON instead of a summary line.

If a generate call fails because of authentication or an expired token, the CLI now prints a single friendly hint pointing you at care init (to re-seed your credentials) and care doctor (to diagnose the endpoint) — instead of a raw traceback.

Fetch a saved chain from Memory, preflight it, and optionally execute it.

Terminal window
care run my-chain --execute --input city=Paris --save-result paris-run
care run my-chain --export chain.py # export, don't run
FlagPurpose
--channel NAMEVersion channel to read (default latest).
--executeExecute via CARL after preflight (needs mmar_carl + an LLM key).
--task TEXTOverride outer_context for the run.
--input KEY=VALUEAdd a pair to context.memory['input'] (repeatable).
--save-result NAMEPersist a run digest as a memory_card (requires --execute).
--export PATHAlso write the fetched chain to a file (.json / .py).
--export-format json|pythonOverride the export format.
--jsonEmit the preflight result as JSON.
--log PATH / --log-level debug|infoWrite a structured debug log of the run.

Step through a saved ReasoningResult / RunRecord JSON from a previous run. Use - to read from stdin.

Terminal window
care replay run.json # whole session, one block per step
care replay run.json --step 2 # just step 2 (0-indexed)
cat run.json | care replay -
FlagPurpose
--step NRender only step N (0-indexed); default renders the whole session.
--jsonStructured payload (chain metadata + every step) instead of the walkthrough.

Run care <command> --help for the authoritative, up-to-date flag set.