{"record":{"id":"49cb46a71da12946","repo":"yamadashy/repomix","slug":"no-valid-file-paths-found-in-stdin-input","errorCode":null,"errorMessage":"No valid file paths found in stdin input.","messagePattern":"No valid file paths found in stdin input\\.","errorType":"exception","errorClass":"RepomixError","httpStatus":null,"severity":"error","filePath":"src/core/file/fileStdin.ts","lineNumber":93,"sourceCode":"): Promise<StdinFileResult> => {\n  logger.trace('Reading file paths from stdin...');\n\n  try {\n    const { stdin, createReadlineInterface } = deps;\n\n    // Check if stdin is a TTY (interactive mode)\n    if (stdin.isTTY) {\n      throw new RepomixError('No data provided via stdin. Please pipe file paths to repomix when using --stdin flag.');\n    }\n\n    // Read all lines from stdin (wait for EOF)\n    const rawLines = await readLinesFromStream(stdin as Readable, createReadlineInterface);\n\n    // Filter out empty lines and comments\n    const validLines = filterValidLines(rawLines);\n\n    if (validLines.length === 0) {\n      throw new RepomixError('No valid file paths found in stdin input.');\n    }\n\n    // Convert relative paths to absolute paths and deduplicate\n    const filePaths = resolveAndDeduplicatePaths(validLines, cwd);\n\n    logger.trace(`Found ${filePaths.length} file paths from stdin`);\n\n    return {\n      filePaths,\n      emptyDirPaths: [], // Empty directories not supported with stdin input\n    };\n  } catch (error) {\n    if (error instanceof RepomixError) {\n      throw error;\n    }\n\n    if (error instanceof Error) {\n      throw new RepomixError(`Failed to read file paths from stdin: ${error.message}`);","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/yamadashy/repomix/blob/f465ad909315a22120636baf03fa5e28701a50cb/src/core/file/fileStdin.ts#L75-L111","documentation":"Thrown by readFilePathsFromStdin when stdin data was received but, after filtering empty lines and comments, no valid file path lines remain. Repomix cannot proceed with an empty path list.","triggerScenarios":"Piping input that contains only blank lines or comment lines (e.g. output of a command that matched nothing, or a file consisting solely of comments) into `repomix --stdin`.","commonSituations":"`git ls-files` in an empty/brand-new repo, a grep/find filter that excluded everything, or piping a comment-annotated list file whose entries are all commented out.","solutions":["Verify the upstream command actually outputs file paths (run it alone and inspect stdout).","Uncomment or fix the path list you are piping in.","Run the pipe from the correct working directory so relative paths resolve.","If the repo has no tracked files, add files or use directory packing instead of --stdin."],"exampleFix":"// before: all lines commented\n# src/index.ts\n# src/util.ts\n\n// after\nsrc/index.ts\nsrc/util.ts","handlingStrategy":"validation","validationCode":"const input = execSync('git ls-files').toString();\nconst valid = input.split('\\n').filter(l => l.trim() && !l.trim().startsWith('#'));\nif (valid.length === 0) {\n  throw new Error('Upstream produced no file paths; fix the source command before piping to repomix --stdin.');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await repomix.pack({ input: { stdin: true } });\n} catch (e) {\n  if (e instanceof Error && e.message.includes('No valid file paths found in stdin')) {\n    console.error('Check the upstream command output — it produced only blank/comment lines.');\n  } else throw e;\n}","preventionTips":["Run the upstream path-listing command alone and confirm non-empty output first.","In empty repos, add files or pack a directory instead of using --stdin.","Avoid piping lists where every entry is commented out.","Run the pipe from the correct working directory."],"tags":["stdin","cli","validation"],"backgroundTag":"empty-input-list","analyzedSha":"f465ad909315a22120636baf03fa5e28701a50cb","analyzedAt":"2026-08-29T01:27:42.024Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}