Changesets · Branches · Tags · Compare
| Changeset | 66328f2e8dcfbe89907183fed02dcc8e8815f34d4bd6863aa0b841de8e69c59b |
|---|---|
| Author | Nate <sestinj@gmail.com> · 2025-08-28 20:37 -07:00 |
| Committer | Nate <sestinj@gmail.com> · 2025-08-28 20:37 -07:00 |
| Parents | 3dbe838518f2 |
2 files changed
modified extensions/cli/src/slashCommands.test.ts +22 −0
| @@ -96,6 +96,28 @@ | ||
| 96 | 96 | }); |
| 97 | 97 | |
| 98 | 98 | describe("handleSlashCommands", () => { |
| 99 | + it("should handle /help command", async () => { | |
| 100 | + const result = await handleSlashCommands("/help", mockAssistant); | |
| 101 | + | |
| 102 | + expect(result).toBeDefined(); | |
| 103 | + expect(result?.output).toContain("Keyboard Shortcuts:"); | |
| 104 | + expect(result?.output).toContain("Navigation:"); | |
| 105 | + expect(result?.output).toContain("↑/↓"); | |
| 106 | + expect(result?.output).toContain("Tab"); | |
| 107 | + expect(result?.output).toContain("Enter"); | |
| 108 | + expect(result?.output).toContain("Shift+Enter"); | |
| 109 | + expect(result?.output).toContain("Controls:"); | |
| 110 | + expect(result?.output).toContain("Ctrl+C"); | |
| 111 | + expect(result?.output).toContain("Ctrl+D"); | |
| 112 | + expect(result?.output).toContain("Ctrl+L"); | |
| 113 | + expect(result?.output).toContain("Shift+Tab"); | |
| 114 | + expect(result?.output).toContain("Esc"); | |
| 115 | + expect(result?.output).toContain("Special Characters:"); | |
| 116 | + expect(result?.output).toContain("@"); | |
| 117 | + expect(result?.output).toContain("/"); | |
| 118 | + expect(result?.exit).toBeUndefined(); | |
| 119 | + }); | |
| 120 | + | |
| 99 | 121 | it("should handle /info command when not authenticated", async () => { |
| 100 | 122 | const { isAuthenticated } = await import("./auth/workos.js"); |
| 101 | 123 | const { services } = await import("./services/index.js"); |
modified extensions/cli/src/slashCommands.ts +16 −8
| @@ -18,25 +18,33 @@ | ||
| 18 | 18 | assistant: AssistantConfig, |
| 19 | 19 | ) => Promise<SlashCommandResult> | SlashCommandResult; |
| 20 | 20 | |
| 21 | -async function handleHelp() { | |
| 21 | +async function handleHelp( | |
| 22 | + _args: string[], | |
| 23 | + _assistant: AssistantConfig, | |
| 24 | +) { | |
| 22 | 25 | const helpMessage = [ |
| 23 | 26 | chalk.bold("Keyboard Shortcuts:"), |
| 24 | 27 | "", |
| 25 | 28 | chalk.white("Navigation:"), |
| 26 | - ` ${chalk.cyan("↑/↓")} Navigate previous messages`, | |
| 29 | + ` ${chalk.cyan("↑/↓")} Navigate command/file suggestions or history`, | |
| 30 | + ` ${chalk.cyan("Tab")} Complete command or file selection`, | |
| 27 | 31 | ` ${chalk.cyan("Enter")} Submit message`, |
| 28 | - ` ${chalk.cyan("\\+Enter")} New line`, | |
| 32 | + ` ${chalk.cyan("Shift+Enter")} New line`, | |
| 33 | + ` ${chalk.cyan("\\")} Line continuation (at end of line)`, | |
| 29 | 34 | "", |
| 30 | 35 | chalk.white("Controls:"), |
| 31 | 36 | ` ${chalk.cyan("Ctrl+C")} Clear input`, |
| 32 | 37 | ` ${chalk.cyan("Ctrl+D")} Exit application`, |
| 33 | - ` ${chalk.cyan("Shift+Tab")} Cycle modes`, | |
| 34 | - ` ${chalk.cyan("Esc")} Interrupt`, | |
| 38 | + ` ${chalk.cyan("Ctrl+L")} Clear screen`, | |
| 39 | + ` ${chalk.cyan("Shift+Tab")} Cycle permission modes (normal/plan/auto)`, | |
| 40 | + ` ${chalk.cyan("Esc")} Cancel streaming or close suggestions`, | |
| 35 | 41 | "", |
| 36 | 42 | chalk.white("Special Characters:"), |
| 37 | - ` ${chalk.cyan("@")} Attach files`, | |
| 38 | - ` ${chalk.cyan("/")} Slash commands`, | |
| 39 | - "", | |
| 43 | + ` ${chalk.cyan("@")} Search and attach files for context`, | |
| 44 | + ` ${chalk.cyan("/")} Access slash commands`, | |
| 45 | + "", | |
| 46 | + chalk.white("Available Commands:"), | |
| 47 | + ` Type ${chalk.cyan("/")} to see available slash commands`, | |
| 40 | 48 | ].join("\n"); |
| 41 | 49 | posthogService.capture("useSlashCommand", { name: "help" }); |
| 42 | 50 | return { output: helpMessage }; |