gaunt-sloth-assistant
Version:
[](https://github.com/Galvanized-Pukeko/gaunt-sloth-assistant/actions/workflows/unit-tests.yml) [ {
program
.command('ask')
.description('Ask a question')
.argument('[message]', 'A message')
.option('-f, --file [files...]', 'Input files. Content of these files will be added BEFORE the message')
.action(async (message, options) => {
const config = await initConfig(commandLineConfigOverrides);
const systemPrompt = readSystemPrompt(config);
const preamble = [readBackstory(config), readGuidelines(config)];
if (systemPrompt) {
preamble.push(systemPrompt);
}
const content = [];
if (options.file) {
content.push(readMultipleFilesFromProjectDir(options.file));
}
const stringFromStdin = getStringFromStdin();
if (stringFromStdin) {
content.push(wrapContent(stringFromStdin, 'stdin-content'));
}
if (message) {
content.push(wrapContent(message, 'message', 'user message'));
}
// Validate that at least one input source is provided
if (content.length === 0) {
throw new Error('At least one of the following is required: file, stdin, or message');
}
const { askQuestion } = await import('#src/modules/questionAnsweringModule.js');
await askQuestion('ASK', preamble.join('\n'), content.join('\n'), config);
});
}
//# sourceMappingURL=askCommand.js.map