{"record":{"id":"193ab7a9d2090d7e","repo":"yamadashy/repomix","slug":"stdin-mode-no-files-received-from-stdin-will-se","errorCode":null,"errorMessage":"[stdin mode] No files received from stdin. Will search all files matching include patterns.","messagePattern":"\\[stdin mode\\] No files received from stdin\\. Will search all files matching include patterns\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/core/file/fileSearch.ts","lineNumber":197,"sourceCode":"  }\n\n  try {\n    const { adjustedIgnorePatterns, ignoreFilePatterns, deferredIgnorePatterns } = await prepareIgnoreContext(\n      rootDir,\n      config,\n    );\n\n    logger.trace('Ignore patterns:', adjustedIgnorePatterns);\n    logger.trace('Ignore file patterns:', ignoreFilePatterns);\n    logger.trace('Deferred ignore patterns:', deferredIgnorePatterns);\n\n    // Start with configured include patterns\n    let includePatterns = config.include.map((pattern) => escapeGlobPattern(pattern));\n\n    // If explicit files are provided, add them to include patterns\n    if (explicitFiles) {\n      if (explicitFiles.length === 0) {\n        logger.warn('[stdin mode] No files received from stdin. Will search all files matching include patterns.');\n      } else {\n        logger.debug(`[stdin mode] Processing ${explicitFiles.length} explicit files`);\n        logger.trace('[stdin mode] Explicit files (absolute):', explicitFiles);\n\n        const relativePaths = explicitFiles.map((filePath) => {\n          const relativePath = path.relative(rootDir, filePath);\n          // Escape the path to handle special characters\n          return escapeGlobPattern(relativePath);\n        });\n\n        logger.trace('[stdin mode] Explicit files (relative, escaped):', relativePaths);\n        logger.trace('[stdin mode] Include patterns before merge:', includePatterns);\n\n        includePatterns = [...includePatterns, ...relativePaths];\n\n        logger.debug(`[stdin mode] Total include patterns after merge: ${includePatterns.length}`);\n      }\n    }","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/yamadashy/repomix/blob/f465ad909315a22120636baf03fa5e28701a50cb/src/core/file/fileSearch.ts#L179-L215","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the upstream command actually lists files: run `git ls-files` (or your pipeline source) before piping to repomix.","If a full-pack search is intended, ignore the warning — it will process all include-matching files.","If stdin mode is unintended, pass file paths via --include patterns instead of relying on stdin.","Check cwd: an empty or wrong directory yields no stdin files and no matches."],"exampleFix":"// before: empty diff on clean tree\n$ git diff --name-only | repomix --stdin\n// after: fall back explicitly when empty\n$ FILES=$(git diff --name-only); [ -n \"$FILES\" ] && echo \"$FILES\" | repomix --stdin || repomix","handlingStrategy":"validation","validationCode":"const files = getStdinFileList(); // e.g. git ls-files / git diff --name-only\nif (!files || files.length === 0) throw new Error('stdin file list is empty; pipeline upstream produced nothing');","typeGuard":"const hasFiles = (list) => Array.isArray(list) && list.length > 0;","tryCatchPattern":"const files = await collectStdinFiles();\nconst result = hasFiles(files)\n  ? await repomix({ stdinFiles: files })\n  : await repomix({}); // full search fallback","preventionTips":["Run the upstream listing command (git ls-files / diff) and check it is non-empty before piping.","Don't use stdin mode unconditionally in scripts; branch on whether files exist.","Confirm the working directory is the intended repo root."],"tags":["stdin","file-search","git","empty-input"],"backgroundTag":"empty-stdin-input","analyzedSha":"f465ad909315a22120636baf03fa5e28701a50cb","analyzedAt":"2026-08-29T01:27:42.024Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}