UNPKG

@jasondark/proompt

Version:

CLI tool for running AI prompts with structure and repeatability

42 lines 1.63 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.executeRepomix = void 0; const repomix_1 = require("repomix"); /** * Execute repomix library to pack repository into XML format */ const executeRepomix = async (options) => { const { outputPath, workingDirectory = process.cwd(), excludePatterns = [], } = options; try { // Build repomix options for library usage const cliOptions = { output: outputPath, style: 'xml', ignore: ['CLAUDE.md', 'GEMINI.md', ...excludePatterns].join(','), quiet: true, compress: false, }; // Use repomix library to process the repository const result = await (0, repomix_1.runCli)(['.'], workingDirectory, cliOptions); // Check if the operation was successful - result can be void or DefaultActionRunnerResult if (result && typeof result === 'object' && 'packResult' in result) { if (result.packResult.totalFiles === 0) { throw new Error('Repomix completed but no files were processed'); } } else { // Result was void, which likely means success for quiet mode console.log('📦 Repository processing completed'); } } catch (error) { if (error instanceof Error) { throw new Error(`Repomix processing failed: ${error.message}`); } else { throw new Error('Repomix processing failed with unknown error'); } } }; exports.executeRepomix = executeRepomix; //# sourceMappingURL=repomix.js.map