{"record":{"id":"a9b7ea5ebc244680","repo":"thedotmack/claude-mem","slug":"cmem-pro-requires-a-signed-in-claude-mem-account","errorCode":null,"errorMessage":"CMEM Pro requires a signed-in claude-mem account.","messagePattern":"CMEM Pro requires a signed-in claude-mem account\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/npx-cli/commands/install.ts","lineNumber":1128,"sourceCode":"        p.cancel('Installation cancelled.');\n        process.exit(1);\n      }\n      if (providerResult.length === 1) {\n        selectedProvider = providerResult[0];\n        break;\n      }\n      log.warn('Select exactly one provider.');\n    }\n  }\n\n  // CMEM Pro: no new provider code. The worker's OpenRouter client is a generic\n  // OpenAI-compatible client whose endpoint and model both come from settings,\n  // so \"use the CMEM observer model\" is four settings writes and nothing else.\n  if (selectedProvider === 'cmem') {\n    if (!pairing) {\n      // Unreachable via the flag that skips login (it forces 'claude'), but a\n      // future caller passing null here would otherwise enroll against nothing.\n      throw new Error('CMEM Pro requires a signed-in claude-mem account.');\n    }\n    // The billing disclosure lives on the checkout page, not here. It is a term\n    // of the charge, so it belongs on the screen that takes the payment method,\n    // where it can be shown next to the price and the card field. Re-asking for\n    // it in the terminal made the user consent twice to the same thing, before\n    // ever seeing what they were agreeing to.\n    const enrollment = await completeCmemTrialPairing(pairing, version);\n    if (!enrollment) {\n      p.cancel('CMEM Pro setup was not completed. Run npx claude-mem install to try again.');\n      process.exit(1);\n    }\n    const cmemCredentials = resolveCmemMemoryCredentials(enrollment, persistedSettings);\n    if (!cmemCredentials) {\n      p.cancel('CMEM Pro did not return memory credentials. Run npx claude-mem install to try again.');\n      process.exit(1);\n    }\n\n    const wrote = mergeSettings(buildCmemActivationSettings(cmemCredentials));","sourceCodeStart":1110,"sourceCodeEnd":1146,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/8bc631a71a487424b866756e43a6efa4574cc66b/src/npx-cli/commands/install.ts#L1110-L1146","documentation":"Choosing the 'cmem' (CMEM Pro) provider requires pairing credentials from a signed-in claude-mem account. The install flow receives a `pairing` object from the login/pairing step; if it is null, enrolling against nothing would corrupt configuration, so the code throws. A comment notes the flag path that skips login forces provider 'claude', so in normal flow this is defensive.","triggerScenarios":"Selected provider is 'cmem' but the pairing argument is null — only reachable if a future/alternate caller passes null pairing instead of routing through the login-skip path that forces 'claude'.","commonSituations":"Custom scripts or plugins invoking the install routine directly with pairing=null while selecting cmem; account session expiring or login being skipped by a path that does not also force the provider away from cmem.","solutions":["Sign in to your claude-mem account first (run the login step) so pairing credentials are produced, then rerun install with provider cmem","Choose provider 'claude' instead if you intend to skip login","If invoking the installer programmatically, pass the pairing result from the pairing/login API rather than null"],"exampleFix":"// before\nawait configureProvider({ provider: 'cmem', pairing: null });\n// after\nconst pairing = await loginAndPair();\nawait configureProvider({ provider: 'cmem', pairing });","handlingStrategy":"try-catch","validationCode":"if (provider === 'cmem' && pairing == null) {\n  throw new Error('cmem provider requires completing login/pairing first');\n}","typeGuard":"const hasPairing = (p: unknown): p is Pairing =>\n  typeof p === 'object' && p !== null && 'memoryKey' in p;","tryCatchPattern":"try {\n  await configureProvider({ provider, pairing });\n} catch (e) {\n  if (e.message === 'CMEM Pro requires a signed-in claude-mem account.') {\n    await loginAndPair();\n    await configureProvider({ provider, pairing: getPairing() });\n  } else throw e;\n}","preventionTips":["Complete the claude-mem login step before selecting the cmem provider","When invoking the installer programmatically, pass the real pairing object, never null","If skipping login, use provider 'claude' rather than 'cmem'"],"tags":["authentication","cmem-pro","pairing","install"],"backgroundTag":"authentication-required","analyzedSha":"8bc631a71a487424b866756e43a6efa4574cc66b","analyzedAt":"2026-09-09T10:47:06.009Z","contentChangedAt":"2026-09-09T10:47:06.009Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}