yamadashy/repomix · warning

[stdin mode] No files received from stdin. Will search all f

Error message

[stdin mode] No files received from stdin. Will search all files matching include patterns.

What it means

In searchFiles, when repomix runs in stdin mode and the file list received from stdin is empty, it warns and falls back to searching all files matching the configured include patterns. Behavior continues normally; only the file scope changes.

Source

Thrown at src/core/file/fileSearch.ts:197

  }

  try {
    const { adjustedIgnorePatterns, ignoreFilePatterns, deferredIgnorePatterns } = await prepareIgnoreContext(
      rootDir,
      config,
    );

    logger.trace('Ignore patterns:', adjustedIgnorePatterns);
    logger.trace('Ignore file patterns:', ignoreFilePatterns);
    logger.trace('Deferred ignore patterns:', deferredIgnorePatterns);

    // Start with configured include patterns
    let includePatterns = config.include.map((pattern) => escapeGlobPattern(pattern));

    // If explicit files are provided, add them to include patterns
    if (explicitFiles) {
      if (explicitFiles.length === 0) {
        logger.warn('[stdin mode] No files received from stdin. Will search all files matching include patterns.');
      } else {
        logger.debug(`[stdin mode] Processing ${explicitFiles.length} explicit files`);
        logger.trace('[stdin mode] Explicit files (absolute):', explicitFiles);

        const relativePaths = explicitFiles.map((filePath) => {
          const relativePath = path.relative(rootDir, filePath);
          // Escape the path to handle special characters
          return escapeGlobPattern(relativePath);
        });

        logger.trace('[stdin mode] Explicit files (relative, escaped):', relativePaths);
        logger.trace('[stdin mode] Include patterns before merge:', includePatterns);

        includePatterns = [...includePatterns, ...relativePaths];

        logger.debug(`[stdin mode] Total include patterns after merge: ${includePatterns.length}`);
      }
    }

View on GitHub (pinned to f465ad9093)

Solutions

  1. Verify the upstream command actually lists files: run `git ls-files` (or your pipeline source) before piping to repomix.
  2. If a full-pack search is intended, ignore the warning — it will process all include-matching files.
  3. If stdin mode is unintended, pass file paths via --include patterns instead of relying on stdin.
  4. Check cwd: an empty or wrong directory yields no stdin files and no matches.

Example fix

// before: empty diff on clean tree
$ git diff --name-only | repomix --stdin
// after: fall back explicitly when empty
$ FILES=$(git diff --name-only); [ -n "$FILES" ] && echo "$FILES" | repomix --stdin || repomix
Defensive patterns

Strategy: validation

Validate before calling

const files = getStdinFileList(); // e.g. git ls-files / git diff --name-only
if (!files || files.length === 0) throw new Error('stdin file list is empty; pipeline upstream produced nothing');

Type guard

const hasFiles = (list) => Array.isArray(list) && list.length > 0;

Try / catch

const files = await collectStdinFiles();
const result = hasFiles(files)
  ? await repomix({ stdinFiles: files })
  : await repomix({}); // full search fallback

Prevention

When it happens

Trigger: Explicit file list is an empty array in stdin mode — e.g. piping an empty/failed `git ls-files`/`git diff --name-only` result into repomix, or a glob producing zero files.

Common situations: Running on a repo with no changes (`git diff --name-only` empty); piping output of a command that failed silently; running in an empty directory; scripts that pass stdin mode unconditionally.

Related errors


AI-assisted analysis of yamadashy/repomix@f465ad9093 (2026-08-29). Data as JSON: /api/errors/193ab7a9d2090d7e. Report an issue: GitHub.