{"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":"Error \"Raycast bearer token not found in Keychain — open Raycast and sign in first\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/oauth/services/raycastLocal.ts:170 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}