[GH-ISSUE #1314] CLI should exit with non-zero return code when failed. #544

Closed
opened 2026-10-27 21:18:49 +00:00 by bsakaguchi · 7 comments
Owner

Originally created by @the729 on GitHub (Dec 9, 2024).
Original GitHub issue: https://github.com/Comfy-Org/ComfyUI-Manager/issues/1314

The current behavior of cm-cli.py is to log error and continue, when it encounters any error during installation of custom nodes, i.e. git clone failed or pip install failed.

This behaviour is not optimal for using in docker build, as the container builder will think it has succeeded.

Can we add a flag to make it abort installation if any errors happened?

Originally created by @the729 on GitHub (Dec 9, 2024). Original GitHub issue: https://github.com/Comfy-Org/ComfyUI-Manager/issues/1314 The current behavior of cm-cli.py is to log error and continue, when it encounters any error during installation of custom nodes, i.e. git clone failed or pip install failed. This behaviour is not optimal for using in docker build, as the container builder will think it has succeeded. Can we add a flag to make it abort installation if any errors happened?
bsakaguchi 2026-10-27 21:18:49 +00:00
Author
Owner

@ltdrdata commented on GitHub (Dec 11, 2024):

Ok. I'll add it.

<!-- gh-comment-id:2533715732 --> @ltdrdata commented on GitHub (Dec 11, 2024): Ok. I'll add it.
Author
Owner

@TimPietrusky commented on GitHub (May 6, 2025):

@ltdrdata any pointers into the right direction? would love to help out here, as this is super much needed not only for humans, but also for agents. right now when an agent builds the docker image, which is internally using the comfy-cli to install nodes, then we have to create a wrapper and parse the output, as the return code is not indicating that an error has occured

<!-- gh-comment-id:2853555593 --> @TimPietrusky commented on GitHub (May 6, 2025): @ltdrdata any pointers into the right direction? would love to help out here, as this is super much needed not only for humans, but also for agents. right now when an agent builds the docker image, which is internally using the comfy-cli to install nodes, then we have to create a wrapper and parse the output, as the return code is not indicating that an error has occured
Author
Owner

@polarathene commented on GitHub (May 13, 2025):

which is internally using the comfy-cli to install nodes

If you are referring to comfy-cli, they might need to update that to opt-in to the --exit-on-fail feature of cm-cli.py I think. I haven't verified yet. Although the maintenance of comfy-cli seems to be lagging behind a bit from what I've seen it might take a while 🤷‍♂

<!-- gh-comment-id:2874964636 --> @polarathene commented on GitHub (May 13, 2025): > which is internally using the comfy-cli to install nodes If you are referring to [`comfy-cli`](https://github.com/Comfy-Org/comfy-cli), they might need to update that to opt-in to the `--exit-on-fail` feature of `cm-cli.py` I think. I haven't verified yet. Although the maintenance of `comfy-cli` seems to be lagging behind a bit from what I've seen it might take a while 🤷‍♂
Author
Owner

@ltdrdata commented on GitHub (May 13, 2025):

Related PR is merged already.

<!-- gh-comment-id:2875735330 --> @ltdrdata commented on GitHub (May 13, 2025): Related PR is merged already.
Author
Owner

@polarathene commented on GitHub (May 13, 2025):

How would that be possible if https://github.com/Comfy-Org/ComfyUI-Manager/pull/1807 was only created a week ago? comfy-cli has had no PRs merged since Feb 25.

It seems comfy-cli will call cm-cli.py via execute_cm_cli() which takes args as input, and then checks for additional args provided to comfy-cli to append to cm-cli.py args.

Wouldn't that be where you'd add --exit-on-fail? (which should then trigger this exception?)

This is why I think comfy-cli won't catch/handle the failed command since --exit-on-fail is opt-in, comfy-cli must add support to use it?

<!-- gh-comment-id:2878019882 --> @polarathene commented on GitHub (May 13, 2025): How would that be possible if https://github.com/Comfy-Org/ComfyUI-Manager/pull/1807 was only created a week ago? `comfy-cli` has had no PRs merged since Feb 25. It seems `comfy-cli` will call `cm-cli.py` via [`execute_cm_cli()`](https://github.com/Comfy-Org/comfy-cli/blob/38fa4b299905e9ebeadbfc0554de44b04289ac8a/comfy_cli/command/custom_nodes/cm_cli_util.py#L24) which takes args as input, and then checks for [additional args provided to `comfy-cli` to append to `cm-cli.py` args](https://github.com/Comfy-Org/comfy-cli/blob/38fa4b299905e9ebeadbfc0554de44b04289ac8a/comfy_cli/command/custom_nodes/cm_cli_util.py#L41-L50). Wouldn't that be where you'd add `--exit-on-fail`? (_which should then trigger [this exception](https://github.com/Comfy-Org/comfy-cli/blob/38fa4b299905e9ebeadbfc0554de44b04289ac8a/comfy_cli/command/custom_nodes/cm_cli_util.py#L70-L73)?_) This is why I think `comfy-cli` won't catch/handle the failed command since `--exit-on-fail` is opt-in, `comfy-cli` must add support to use it?
Author
Owner

@ltdrdata commented on GitHub (May 13, 2025):

How would that be possible if #1807 was only created a week ago? comfy-cli has had no PRs merged since Feb 25.

It seems comfy-cli will call cm-cli.py via execute_cm_cli() which takes args as input, and then checks for additional args provided to comfy-cli to append to cm-cli.py args.

Wouldn't that be where you'd add --exit-on-fail? (which should then trigger this exception?)

This is why I think comfy-cli won't catch/handle the failed command since --exit-on-fail is opt-in, comfy-cli must add support to use it?

Oh, I misread the comment. You're right — it hasn't been applied to comfy-cli yet.

<!-- gh-comment-id:2878042057 --> @ltdrdata commented on GitHub (May 13, 2025): > How would that be possible if [#1807](https://github.com/Comfy-Org/ComfyUI-Manager/pull/1807) was only created a week ago? `comfy-cli` has had no PRs merged since Feb 25. > > It seems `comfy-cli` will call `cm-cli.py` via [`execute_cm_cli()`](https://github.com/Comfy-Org/comfy-cli/blob/38fa4b299905e9ebeadbfc0554de44b04289ac8a/comfy_cli/command/custom_nodes/cm_cli_util.py#L24) which takes args as input, and then checks for [additional args provided to `comfy-cli` to append to `cm-cli.py` args](https://github.com/Comfy-Org/comfy-cli/blob/38fa4b299905e9ebeadbfc0554de44b04289ac8a/comfy_cli/command/custom_nodes/cm_cli_util.py#L41-L50). > > Wouldn't that be where you'd add `--exit-on-fail`? (_which should then trigger [this exception](https://github.com/Comfy-Org/comfy-cli/blob/38fa4b299905e9ebeadbfc0554de44b04289ac8a/comfy_cli/command/custom_nodes/cm_cli_util.py#L70-L73)?_) > > This is why I think `comfy-cli` won't catch/handle the failed command since `--exit-on-fail` is opt-in, `comfy-cli` must add support to use it? Oh, I misread the comment. You're right — it hasn't been applied to comfy-cli yet.
Author
Owner

@TimPietrusky commented on GitHub (May 21, 2025):

this issue is not resolved yet, but will be with https://github.com/Comfy-Org/comfy-cli/issues/268

<!-- gh-comment-id:2897616004 --> @TimPietrusky commented on GitHub (May 21, 2025): this issue is not resolved yet, but will be with https://github.com/Comfy-Org/comfy-cli/issues/268
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/ComfyUI-Manager#544
No description provided.