Repository navigation
feat(cli): add JSON event output - #1110
Merged
Merged
Conversation
KnifeLemon
approved these changes
Nov 4, 2026
KnifeLemon
left a comment
Owner
There was a problem hiding this comment.
Thanks, @yavuzmeteafsar. This matches what we agreed in #1076: Utf8JsonWriter escapes the paths, lines are written whole under the gate, stopped comes last, and nothing changes with the flag off. CI is green. Merging.
We'll follow up on these ourselves, so nothing is needed from you:
watch --json --quietstill prints every event (Cli.cs:110).convertchecksoptions.Json && !options.Quiet, and the help says--quietprints nothing but errors.- Tests:
OnlyEventsalso passes on empty stderr, so the failed and cancelled runs don't prove afileevent was written. skills/filee/SKILL.mdtells agents to always pass--json. Agent shells often merge stderr into stdout, so it should recommend--json --quietnow that stderr has events.
One thing for the changelog: a wrapper that reads stdout to the end before reading stderr can now stall on a long conversion, because writing an event blocks once the stderr pipe is full. --quiet avoids that.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As agreed in #1076.
What does this change?
convert --jsonnow streams events to stderr while it runs, one JSON object per line:{"event":"progress","source":…,"fraction":…}(0 to 1, about every 150 ms while it changes) and{"event":"file",…}as each file finishes, with the same fields as its entry in"files". stdout is unchanged and still gets one JSON document when the job is done.watchgets a--jsonoption: stdout carries only events,{"event":"started",…}with the folder, preset, target and output folder,{"event":"file",…}per converted file (same fields asconvert --json), and{"event":"stopped"}on Ctrl+C.A
fileevent and the file's entry infiles[]are written by the same function (WriteFileFields), so they can't drift apart. Inwatch --jsonthe watcher is disposed beforestopped, so a batch still running can't print after it.--json --quiet