Repository navigation
fix(auth): point unauthenticated errors at browser login - #384
Merged
Merged
Conversation
Without a terminal, commands that need an account told the caller to set an API key or run "firecrawl login" in a terminal. An agent has no terminal, but "firecrawl login --browser" asks nothing on stdin, so it could have signed in all along. Every unauthenticated path now shares one message that leads with "firecrawl login --browser" and keeps FIRECRAWL_API_KEY and --api-key as the alternatives. The --status and setup hints name the same command, and the install skill describes what an agent actually sees. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a command that needs an account runs with no credentials and no terminal (the situation every agent is in), the CLI said:
That steers agents to an API key and tells them login needs a terminal. It does not:
firecrawl login --browserasks nothing on stdin. It prints a sign-in URL and polls until the user approves it, so an agent can run it directly. Plainfirecrawl login, which the old hints named, is the one that fails without a terminal.Other unauthenticated paths were worse.
validateConfigsaid "API key is required…" and pointed atfirecrawl config,termsanddoctorsaid to run plainfirecrawl login, and the Alexandria commands gave no next step at all.Change
One shared message,
LOGIN_GUIDANCEinsrc/utils/config.ts, used by every unauthenticated path:ensureAuthenticated(no-terminal branch),validateConfig,terms,doctorrun diagnostics andrequireAlexandriaKeyall use it.--statushint and the non-interactivesetuphint now namefirecrawl login --browserinstead of plainfirecrawl login.skills/firecrawl/rules/install.mdsaid account-only commands "prompt an interactive login"; it now describes what an agent sees and what to do with the sign-in URL.Interactive terminal behaviour is unchanged: the login prompt still appears there.
Testing
crawl,credit-usage,monitor list,listand--statuswith no credentials and stdin closed; each shows the new guidance.firecrawl login --browserwith stdin closed to confirm it prints the URL and polls without prompting.vitest run: 925 passed, 51 skipped. The two tests that pinned the old wording now assert the browser-login guidance.🤖 Generated with Claude Code