diff --git a/.changeset/wicked-numbers-approve.md b/.changeset/wicked-numbers-approve.md new file mode 100644 index 0000000000000000000000000000000000000000..9857840064bfb46ddadee7708bcc06b4c2b8132c --- /dev/null +++ b/.changeset/wicked-numbers-approve.md @@ -0,0 +1,5 @@ +--- +"create-llama": patch +--- + +feat: simplify CLI interface diff --git a/README.md b/README.md index 444fe30b6e354cea3e8bf3930149c7176b0ee39d..daa2c4e0d0e579e97b0d4bc8be9f00829bb6ffbf 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ Need to install the following packages: create-llama@latest Ok to proceed? (y) y ✔ What is your project named? … my-app -✔ Which template would you like to use? › Agentic RAG (single agent) +✔ Which template would you like to use? › Agentic RAG (e.g. chat with docs) ✔ Which framework would you like to use? › NextJS ✔ Would you like to set up observability? › No ✔ Please provide your OpenAI API key (leave blank to skip): … diff --git a/index.ts b/index.ts index 10dec40bac2a763bec926520808d41a6a971512b..8bef22df8b3352f969f51a0a6a7079e474a6b83e 100644 --- a/index.ts +++ b/index.ts @@ -174,6 +174,13 @@ const program = new Commander.Command(packageJson.name) ` Select LLM and embedding models. +`, + ) + .option( + "--ask-examples", + ` + + Select community templates and LlamaPacks. `, ) .allowUnknownOption() @@ -195,6 +202,7 @@ if ( program.useLlamaParse = false; } program.askModels = process.argv.includes("--ask-models"); +program.askExamples = process.argv.includes("--ask-examples"); if (process.argv.includes("--no-files")) { program.dataSources = []; } else if (process.argv.includes("--example-file")) { diff --git a/questions.ts b/questions.ts index 0ed90b7dd2374f62923c932ab2973dee108c1eba..4b1f61f317bb4de1b89e8259cf2f79b93ba04391 100644 --- a/questions.ts +++ b/questions.ts @@ -28,6 +28,7 @@ export type QuestionArgs = Omit< "appPath" | "packageManager" > & { askModels?: boolean; + askExamples?: boolean; }; const supportedContextFileTypes = [ ".pdf", @@ -338,20 +339,24 @@ export const askQuestions = async ( name: "template", message: "Which template would you like to use?", choices: [ - { title: "Agentic RAG (single agent)", value: "streaming" }, + { title: "Agentic RAG (e.g. chat with docs)", value: "streaming" }, { title: "Multi-agent app (using llama-agents)", value: "multiagent", }, { title: "Structured Extractor", value: "extractor" }, - { - title: `Community template from ${styledRepo}`, - value: "community", - }, - { - title: "Example using a LlamaPack", - value: "llamapack", - }, + ...(program.askExamples + ? [ + { + title: `Community template from ${styledRepo}`, + value: "community", + }, + { + title: "Example using a LlamaPack", + value: "llamapack", + }, + ] + : []), ], initial: 0, },