thedotmack/claude-mem · error

Non-interactive provider validation did not run.

Error message

Non-interactive provider validation did not run.

What it means

During install, if no --provider flag was supplied the command normally opens an interactive multiselect prompt to choose one. In a non-interactive environment (piped stdin, CI, no TTY) prompts cannot run, and if the earlier non-interactive provider validation did not populate a selection, the install throws this error rather than silently picking a provider.

Source

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

    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 8bc631a71a)

Solutions

  1. Pass an explicit provider: npx claude-mem install --provider claude (or host/cmem)
  2. Run the installer in an interactive terminal (no pipe/redirect of stdin)
  3. If scripting, supply any other required non-interactive inputs (API keys etc.) alongside --provider

Example fix

// before
npx claude-mem install < /dev/null
// after
npx claude-mem install --provider claude
Defensive patterns

Strategy: try-catch

Validate before calling

if (!process.argv.includes('--provider') && !process.stdout.isTTY) {
  throw new Error('Non-interactive install requires --provider');
}

Try / catch

try {
  await runInstall(options);
} catch (e) {
  if (e.message === 'Non-interactive provider validation did not run.') {
    console.error('Pass --provider <claude|host|cmem|...> when running non-interactively.');
    process.exitCode = 2;
  } else throw e;
}

Prevention

When it happens

Trigger: Running the installer non-interactively (e.g. `npx claude-mem install < /dev/null`, CI job, scripted run) without passing --provider, so options.provider is undefined and isInteractive is false.

Common situations: Automated install scripts and CI pipelines forgetting the --provider flag; running install inside a container where TTY detection fails; piping output which disables interactivity.

Understand the failure class

Background: "--flag is required" and "must specify" CLI errors: how missing-required-flag validation works and how to fix it — this error's family across 20 libraries.

Related errors


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