yamadashy/repomix · error

No repomix output file found in directory: ${inputPath}. Loo

Error message

No repomix output file found in directory: ${inputPath}. Looking for: ${possibleFiles.join(', ')}

What it means

This error is thrown by resolveOutputFilePath in the MCP attach-packed-output tool when the given inputPath is a directory that contains none of the repomix output files it knows how to attach (e.g. repomix-output.xml, repomix-output.md). The library scans the directory for files matching its default output file map and throws when no candidate exists, so it can refuse to attach a file it cannot parse.

Source

Thrown at src/mcp/tools/attachPackedOutputTool.ts:71

  try {
    const stats = await fs.stat(inputPath);

    if (stats.isDirectory()) {
      // If it's a directory, look for repomix output files in priority order
      const possibleFiles = Object.values(defaultFilePathMap);

      for (const fileName of possibleFiles) {
        const outputFilePath = path.join(inputPath, fileName);
        try {
          await fs.access(outputFilePath);
          const format = getFormatFromFileName(fileName);
          return { filePath: outputFilePath, format };
        } catch {
          // File doesn't exist, continue to next
        }
      }

      throw new Error(
        `No repomix output file found in directory: ${inputPath}. Looking for: ${possibleFiles.join(', ')}`,
      );
    }

    // If it's a file, check if it's a supported format
    const supportedExtensions = Object.values(defaultFilePathMap).map((file) => path.extname(file));
    const fileExtension = path.extname(inputPath).toLowerCase();

    if (!supportedExtensions.includes(fileExtension)) {
      throw new Error(
        `Unsupported file format: ${fileExtension}. Supported formats: ${supportedExtensions.join(', ')}`,
      );
    }

    const format = getFormatFromExtension(fileExtension);
    return { filePath: inputPath, format };
  } catch (error) {
    if (error instanceof Error && error.message.includes('ENOENT')) {

View on GitHub (pinned to f465ad9093)

Solutions

  1. Run repomix in that directory first so a default-named output file (repomix-output.xml/md/json/txt) exists
  2. Rename or copy your custom output file to a recognized default name (e.g. repomix-output.xml)
  3. Pass the output file path directly (not the directory) with the correct format
  4. Verify with `ls <dir>/repomix-output.*` that the file actually exists before calling the tool

Example fix

// before
await attachPackedOutput({ path: './my-project' }); // no repomix-output.* present
// after
await $`repomix --output repomix-output.xml`; // generate first
await attachPackedOutput({ path: './my-project' });
Defensive patterns

Strategy: validation

Validate before calling

import fs from 'node:fs';
const candidates = ['repomix-output.xml','repomix-output.md','repomix-output.json','repomix-output.txt'];
if (fs.statSync(inputPath).isDirectory() && !candidates.some(f => fs.existsSync(`${inputPath}/${f}`))) {
  throw new Error(`No repomix output in ${inputPath}; run repomix first`);
}

Try / catch

try {
  await attachPackedOutput({ path: inputPath });
} catch (e) {
  if (String(e.message).startsWith('No repomix output file found')) {
    // run repomix or correct the path, then retry
  } else throw e;
}

Prevention

When it happens

Trigger: Calling the attach packed output MCP tool with a directory path that has no repomix output file in it, or where the output file was deleted/renamed, or where repomix was run with a custom --output filename that is not one of the recognized defaults.

Common situations: Developers run `repomix` with a custom output name (e.g. `--output bundle.xml`) then point the MCP tool at the directory; or they point the tool at the wrong directory (project root vs a subfolder); or the output was generated into a different location than expected.

Related errors


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