From 6690370fa1f89f6398fa09db3b57d964f85adc8e Mon Sep 17 00:00:00 2001 From: Mark IJbema Date: Tue, 7 Apr 2026 19:01:30 +0200 Subject: [PATCH] fix(cli): add completion command to commands array for help --all and cli-reference The shell-completion entrypoint was registered via .completion() in index.ts but missing from the commands array used by generateHelp(). This meant kilo help --all and cli-reference.md never included it. Add a synthetic CommandModule entry for completion to commands.ts and remove the now-redundant manual row in generateCommandTable(). --- packages/opencode/src/kilocode/commands.ts | 9 +++++++++ packages/opencode/src/kilocode/help.ts | 5 ----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/opencode/src/kilocode/commands.ts b/packages/opencode/src/kilocode/commands.ts index 989d055f835..af015a84959 100644 --- a/packages/opencode/src/kilocode/commands.ts +++ b/packages/opencode/src/kilocode/commands.ts @@ -24,6 +24,14 @@ import { RemoteCommand } from "../cli/cmd/remote" import { DbCommand } from "../cli/cmd/db" import { HelpCommand } from "./help-command" +// Synthetic entry for the yargs built-in .completion() command so that +// generateHelp --all and cli-reference.md include it automatically. +const CompletionCommand: CommandModule = { + command: "completion", + describe: "generate shell completion script", + handler: () => {}, +} + export const commands: CommandModule[] = [ AcpCommand, McpCommand, @@ -46,4 +54,5 @@ export const commands: CommandModule[] = [ RemoteCommand, DbCommand, HelpCommand, + CompletionCommand, ] diff --git a/packages/opencode/src/kilocode/help.ts b/packages/opencode/src/kilocode/help.ts index 1919fee4bb4..206ca744bbb 100644 --- a/packages/opencode/src/kilocode/help.ts +++ b/packages/opencode/src/kilocode/help.ts @@ -227,11 +227,6 @@ export async function generateCommandTable(options?: { commands?: Cmd[] }) { }) } - rows.push({ - display: "kilo completion", - description: "generate shell completion script", - }) - const lines = ["| Command | Description |", "| --- | --- |"] for (const row of rows) {