thedotmack/claude-mem · error

Non-interactive provider validation did not run.

Error message

Non-interactive provider validation did not run.

What it means

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.

Solutions

  1. Pass --provider <name> (e.g. --provider claude) explicitly when running non-interactive installs.
  2. Run install interactively in a real terminal to pick the provider via the prompt.
  3. Pre-seed ~/.claude-mem/settings.json with CLAUDE_MEM_PROVIDER so selection is already resolved.

Example fix

// before
cmem install --yes
// after
cmem install --yes --provider claude
Defensive patterns

Strategy: validation

Validate before calling

const nonInteractive = !process.stdin.isTTY;
if (nonInteractive && !args.provider) throw new Error('non-interactive install requires --provider');

Try / catch

try { await install(options); } catch (e) { if (e.message === 'Non-interactive provider validation did not run.') { await install({ ...options, provider: 'claude' }); } else throw e; }

Prevention

When it happens

Trigger: Running `cmem install` (or equivalent) in a non-interactive shell/CI without passing --provider, so `options.provider` is undefined and isInteractive is false.

Common situations: 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.

Understand the failure class

Background: "Must pass :limit option" / "Missing required option" — required option errors explained — this error's family across 41 libraries.

Related errors


AI-assisted analysis of thedotmack/claude-mem@d8bc9755e7 (2026-09-17). Data as JSON: /api/errors/2ecd03c356c4d116. Report an issue: GitHub.

Appendix: source

Thrown at src/npx-cli/commands/install.ts:1112

    if (!wrote) {
      p.cancel('Could not save the local Anthropic Max configuration.');
      process.exit(1);
    }
    saveClaudeMemEnv({
      ANTHROPIC_API_KEY: '',
      ANTHROPIC_BASE_URL: '',
      ANTHROPIC_AUTH_TOKEN: '',
    });
    log.info('Disabled cloud sync and saved local Anthropic Max configuration.');
    log.info('Configured claude-mem to use your logged-in Claude SDK account.');
  };

  let selectedProvider: ProviderChoice;
  if (options.provider) {
    selectedProvider = options.provider;
  } else {
    if (!isInteractive) {
      throw new Error('Non-interactive provider validation did not run.');
    }
    const labels = buildProviderLabels();

    // Multiselect gives both choices square controls. Exactly one provider is
    // still required; selecting both re-opens the prompt instead of guessing.
    while (true) {
      const providerResult = await p.multiselect<ProviderChoice>({
        message: PROVIDER_PROMPT_MESSAGE,
        options: [
          { value: 'cmem', label: labels.cmem, hint: labels.cmemHint },
          { value: 'claude', label: labels.claude, hint: labels.claudeHint },
        ],
        // CMEM Pro pre-selected: it is the recommended path and the one the
        // funnel is built around. Selecting it no longer means "pay now" —
        // it opens the offer page to read first.
        initialValues: ['cmem'],
        required: true,
      });

View on GitHub (pinned to d8bc9755e7)