outputs to seperate file

This commit is contained in:
David Zhang
2025-02-05 09:08:48 -08:00
parent d4968f3127
commit 09453103e0
3 changed files with 9 additions and 16 deletions

3
.gitignore vendored
View File

@@ -1,5 +1,8 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# Output files
output.md
# Dependencies
node_modules
.pnp

View File

@@ -118,7 +118,7 @@ The system will then:
3. Recursively explore deeper based on findings
4. Generate a comprehensive markdown report
The final report will be saved as `report.md` in your working directory.
The final report will be saved as `output.md` in your working directory.
## How It Works

View File

@@ -25,17 +25,9 @@ async function run() {
// Get breath and depth parameters
const breadth =
parseInt(
await askQuestion(
'Enter research breadth (recommended 2-10, default 4): ',
),
10,
) || 4;
parseInt(await askQuestion('Enter research breadth (recommended 2-10, default 4): '), 10) || 4;
const depth =
parseInt(
await askQuestion('Enter research depth (recommended 1-5, default 2): '),
10,
) || 2;
parseInt(await askQuestion('Enter research depth (recommended 1-5, default 2): '), 10) || 2;
console.log(`Creating research plan...`);
@@ -71,9 +63,7 @@ ${followUpQuestions.map((q, i) => `Q: ${q}\nA: ${answers[i]}`).join('\n')}
});
console.log(`\n\nLearnings:\n\n${learnings.join('\n')}`);
console.log(
`\n\nVisited URLs (${visitedUrls.length}):\n\n${visitedUrls.join('\n')}`,
);
console.log(`\n\nVisited URLs (${visitedUrls.length}):\n\n${visitedUrls.join('\n')}`);
console.log('Writing final report...');
const report = await writeFinalReport({
@@ -83,10 +73,10 @@ ${followUpQuestions.map((q, i) => `Q: ${q}\nA: ${answers[i]}`).join('\n')}
});
// Save report to file
await fs.writeFile('report.md', report, 'utf-8');
await fs.writeFile('output.md', report, 'utf-8');
console.log(`\n\nFinal Report:\n\n${report}`);
console.log('\nReport has been saved to report.md');
console.log('\nReport has been saved to output.md');
rl.close();
}