Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions comfy_cli/cloud/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions comfy_cli/command/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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


Expand Down
4 changes: 2 additions & 2 deletions comfy_cli/command/models/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion comfy_cli/command/run/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
12 changes: 6 additions & 6 deletions comfy_cli/command/run_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
],
Expand Down Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion comfy_cli/command/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion comfy_cli/output/branding.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ---------------------------------------------------------------------------


Expand Down
18 changes: 17 additions & 1 deletion tests/comfy_cli/command/test_run_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions tests/comfy_cli/output/test_branding.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Loading