From 3b97236d705a2214051a4328451e5d042727a0b2 Mon Sep 17 00:00:00 2001 From: Matt Miller Date: Fri, 17 Jul 2026 05:03:13 -0700 Subject: [PATCH] fix: escape square brackets in Typer help strings so choice lists render Rich parses square brackets in Typer help= strings as console markup, so help text of the form [a|b|c] was silently stripped and the accepted values never appeared in --help output. Escape the opening bracket at the 16 affected argument/option help strings. Verified by rendering the real help for each affected command. --- comfy_cli/cmdline.py | 2 +- comfy_cli/command/custom_nodes/command.py | 30 +++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/comfy_cli/cmdline.py b/comfy_cli/cmdline.py index 4662b788..4b7b55b6 100644 --- a/comfy_cli/cmdline.py +++ b/comfy_cli/cmdline.py @@ -613,7 +613,7 @@ def install( def update( target: str = typer.Argument( "comfy", - help="[all|comfy|cli]", + help="\\[all|comfy|cli]", autocompletion=utils.create_choice_completer(["all", "comfy", "cli"]), ), ): diff --git a/comfy_cli/command/custom_nodes/command.py b/comfy_cli/command/custom_nodes/command.py index 7f4b1c80..bbeb4ac5 100644 --- a/comfy_cli/command/custom_nodes/command.py +++ b/comfy_cli/command/custom_nodes/command.py @@ -515,7 +515,7 @@ def show( ] = None, mode: str = typer.Option( None, - help="[remote|local|cache]", + help="\\[remote|local|cache]", autocompletion=mode_completer, ), ): @@ -540,7 +540,7 @@ def simple_show( ] = None, mode: str = typer.Option( None, - help="[remote|local|cache]", + help="\\[remote|local|cache]", autocompletion=mode_completer, ), ): @@ -595,7 +595,7 @@ def install( ] = False, mode: str = typer.Option( None, - help="[remote|local|cache]", + help="\\[remote|local|cache]", autocompletion=mode_completer, ), ): @@ -664,7 +664,7 @@ def reinstall( ] = None, mode: str = typer.Option( None, - help="[remote|local|cache]", + help="\\[remote|local|cache]", autocompletion=mode_completer, ), ): @@ -709,7 +709,7 @@ def uninstall( ] = None, mode: str = typer.Option( None, - help="[remote|local|cache]", + help="\\[remote|local|cache]", autocompletion=mode_completer, ), ): @@ -748,7 +748,7 @@ def update_node_id_cache(): def update( nodes: list[str] = typer.Argument( ..., - help="[all|List of custom nodes to update]", + help="\\[all|List of custom nodes to update]", autocompletion=node_or_all_completer, ), channel: Annotated[ @@ -769,7 +769,7 @@ def update( ] = None, mode: str = typer.Option( None, - help="[remote|local|cache]", + help="\\[remote|local|cache]", autocompletion=mode_completer, ), ): @@ -785,7 +785,7 @@ def update( def disable( nodes: list[str] = typer.Argument( ..., - help="[all|List of custom nodes to disable]", + help="\\[all|List of custom nodes to disable]", autocompletion=node_or_all_completer, ), channel: Annotated[ @@ -798,7 +798,7 @@ def disable( ] = None, mode: str = typer.Option( None, - help="[remote|local|cache]", + help="\\[remote|local|cache]", autocompletion=mode_completer, ), ): @@ -812,7 +812,7 @@ def disable( def enable( nodes: list[str] = typer.Argument( ..., - help="[all|List of custom nodes to enable]", + help="\\[all|List of custom nodes to enable]", autocompletion=node_or_all_completer, ), channel: Annotated[ @@ -825,7 +825,7 @@ def enable( ] = None, mode: str = typer.Option( None, - help="[remote|local|cache]", + help="\\[remote|local|cache]", autocompletion=mode_completer, ), ): @@ -839,7 +839,7 @@ def enable( def fix( nodes: list[str] = typer.Argument( ..., - help="[all|List of custom nodes to fix]", + help="\\[all|List of custom nodes to fix]", autocompletion=node_or_all_completer, ), channel: Annotated[ @@ -860,7 +860,7 @@ def fix( ] = None, mode: str = typer.Option( None, - help="[remote|local|cache]", + help="\\[remote|local|cache]", autocompletion=mode_completer, ), ): @@ -901,7 +901,7 @@ def install_deps( ] = None, mode: str = typer.Option( None, - help="[remote|local|cache]", + help="\\[remote|local|cache]", autocompletion=mode_completer, ), ): @@ -951,7 +951,7 @@ def deps_in_workflow( ] = None, mode: str = typer.Option( None, - help="[remote|local|cache]", + help="\\[remote|local|cache]", autocompletion=mode_completer, ), ):