Skip to content

Authentication browser not launching on Linux/macOS during codemie setup flow #205

@KlementMultiverse

Description

@KlementMultiverse

Problem

When running codemie setup to authenticate with external AI providers (Claude, Gemini, etc.), the CLI fails to open a browser window on Linux and macOS systems. Users are left at a blank terminal prompt without any guidance on how to complete the authentication flow.

This directly blocks new users from completing the initial setup wizard, making the CLI unusable out of the box on non-Windows platforms.

Current Behavior

  1. User runs codemie setup
  2. CLI prompts to authenticate with an external provider
  3. No browser window opens
  4. User is stuck with no clear next steps
  5. Setup flow cannot complete

Expected Behavior

  1. User runs codemie setup
  2. CLI opens the default browser to the authentication URL
  3. User completes authentication in the browser
  4. CLI receives the callback and continues setup
  5. Setup completes successfully

If browser launch fails, the CLI should:

  • Detect the failure gracefully
  • Display the authentication URL to the user
  • Provide clear instructions: "Please open this URL in your browser: [URL]"
  • Wait for the user to complete authentication
  • Continue the setup flow once auth is confirmed

Why This Matters

  • Issue [Bug]: No browser is opened for authentication #203 is marked as a confirmed bug affecting browser authentication
  • This is the primary blocker for new user onboarding on Linux and macOS
  • The quick start documentation mentions codemie setup as step 1, but doesn't document the failure or workaround
  • Without this, users cannot proceed past the initial setup step

Suggested Fix Location

Investigate src/cli/auth.ts (the authentication flow handler). The fix should:

  1. Attempt to launch the browser using a cross-platform library (e.g., open, opn, or open-cli)
  2. Add platform-specific fallbacks for Linux, macOS, and Windows
  3. Detect launch failure and fall back to displaying the URL
  4. Add debug logging to help diagnose platform-specific issues

Steps to Reproduce

  1. Install npm install -g @codemieai/code (or run locally)
  2. Run codemie setup on Linux or macOS
  3. Select an external provider (e.g., Claude)
  4. Observe: no browser opens, user is stuck

Additional Context

This is a high-priority usability issue since authentication is required to use the CLI. The setup wizard should be completely self-guided without requiring users to manually hunt for URLs or understand internal auth flows.


Contributed by Klement Gunndu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions