diff --git a/packages/kilo-docs/markdoc/partials/cli-commands-table.md b/packages/kilo-docs/markdoc/partials/cli-commands-table.md index 9c37b72ba1a..d6437cac497 100644 --- a/packages/kilo-docs/markdoc/partials/cli-commands-table.md +++ b/packages/kilo-docs/markdoc/partials/cli-commands-table.md @@ -13,7 +13,6 @@ | `kilo upgrade [target]` | upgrade kilo to the latest or a specific version | | `kilo uninstall` | uninstall kilo and remove all related files | | `kilo serve` | starts a headless kilo server | -| `kilo web` | start kilo server and open web interface | | `kilo models [provider]` | list all available models | | `kilo stats` | show token usage and cost statistics | | `kilo export [sessionID]` | export session data as JSON | diff --git a/packages/kilo-docs/pages/code-with-ai/platforms/cli-reference.md b/packages/kilo-docs/pages/code-with-ai/platforms/cli-reference.md index 484bfc93e84..ed944d4407a 100644 --- a/packages/kilo-docs/pages/code-with-ai/platforms/cli-reference.md +++ b/packages/kilo-docs/pages/code-with-ai/platforms/cli-reference.md @@ -644,21 +644,6 @@ Options: --cors additional domains to allow for CORS [array] [default: []] ``` -## kilo web - -``` -start kilo server and open web interface - -Options: - --help Show help [boolean] - --version Show version number [boolean] - --port port to listen on [number] [default: 0] - --hostname hostname to listen on [string] [default: "127.0.0.1"] - --mdns enable mDNS service discovery (defaults hostname to 0.0.0.0) [boolean] [default: false] - --mdns-domain custom domain name for mDNS service (default: kilo.local) [string] [default: "kilo.local"] - --cors additional domains to allow for CORS [array] [default: []] -``` - ## kilo models ``` diff --git a/packages/opencode/src/cli/commands.ts b/packages/opencode/src/cli/commands.ts deleted file mode 100644 index ab2135c43f7..00000000000 --- a/packages/opencode/src/cli/commands.ts +++ /dev/null @@ -1,52 +0,0 @@ -// kilocode_change - new file -// Command barrel: exports the list of CommandModules with no side effects. -// Keeping this separate from index.ts allows help.ts and generate-cli-docs.ts -// to import commands for introspection without triggering the CLI startup code -// (middleware, telemetry, migrations, etc.) that lives in index.ts. -import { AcpCommand } from "./cmd/acp" -import { McpCommand } from "./cmd/mcp" -import { TuiThreadCommand } from "./cmd/tui/thread" -import { AttachCommand } from "./cmd/tui/attach" -import { RunCommand } from "./cmd/run" -import { GenerateCommand } from "./cmd/generate" -import { DebugCommand } from "./cmd/debug" -import { AuthCommand } from "./cmd/auth" -import { AgentCommand } from "./cmd/agent" -import { UpgradeCommand } from "./cmd/upgrade" -import { UninstallCommand } from "./cmd/uninstall" -import { ServeCommand } from "./cmd/serve" -import { WebCommand } from "./cmd/web" -import { ModelsCommand } from "./cmd/models" -import { StatsCommand } from "./cmd/stats" -import { ExportCommand } from "./cmd/export" -import { ImportCommand } from "./cmd/import" -import { PrCommand } from "./cmd/pr" -import { SessionCommand } from "./cmd/session" -import { RemoteCommand } from "./cmd/remote" // kilocode_change -import { DbCommand } from "./cmd/db" -import { HelpCommand } from "../kilocode/help-command" // kilocode_change - -export const commands = [ - AcpCommand, - McpCommand, - TuiThreadCommand, - AttachCommand, - RunCommand, - GenerateCommand, - DebugCommand, - AuthCommand, - AgentCommand, - UpgradeCommand, - UninstallCommand, - ServeCommand, - WebCommand, - ModelsCommand, - StatsCommand, - ExportCommand, - ImportCommand, - PrCommand, - SessionCommand, - RemoteCommand, // kilocode_change - DbCommand, - HelpCommand, // kilocode_change -] diff --git a/packages/opencode/src/index.ts b/packages/opencode/src/index.ts index 99a7aebb67a..bb95ea08920 100644 --- a/packages/opencode/src/index.ts +++ b/packages/opencode/src/index.ts @@ -1,15 +1,36 @@ import yargs from "yargs" import { hideBin } from "yargs/helpers" -import { commands } from "./cli/commands" // kilocode_change +import { RunCommand } from "./cli/cmd/run" +import { GenerateCommand } from "./cli/cmd/generate" import { Log } from "./util/log" +import { AuthCommand } from "./cli/cmd/auth" +import { AgentCommand } from "./cli/cmd/agent" +import { UpgradeCommand } from "./cli/cmd/upgrade" +import { UninstallCommand } from "./cli/cmd/uninstall" +import { ModelsCommand } from "./cli/cmd/models" import { UI } from "./cli/ui" import { Installation } from "./installation" import { NamedError } from "@opencode-ai/util/error" import { FormatError } from "./cli/error" +import { ServeCommand } from "./cli/cmd/serve" import { WorkspaceServeCommand } from "./cli/cmd/workspace-serve" import { Filesystem } from "./util/filesystem" +import { DebugCommand } from "./cli/cmd/debug" +import { StatsCommand } from "./cli/cmd/stats" +import { McpCommand } from "./cli/cmd/mcp" // import { GithubCommand } from "./cli/cmd/github" // kilocode_change +import { ExportCommand } from "./cli/cmd/export" +import { ImportCommand } from "./cli/cmd/import" +import { AttachCommand } from "./cli/cmd/tui/attach" +import { TuiThreadCommand } from "./cli/cmd/tui/thread" +import { AcpCommand } from "./cli/cmd/acp" import { EOL } from "os" +// import { WebCommand } from "./cli/cmd/web" // kilocode_change (Disabled unsupported opencode web UI) +import { PrCommand } from "./cli/cmd/pr" +import { SessionCommand } from "./cli/cmd/session" +import { RemoteCommand } from "./cli/cmd/remote" // kilocode_change +import { DbCommand } from "./cli/cmd/db" +import { HelpCommand } from "./kilocode/help-command" // kilocode_change // kilocode_change start - Import telemetry, instance disposal, and legacy migration import { Telemetry } from "@kilocode/kilo-telemetry" @@ -154,13 +175,29 @@ let cli = yargs(hideBin(process.argv)) }) .usage("\n" + UI.logo()) .completion("completion", "generate shell completion script") - -// kilocode_change start - use commands barrel -for (const command of commands) { - cli.command(command as any) -} -// kilocode_change end -// .command(GithubCommand) // kilocode_change (Disabled until backend is ready) + .command(AcpCommand) + .command(McpCommand) + .command(TuiThreadCommand) + .command(AttachCommand) + .command(RunCommand) + .command(GenerateCommand) + .command(DebugCommand) + .command(AuthCommand) + .command(AgentCommand) + .command(UpgradeCommand) + .command(UninstallCommand) + .command(ServeCommand) + // .command(WebCommand) // kilocode_change (Disabled unsupported opencode web UI) + .command(ModelsCommand) + .command(StatsCommand) + .command(ExportCommand) + .command(ImportCommand) + // .command(GithubCommand) // kilocode_change (Disabled until backend is ready) + .command(PrCommand) + .command(SessionCommand) + .command(RemoteCommand) // kilocode_change + .command(DbCommand) + .command(HelpCommand) // kilocode_change if (Installation.isLocal()) { cli = cli.command(WorkspaceServeCommand as any) diff --git a/packages/opencode/src/kilocode/commands.ts b/packages/opencode/src/kilocode/commands.ts new file mode 100644 index 00000000000..989d055f835 --- /dev/null +++ b/packages/opencode/src/kilocode/commands.ts @@ -0,0 +1,49 @@ +// 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" +import { AttachCommand } from "../cli/cmd/tui/attach" +import { RunCommand } from "../cli/cmd/run" +import { GenerateCommand } from "../cli/cmd/generate" +import { DebugCommand } from "../cli/cmd/debug" +import { AuthCommand } from "../cli/cmd/auth" +import { AgentCommand } from "../cli/cmd/agent" +import { UpgradeCommand } from "../cli/cmd/upgrade" +import { UninstallCommand } from "../cli/cmd/uninstall" +import { ServeCommand } from "../cli/cmd/serve" +import { ModelsCommand } from "../cli/cmd/models" +import { StatsCommand } from "../cli/cmd/stats" +import { ExportCommand } from "../cli/cmd/export" +import { ImportCommand } from "../cli/cmd/import" +import { PrCommand } from "../cli/cmd/pr" +import { SessionCommand } from "../cli/cmd/session" +import { RemoteCommand } from "../cli/cmd/remote" +import { DbCommand } from "../cli/cmd/db" +import { HelpCommand } from "./help-command" + +export const commands: CommandModule[] = [ + AcpCommand, + McpCommand, + TuiThreadCommand, + AttachCommand, + RunCommand, + GenerateCommand, + DebugCommand, + AuthCommand, + AgentCommand, + UpgradeCommand, + UninstallCommand, + ServeCommand, + ModelsCommand, + StatsCommand, + ExportCommand, + ImportCommand, + PrCommand, + SessionCommand, + RemoteCommand, + DbCommand, + HelpCommand, +] diff --git a/packages/opencode/src/kilocode/help.ts b/packages/opencode/src/kilocode/help.ts index 88df3778956..1919fee4bb4 100644 --- a/packages/opencode/src/kilocode/help.ts +++ b/packages/opencode/src/kilocode/help.ts @@ -167,7 +167,7 @@ function formatText( } async function loadCommands(): Promise { - const { commands } = await import("../cli/commands") + const { commands } = await import("./commands") return commands as Cmd[] }