r/coding_agents • u/CCodeSI • 4h ago
Scripting a coding agent shouldn't mean scraping its terminal. CCode 1.12.3 speaks JSON.
https://ccode.siPutting an agent in CI or behind your own tool usually means parsing whatever it prints and hoping the format doesn't change.
ccode -p now has three machine-readable modes:
--output-format json: one result object at the end, with the answer, turns, duration, token usage and any permission denials.--output-format stream-json: a JSON line for every message as it happens, including tool calls, background tasks finishing and compactions.- Duplex over stdin: send messages and control requests mid-run, like interrupt, switch model or change the permission mode, and answer permission asks from your own code.
Plus --max-turns, --no-session-persistence, and exit codes that mean something (0 success, 1 the last result was an error, 2 a bad command line).
Same engine as the interactive app, with whichever model you run.
npm i -g @ccode-si/cli (or ccode update)
1
Upvotes