{"record":{"id":"1dc4bfe665d3f13a","repo":"diegosouzapw/OmniRoute","slug":"raycast-bearer-token-not-found-in-keychain-open","errorCode":null,"errorMessage":"Raycast bearer token not found in Keychain — open Raycast and sign in first","messagePattern":"Raycast bearer token not found in Keychain — open Raycast and sign in first","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/lib/oauth/services/raycastLocal.ts","lineNumber":170,"sourceCode":"  }\n  return existsSync(RAYCAST_DB) || existsSync(POSTHOG_DISTINCT);\n}\n\n/**\n * Pull Raycast Pro credentials from the local macOS install.\n * Bearer token: Keychain entry `raycast-store_credentials` → oauth.access_token\n * Device ID: user.analyticsId (same as posthog.distinctId)\n */\nexport function extractLocalRaycastCredentials(): RaycastLocalCredentials {\n  if (process.platform !== \"darwin\") {\n    throw new Error(\"Raycast auto-import is macOS-only\");\n  }\n\n  const store = readKeychainJson(\"raycast-store_credentials\");\n  const oauth = (store?.oauth || {}) as { access_token?: string };\n  const accessToken = oauth.access_token?.trim();\n  if (!accessToken) {\n    throw new Error(\n      \"Raycast bearer token not found in Keychain — open Raycast and sign in first\"\n    );\n  }\n\n  const analyticsFromDb = readAnalyticsIdFromDb();\n  const analyticsFromPosthog = readAnalyticsIdFromPosthog();\n  const deviceId = analyticsFromDb || analyticsFromPosthog;\n  if (!deviceId) {\n    throw new Error(\n      \"Raycast device/analytics ID not found — launch Raycast once so it writes local state\"\n    );\n  }\n\n  const profile = readUserProfile();\n  const user = (store?.user || {}) as { email?: string; username?: string };\n\n  return {\n    accessToken,","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/oauth/services/raycastLocal.ts#L152-L188","documentation":"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.","triggerScenarios":"Thrown at src/lib/oauth/services/raycastLocal.ts:170 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Open the Raycast app and sign in to Raycast Pro so the Keychain entry is populated","Retry auto-import after sign-in","If signed in but still failing, verify Keychain access permissions for the process reading raycast-store_credentials"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}