Skip to content

Commit

Permalink
fix(packages/qllm-cli/src): handle missing template in qllm command (#59
Browse files Browse the repository at this point in the history
)
  • Loading branch information
raphaelmansuy authored Sep 5, 2024
1 parent b742e86 commit f61db93
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/qllm-cli/src/qllm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ export async function main() {
"Variables to extract from the response, comma-separated",
)
.action(async (template, options, command) => {
const globalOptions = program.opts();
const mergedOptions = { ...globalOptions, ...options };

if (!template) {
command.help();
// If no template is provided, treat it as an "ask" command
await askCommandAction("", mergedOptions);
} else {
const globalOptions = program.opts();
const mergedOptions = { ...globalOptions, ...options };
await runActionCommand(template, mergedOptions);
}
});
Expand Down

0 comments on commit f61db93

Please sign in to comment.