{"record":{"id":"2ecd03c356c4d116","repo":"thedotmack/claude-mem","slug":"non-interactive-provider-validation-did-not-run","errorCode":null,"errorMessage":"Non-interactive provider validation did not run.","messagePattern":"Non-interactive provider validation did not run\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/npx-cli/commands/install.ts","lineNumber":1112,"sourceCode":"    if (!wrote) {\n      p.cancel('Could not save the local Anthropic Max configuration.');\n      process.exit(1);\n    }\n    saveClaudeMemEnv({\n      ANTHROPIC_API_KEY: '',\n      ANTHROPIC_BASE_URL: '',\n      ANTHROPIC_AUTH_TOKEN: '',\n    });\n    log.info('Disabled cloud sync and saved local Anthropic Max configuration.');\n    log.info('Configured claude-mem to use your logged-in Claude SDK account.');\n  };\n\n  let selectedProvider: ProviderChoice;\n  if (options.provider) {\n    selectedProvider = options.provider;\n  } else {\n    if (!isInteractive) {\n      throw new Error('Non-interactive provider validation did not run.');\n    }\n    const labels = buildProviderLabels();\n\n    // Multiselect gives both choices square controls. Exactly one provider is\n    // still required; selecting both re-opens the prompt instead of guessing.\n    while (true) {\n      const providerResult = await p.multiselect<ProviderChoice>({\n        message: PROVIDER_PROMPT_MESSAGE,\n        options: [\n          { value: 'cmem', label: labels.cmem, hint: labels.cmemHint },\n          { value: 'claude', label: labels.claude, hint: labels.claudeHint },\n        ],\n        // CMEM Pro pre-selected: it is the recommended path and the one the\n        // funnel is built around. Selecting it no longer means \"pay now\" —\n        // it opens the offer page to read first.\n        initialValues: ['cmem'],\n        required: true,\n      });","sourceCodeStart":1094,"sourceCodeEnd":1130,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/npx-cli/commands/install.ts#L1094-L1130","documentation":"During non-interactive install, the provider must be supplied via the --provider option because no prompt can run. If no provider was chosen and the environment is non-interactive (no TTY), install throws this error rather than silently skipping provider selection. It signals a missing required option in headless contexts like CI or scripted installs.","triggerScenarios":"Running `cmem install` (or equivalent) in a non-interactive shell/CI without passing --provider, so `options.provider` is undefined and isInteractive is false.","commonSituations":"CI pipelines, Dockerfiles, or `curl | sh` style automation that forgot --provider; running install through a tool that detaches stdin; piping install output so it loses TTY detection.","solutions":["Pass --provider <name> (e.g. --provider claude) explicitly when running non-interactive installs.","Run install interactively in a real terminal to pick the provider via the prompt.","Pre-seed ~/.claude-mem/settings.json with CLAUDE_MEM_PROVIDER so selection is already resolved."],"exampleFix":"// before\ncmem install --yes\n// after\ncmem install --yes --provider claude","handlingStrategy":"validation","validationCode":"const nonInteractive = !process.stdin.isTTY;\nif (nonInteractive && !args.provider) throw new Error('non-interactive install requires --provider');","typeGuard":null,"tryCatchPattern":"try { await install(options); } catch (e) { if (e.message === 'Non-interactive provider validation did not run.') { await install({ ...options, provider: 'claude' }); } else throw e; }","preventionTips":["In CI scripts always pass --provider","Use --yes only together with a full set of non-interactive flags","Test install commands in a non-TTY shell (e.g. `cmd < /dev/null`) before shipping automation"],"tags":["cli","non-interactive","missing-option"],"backgroundTag":"missing-required-option","analyzedSha":"d8bc9755e74915e5c3b999181e10a67c889bce2a","analyzedAt":"2026-09-17T16:40:26.182Z","contentChangedAt":"2026-09-17T16:40:26.182Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}