From 8bcfcd439de2c9dba6e8acf54d4474d3d2f5a88a Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 19 Jun 2024 14:40:44 -0700 Subject: [PATCH] request description of cmd to be generated if not provided --- core/commands/slash/cmd.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/commands/slash/cmd.ts b/core/commands/slash/cmd.ts index c171384bd..00ba5b0de 100644 --- a/core/commands/slash/cmd.ts +++ b/core/commands/slash/cmd.ts @@ -14,6 +14,11 @@ const GenerateTerminalCommand: SlashCommand = { name: "cmd", description: "Generate a shell command", run: async function* ({ ide, llm, input }) { + if (input.trim() === "") { + yield "Please provide a description of the shell command you want to generate. For example, '/cmd List all files in the current directory'."; + return; + } + const gen = llm.streamComplete(`The user has made a request to run a shell command. Their description of what it should do is: