yamadashy/repomix · error · RepomixError

No valid file paths found in stdin input.

Error message

No valid file paths found in stdin input.

What it means

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.

Source

Thrown at src/core/file/fileStdin.ts:93

): Promise<StdinFileResult> => {
  logger.trace('Reading file paths from stdin...');

  try {
    const { stdin, createReadlineInterface } = deps;

    // Check if stdin is a TTY (interactive mode)
    if (stdin.isTTY) {
      throw new RepomixError('No data provided via stdin. Please pipe file paths to repomix when using --stdin flag.');
    }

    // Read all lines from stdin (wait for EOF)
    const rawLines = await readLinesFromStream(stdin as Readable, createReadlineInterface);

    // Filter out empty lines and comments
    const validLines = filterValidLines(rawLines);

    if (validLines.length === 0) {
      throw new RepomixError('No valid file paths found in stdin input.');
    }

    // Convert relative paths to absolute paths and deduplicate
    const filePaths = resolveAndDeduplicatePaths(validLines, cwd);

    logger.trace(`Found ${filePaths.length} file paths from stdin`);

    return {
      filePaths,
      emptyDirPaths: [], // Empty directories not supported with stdin input
    };
  } catch (error) {
    if (error instanceof RepomixError) {
      throw error;
    }

    if (error instanceof Error) {
      throw new RepomixError(`Failed to read file paths from stdin: ${error.message}`);

View on GitHub (pinned to f465ad9093)

Solutions

  1. Verify the upstream command actually outputs file paths (run it alone and inspect stdout).
  2. Uncomment or fix the path list you are piping in.
  3. Run the pipe from the correct working directory so relative paths resolve.
  4. If the repo has no tracked files, add files or use directory packing instead of --stdin.

Example fix

// before: all lines commented
# src/index.ts
# src/util.ts

// after
src/index.ts
src/util.ts
Defensive patterns

Strategy: validation

Validate before calling

const input = execSync('git ls-files').toString();
const valid = input.split('\n').filter(l => l.trim() && !l.trim().startsWith('#'));
if (valid.length === 0) {
  throw new Error('Upstream produced no file paths; fix the source command before piping to repomix --stdin.');
}

Try / catch

try {
  await repomix.pack({ input: { stdin: true } });
} catch (e) {
  if (e instanceof Error && e.message.includes('No valid file paths found in stdin')) {
    console.error('Check the upstream command output — it produced only blank/comment lines.');
  } else throw e;
}

Prevention

When it happens

Trigger: 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`.

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

Related errors


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