yamadashy/repomix · error · RepomixError
Failed to read file paths from stdin: ${error.message}
Error message
Failed to read file paths from stdin: ${error.message} What it means
Wrapper error from readFilePathsFromStdin: any non-RepomixError Error while reading stdin (stream/readline failures) is rethrown as a RepomixError carrying the original message. RepomixError instances pass through unchanged.
Source
Thrown at src/core/file/fileStdin.ts:111
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}`);
}
throw new RepomixError('An unexpected error occurred while reading from stdin.');
}
};
View on GitHub (pinned to f465ad9093)
Solutions
- Check the 'Failed to read file paths from stdin:' suffix for the underlying cause and fix that.
- Ensure the upstream pipe command completes successfully and is not killed early.
- Re-run with a simple test pipe (`echo src/index.ts | repomix --stdin`) to isolate the issue.
- If injecting custom deps, verify createReadlineInterface and the stream behave per Node readline contract.
Example fix
// before: upstream killed early, EPIPE some-long-cmd | head -c 10 | repomix --stdin // after: let upstream finish some-long-cmd | repomix --stdin
Defensive patterns
Strategy: try-catch
Validate before calling
// Ensure the pipe source succeeds before reading stdin in repomix
const probe = spawnSync(upstreamCmd, { encoding: 'utf8' });
if (probe.status !== 0) throw new Error(`Upstream command failed: ${probe.stderr}`); Try / catch
try {
await repomix.pack({ input: { stdin: true } });
} catch (e) {
if (e instanceof Error && e.message.startsWith('Failed to read file paths from stdin:')) {
console.error('Stdin stream error:', e.message.replace('Failed to read file paths from stdin: ', ''));
} else throw e;
} Prevention
- Don't truncate the pipe early (avoid `| head` upstream of repomix).
- Check the upstream process exit status before piping.
- Test with a trivial pipe (`echo src/index.ts | repomix --stdin`) to isolate stream issues.
- Keep stdin as UTF-8 text; avoid piping binary data.
When it happens
Trigger: An Error thrown during stdin stream reading — e.g. the piped stream emits 'error', readline interface creation fails, or the stream is closed prematurely — that is not already a RepomixError.
Common situations: Pipes broken by the upstream process dying mid-write (EPIPE), custom deps injected into readFilePathsFromStdin that fail, or non-UTF8/binary data causing decoding issues.
Related errors
- An unexpected error occurred while reading from stdin.
- When using --stdin, do not specify directory arguments. File
- Failed to filter files in directory ${rootDir}. Reason: ${er
- No data provided via stdin. Please pipe file paths to repomi
- No valid file paths found in stdin input.
AI-assisted analysis of yamadashy/repomix@f465ad9093 (2026-08-29).
Data as JSON: /api/errors/e7cf3ddb41c6a130.
Report an issue: GitHub.