Skip to content
This repository was archived by the owner on Feb 15, 2026. It is now read-only.
This repository was archived by the owner on Feb 15, 2026. It is now read-only.

Login hangs in headless/CLI environments #1

@Alan-221b

Description

@Alan-221b

Bug: Login command hangs in headless/CLI environments

Problem

When running keyway login in certain CLI environments (VS Code integrated terminal, SSH sessions, headless servers), the login flow hangs after displaying the verification URL. The CLI never starts polling for OAuth completion.

Root Cause

The browser.OpenURL() call is blocking in these environments. The function waits for the browser process to complete, which prevents the polling loop from starting.

Current Behavior

│ Code: ABCD-1234
│ Open: https://api.keyway.sh/v1/auth/device/verify?user_code=ABCD-1234
[hangs indefinitely - no "Waiting for authorization..." spinner]

Expected Behavior

The CLI should display the URL, attempt to open the browser non-blocking, and immediately start polling for OAuth completion.

Solution

  1. Run browser.OpenURL() in a goroutine to avoid blocking
  2. Add a helpful message for users in environments where the browser doesn't open automatically

Affected File

  • internal/cmd/login.go

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions