fix(cli): drop explicit CommandModule type from commands array to fix typecheck

UpgradeCommand and UninstallCommand are plain object literals (no cmd()
wrapper) whose handler param types don't satisfy CommandModule<any, any>.
Remove the annotation and let TypeScript infer the union type — consumers
already cast via loadCommands().
This commit is contained in:
Mark IJbema
2026-04-07 19:07:33 +02:00
parent 6690370fa1
commit 37c63e0f8d
+2 -3
View File
@@ -1,7 +1,6 @@
// All CommandModules in one place so help.ts and generate-cli-docs.ts can
// introspect them without importing index.ts (which has startup side effects).
// When upstream adds a new command to index.ts, add it here too.
import type { CommandModule } from "yargs"
import { AcpCommand } from "../cli/cmd/acp"
import { McpCommand } from "../cli/cmd/mcp"
import { TuiThreadCommand } from "../cli/cmd/tui/thread"
@@ -26,13 +25,13 @@ 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<any, any> = {
const CompletionCommand = {
command: "completion",
describe: "generate shell completion script",
handler: () => {},
}
export const commands: CommandModule<any, any>[] = [
export const commands = [
AcpCommand,
McpCommand,
TuiThreadCommand,