sort slash commands

This commit is contained in:
Ting-Wai To 2025-08-13 22:04:44 -07:00
parent 83d89fa135
commit 10803dfbaa

View file

@ -1,4 +1,5 @@
import { type AssistantConfig } from "@continuedev/sdk";
import chalk from "chalk";
import {
isAuthenticated,
@ -78,9 +79,10 @@ async function handleHelp(args: string[], assistant: AssistantConfig) {
const helpMessage = [
"Slash commands:",
...allCommands
.sort((a, b) => a.name.localeCompare(b.name))
.map(
(cmd) =>
`- /${cmd.name}: ${cmd.description}`,
`- ${chalk.white(`/${cmd.name}:`)} ${chalk.gray(cmd.description)}`,
),
].join("\n");
posthogService.capture("useSlashCommand", { name: "help" });