feat: add completion subcommand to generate shell completion scripts for Zsh, Bash, PowerShell, and Fish.

This commit is contained in:
Shakker
2026-01-31 03:37:12 +00:00
committed by Shakker
parent bf15d0a3f5
commit 14c77f8295
2 changed files with 318 additions and 0 deletions

View File

@@ -227,8 +227,20 @@ const entries: SubCliEntry[] = [
mod.registerUpdateCli(program);
},
},
{
name: "completion",
description: "Generate shell completion script",
register: async (program) => {
const mod = await import("../completion-cli.js");
mod.registerCompletionCli(program);
},
},
];
export function getSubCliEntries(): SubCliEntry[] {
return entries;
}
function removeCommand(program: Command, command: Command) {
const commands = program.commands as Command[];
const index = commands.indexOf(command);