Skip to content

launch/stop ignore --json: no envelope output for lifecycle commands #509

Description

@mattmillerai

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions