-
Notifications
You must be signed in to change notification settings - Fork 30
Description
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
- User runs
codemie setup - CLI prompts to authenticate with an external provider
- No browser window opens
- User is stuck with no clear next steps
- Setup flow cannot complete
Expected Behavior
- User runs
codemie setup - CLI opens the default browser to the authentication URL
- User completes authentication in the browser
- CLI receives the callback and continues setup
- 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 setupas 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:
- Attempt to launch the browser using a cross-platform library (e.g.,
open,opn, oropen-cli) - Add platform-specific fallbacks for Linux, macOS, and Windows
- Detect launch failure and fall back to displaying the URL
- Add debug logging to help diagnose platform-specific issues
Steps to Reproduce
- Install
npm install -g @codemieai/code(or run locally) - Run
codemie setupon Linux or macOS - Select an external provider (e.g., Claude)
- 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