Most commands honor the global --json flag and emit an envelope/1 JSON document, which makes comfy-cli scriptable and lets programmatic wrappers (MCP servers, CI) parse results reliably.
The lifecycle commands don't participate:
$ comfy --json stop
Background ComfyUI is stopped. (127.0.0.1:8188) # exit 0, human text, no envelope
$ comfy --json launch --background
Launching ComfyUI from: /path/to/ComfyUI # same
Verified on comfy-cli 1.12.0.
For a programmatic caller that requires the envelope contract, this makes a successful stop/launch indistinguishable from a malformed response — the action succeeds while the caller reports failure, which invites retries of non-idempotent lifecycle operations.
Proposal: emit envelope/1 from launch and stop when --json is set, e.g. {"ok": true, "command": "stop", "data": {"host": "127.0.0.1", "port": 8188, "stopped": true}} and the launch equivalent (pid/host/port/background). Happy to send a PR if the shape looks right.
Most commands honor the global
--jsonflag and emit anenvelope/1JSON document, which makes comfy-cli scriptable and lets programmatic wrappers (MCP servers, CI) parse results reliably.The lifecycle commands don't participate:
Verified on comfy-cli 1.12.0.
For a programmatic caller that requires the envelope contract, this makes a successful stop/launch indistinguishable from a malformed response — the action succeeds while the caller reports failure, which invites retries of non-idempotent lifecycle operations.
Proposal: emit
envelope/1fromlaunchandstopwhen--jsonis set, e.g.{"ok": true, "command": "stop", "data": {"host": "127.0.0.1", "port": 8188, "stopped": true}}and the launch equivalent (pid/host/port/background). Happy to send a PR if the shape looks right.