diff --git a/comfy_cli/cloud/oauth.py b/comfy_cli/cloud/oauth.py index f6459fa8..fc186281 100644 --- a/comfy_cli/cloud/oauth.py +++ b/comfy_cli/cloud/oauth.py @@ -466,12 +466,12 @@ def run_login( if not got: raise OAuthTimeout( f"timed out waiting for browser callback after {int(timeout_s)}s", - hint="re-run `comfy auth login` and complete the sign-in in your browser", + hint="re-run `comfy cloud login` and complete the sign-in in your browser", ) if capture.error or not capture.code: raise OAuthAuthorizeError( f"authorization failed: {capture.error or 'no code returned'}", - hint="re-run `comfy auth login` and check for typos or browser blockers", + hint="re-run `comfy cloud login` and check for typos or browser blockers", details={ "oauth_error": capture.error, "oauth_error_description": capture.error_description, @@ -554,7 +554,7 @@ def exchange_code( except _HTTPFail as e: raise OAuthTokenError( f"token exchange failed: {e}", - hint="re-run `comfy auth login` to start a fresh authorization", + hint="re-run `comfy cloud login` to start a fresh authorization", details={"status": e.status, "body": e.body}, ) from None return _token_set_from_response(resp) @@ -582,7 +582,7 @@ def refresh_tokens( except _HTTPFail as e: raise OAuthRefreshError( f"refresh failed: {e}", - hint="run `comfy auth login` to sign in again", + hint="run `comfy cloud login` to sign in again", details={"status": e.status, "body": e.body}, ) from None return _token_set_from_response(resp) diff --git a/comfy_cli/command/jobs.py b/comfy_cli/command/jobs.py index 9d6db398..8eee0b88 100644 --- a/comfy_cli/command/jobs.py +++ b/comfy_cli/command/jobs.py @@ -356,7 +356,7 @@ def ls_cmd( limit: Annotated[int, typer.Option(help="How many history entries to include.")] = 10, where: Annotated[ str | None, - typer.Option("--where", help="'local' (default) or 'cloud'. Cloud requires `comfy auth login`."), + typer.Option("--where", help="'local' (default) or 'cloud'. Cloud requires `comfy cloud login`."), ] = None, local_only: Annotated[ bool, @@ -1094,7 +1094,7 @@ def _cloud_cancel(prompt_id: str) -> None: renderer.error( code="cloud_http_error", message=f"cancel failed: {e}", - hint="check network / `comfy auth whoami`", + hint="check network / `comfy cloud whoami`", ) raise typer.Exit(code=1) from e @@ -1439,7 +1439,7 @@ def _cloud_client(): return Client(target, clear_session_on_auth_failure=False) except Unauthenticated as e: renderer = get_renderer() - renderer.error(code="cloud_unauthorized", message=str(e), hint="run: comfy auth login") + renderer.error(code="cloud_unauthorized", message=str(e), hint="run: comfy cloud login") raise typer.Exit(code=1) from e diff --git a/comfy_cli/command/models/search.py b/comfy_cli/command/models/search.py index 3f8565e9..a2d7332b 100644 --- a/comfy_cli/command/models/search.py +++ b/comfy_cli/command/models/search.py @@ -173,7 +173,7 @@ def list_folders_cmd( renderer=renderer, target=target, message=f"HTTP {e.code} from {url}", - hint="run `comfy auth whoami` to verify auth" + hint="run `comfy cloud whoami` to verify auth" if target.is_cloud else "run `comfy launch` to start a local server", ) @@ -483,7 +483,7 @@ def search_cmd( renderer=renderer, target=target, message=f"HTTP {e.code} during models search", - hint="check auth (`comfy auth whoami`) or network", + hint="check auth (`comfy cloud whoami`) or network", ) except (urllib.error.URLError, OSError, json.JSONDecodeError) as e: renderer.error( diff --git a/comfy_cli/command/run/__init__.py b/comfy_cli/command/run/__init__.py index fc230d00..e83730f7 100644 --- a/comfy_cli/command/run/__init__.py +++ b/comfy_cli/command/run/__init__.py @@ -599,7 +599,7 @@ def execute_cloud( try: client = Client(target, timeout=float(timeout)) except Unauthenticated as e: - renderer.error(code="cloud_unauthorized", message=str(e), hint="run: comfy auth login") + renderer.error(code="cloud_unauthorized", message=str(e), hint="run: comfy cloud login") raise typer.Exit(code=1) from e client_id = str(uuid.uuid4()) diff --git a/comfy_cli/command/run_cli.py b/comfy_cli/command/run_cli.py index f05210ef..7866ade8 100644 --- a/comfy_cli/command/run_cli.py +++ b/comfy_cli/command/run_cli.py @@ -516,13 +516,13 @@ def _build_steps(state: _DemoState) -> list[Step]: custom=_fleet_step, ), Step( - title="auth whoami — Comfy Cloud sign-in state", - desc="Same commands work against Comfy Cloud via --where cloud (after `comfy auth login`).", + title="cloud whoami — Comfy Cloud sign-in state", + desc="Same commands work against Comfy Cloud via --where cloud (after `comfy cloud login`).", invocations=[ - Invocation(argv=[*comfy, "auth", "whoami"], label="comfy auth whoami", optional=True), + Invocation(argv=[*comfy, "cloud", "whoami"], label="comfy cloud whoami", optional=True), Invocation( - argv=[*comfy, "--json", "auth", "whoami"], - label="comfy --json auth whoami", + argv=[*comfy, "--json", "cloud", "whoami"], + label="comfy --json cloud whoami", optional=True, ), ], @@ -563,7 +563,7 @@ def execute(*, pause_seconds: float, no_cleanup: bool, show_agent: bool) -> int: pprint( "[bold]Capabilities shown:[/bold] env · which · discover · query · " "run (sync/verbose/json/async) · jobs (ls/status/watch) · " - f"parallel fleet ×{FLEET_SIZE} · auth whoami." + f"parallel fleet ×{FLEET_SIZE} · cloud whoami." ) paths_to_clean = [wf_path, *state.fleet_workflow_paths] diff --git a/comfy_cli/command/workflow.py b/comfy_cli/command/workflow.py index d953c10e..aac882f3 100644 --- a/comfy_cli/command/workflow.py +++ b/comfy_cli/command/workflow.py @@ -656,7 +656,7 @@ def _handle_cloud_http_error(renderer, e, *, operation: str, workflow_id: str | renderer.error( code="cloud_http_error", message=f"{operation} failed: {e}", - hint="check network / `comfy auth whoami`", + hint="check network / `comfy cloud whoami`", ) return typer.Exit(code=1) diff --git a/comfy_cli/output/branding.py b/comfy_cli/output/branding.py index 151011b3..682a1f60 100644 --- a/comfy_cli/output/branding.py +++ b/comfy_cli/output/branding.py @@ -207,7 +207,7 @@ def _access_token_line(expires_at: int | None) -> Text: # --------------------------------------------------------------------------- -# Welcome banner — the big one, shown after auth login success +# Welcome banner — the big one, shown after cloud login success # --------------------------------------------------------------------------- diff --git a/tests/comfy_cli/command/test_run_cli.py b/tests/comfy_cli/command/test_run_cli.py index a062f37a..c7fdeb00 100644 --- a/tests/comfy_cli/command/test_run_cli.py +++ b/tests/comfy_cli/command/test_run_cli.py @@ -41,10 +41,26 @@ def test_build_steps_contains_full_surface(self): "jobs status", "jobs watch", "fleet", - "auth", + "whoami", ]: assert needle in titles, f"missing coverage for: {needle}" + def test_whoami_step_targets_cloud_not_auth(self): + # Sign-in status lives under `comfy cloud whoami`; `comfy auth` is the + # model-host token group. Guard against regressing back to `auth whoami`. + state = run_cli._DemoState(workflow_path="/tmp/x.json") + steps = run_cli._build_steps(state) + whoami = [s for s in steps if "whoami" in s.title.lower()] + assert len(whoami) == 1, "expected exactly one whoami demo step" + invs = whoami[0].invocations or [] + assert invs, "whoami step should expose invocations" + for inv in invs: + assert "whoami" in inv.argv, f"unexpected whoami argv: {inv.argv}" + assert "cloud" in inv.argv, f"whoami step must target cloud: {inv.argv}" + assert "auth" not in inv.argv, f"whoami step must not use auth: {inv.argv}" + assert "cloud whoami" in inv.label, f"unexpected whoami label: {inv.label}" + assert "auth whoami" not in inv.label, f"whoami label must not use auth: {inv.label}" + def test_build_steps_includes_parallel_fleet(self): state = run_cli._DemoState(workflow_path="/tmp/x.json") steps = run_cli._build_steps(state) diff --git a/tests/comfy_cli/output/test_branding.py b/tests/comfy_cli/output/test_branding.py index 340ce4a2..4cfc20fc 100644 --- a/tests/comfy_cli/output/test_branding.py +++ b/tests/comfy_cli/output/test_branding.py @@ -191,7 +191,8 @@ def test_intro_banner_signed_out_includes_wordmark_and_login_hint(): assert "Quick start" in out assert "comfy install" in out assert "comfy launch" in out - assert "comfy auth login" in out or "comfy cloud login" in out + assert "comfy cloud login" in out + assert "comfy auth login" not in out # `comfy auth ...` is the model-host token group, not Cloud sign-in assert "comfy discover" in out assert "comfy --help" in out assert "not signed in" in out @@ -229,5 +230,6 @@ def test_intro_banner_signed_in_shows_check_and_host(): def test_signed_out_banner_points_at_login(): out = _render(signed_out_banner(base_url="https://testcloud.comfy.org")) assert "not signed in" in out - assert "comfy auth login" in out or "comfy cloud login" in out + assert "comfy cloud login" in out + assert "comfy auth login" not in out # `comfy auth ...` is the model-host token group, not Cloud sign-in assert "testcloud.comfy.org" in out