When credentials.json points at a custom apiUrl with no apiKey, the
status command was reporting "Not authenticated" and telling users to
run firecrawl login. Self-hosted Firecrawl instances do not require an
API key, so the setup is valid; the CLI should report it as such.
Adds a self-hosted auth source and treats it as authenticated for the
status path. Updates the queue-status and credit-usage fetch helpers to
omit the Authorization header when no apiKey is present, which removes
the "Bearer undefined" header that was being sent against self-hosted
servers.
Includes regression tests for the four authSource paths (env, stored,
self-hosted, none) and an explicit check that no Authorization header
goes out when the apiKey is missing.
Fixes firecrawl#53
Problem
firecrawl --status was reporting Not authenticated and pointing users at firecrawl login whenever the stored credentials only had apiUrl set (e.g. a self-hosted instance). Self-hosted Firecrawl does not require an API key, so this state is a valid configured setup, not a missing-credentials state.
The same code path also produced Authorization: Bearer undefined in outbound requests when apiKey was missing, since the header was unconditionally formatted from a possibly-undefined value.
Tracked as #53.
Repro on main
Fix
The cloud paths (env, stored) are unchanged.
Tests
New src/__tests__/commands/status.test.ts with four cases:
Verified locally:
The two new self-hosted tests fail on main (the bug), pass with the fix.