MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / handleUpgradeCommand

Function handleUpgradeCommand

apps/kimi-code/src/main.ts:91–120  ·  view source on GitHub ↗
(version: string)

Source from the content-addressed store, hash-verified

89}
90
91export async function handleUpgradeCommand(version: string): Promise<void> {
92 const telemetryBootstrap = createCliTelemetryBootstrap();
93 const telemetryClient: TelemetryClient = {
94 track,
95 withContext: withTelemetryContext,
96 setContext: setTelemetryContext,
97 };
98 const harness = createKimiHarness({
99 homeDir: telemetryBootstrap.homeDir,
100 identity: createKimiCodeHostIdentity(version),
101 telemetry: telemetryClient,
102 });
103 let exitCode = 1;
104 try {
105 await harness.ensureConfigFile();
106 const config = await harness.getConfig();
107 initializeCliTelemetry({
108 harness,
109 bootstrap: telemetryBootstrap,
110 config,
111 version,
112 uiMode: CLI_UI_MODE,
113 });
114 exitCode = await handleUpgrade(version, { track, logger: log });
115 } finally {
116 await shutdownTelemetry({ timeoutMs: CLI_SHUTDOWN_TIMEOUT_MS }).catch(() => {});
117 await harness.close().catch(() => {});
118 }
119 process.exit(exitCode);
120}
121
122/** A neutral CLIOptions value — `kimi migrate` never opens a chat session. */
123const MIGRATE_CLI_OPTIONS: CLIOptions = {

Callers 2

runHandleUpgradeCommandFunction · 0.90
mainFunction · 0.85

Calls 10

initializeCliTelemetryFunction · 0.90
handleUpgradeFunction · 0.90
createKimiHarnessFunction · 0.85
shutdownTelemetryFunction · 0.85
getConfigMethod · 0.65
closeMethod · 0.65
exitMethod · 0.65
ensureConfigFileMethod · 0.45

Tested by 1

runHandleUpgradeCommandFunction · 0.72