diegosouzapw/OmniRoute · error · Error

Raycast bearer token not found in Keychain — open Raycast…

Error message

Raycast bearer token not found in Keychain — open Raycast and sign in first

What it means

extractLocalRaycastCredentials read the Keychain entry raycast-store_credentials but the nested oauth.access_token was absent/empty. Raycast stores its signed-in session there, so this means Raycast has not been signed in (or its credentials were never written) on this machine.

Solutions

  1. Open the Raycast app and sign in to Raycast Pro so the Keychain entry is populated
  2. Retry auto-import after sign-in
  3. If signed in but still failing, verify Keychain access permissions for the process reading raycast-store_credentials
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/lib/oauth/services/raycastLocal.ts:170 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/1dc4bfe665d3f13a. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/oauth/services/raycastLocal.ts:170

  }
  return existsSync(RAYCAST_DB) || existsSync(POSTHOG_DISTINCT);
}

/**
 * Pull Raycast Pro credentials from the local macOS install.
 * Bearer token: Keychain entry `raycast-store_credentials` → oauth.access_token
 * Device ID: user.analyticsId (same as posthog.distinctId)
 */
export function extractLocalRaycastCredentials(): RaycastLocalCredentials {
  if (process.platform !== "darwin") {
    throw new Error("Raycast auto-import is macOS-only");
  }

  const store = readKeychainJson("raycast-store_credentials");
  const oauth = (store?.oauth || {}) as { access_token?: string };
  const accessToken = oauth.access_token?.trim();
  if (!accessToken) {
    throw new Error(
      "Raycast bearer token not found in Keychain — open Raycast and sign in first"
    );
  }

  const analyticsFromDb = readAnalyticsIdFromDb();
  const analyticsFromPosthog = readAnalyticsIdFromPosthog();
  const deviceId = analyticsFromDb || analyticsFromPosthog;
  if (!deviceId) {
    throw new Error(
      "Raycast device/analytics ID not found — launch Raycast once so it writes local state"
    );
  }

  const profile = readUserProfile();
  const user = (store?.user || {}) as { email?: string; username?: string };

  return {
    accessToken,

View on GitHub (pinned to a179ffed5b)