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

Function installCommandFor

apps/kimi-code/src/cli/update/preflight.ts:66–87  ·  view source on GitHub ↗
(
  source: InstallSource,
  version: string,
  platform: NodeJS.Platform,
)

Source from the content-addressed store, hash-verified

64}
65
66export function installCommandFor(
67 source: InstallSource,
68 version: string,
69 platform: NodeJS.Platform,
70): string {
71 switch (source) {
72 case 'npm-global':
73 return `npm install -g ${NPM_PACKAGE_NAME}@${version}`;
74 case 'pnpm-global':
75 return `pnpm add -g ${NPM_PACKAGE_NAME}@${version}`;
76 case 'yarn-global':
77 return `yarn global add ${NPM_PACKAGE_NAME}@${version}`;
78 case 'bun-global':
79 return `bun add -g ${NPM_PACKAGE_NAME}@${version}`;
80 case 'homebrew':
81 return 'brew upgrade kimi-code';
82 case 'native':
83 return platform === 'win32' ? NATIVE_INSTALL_COMMAND_WIN : NATIVE_INSTALL_COMMAND_UNIX;
84 case 'unsupported':
85 return `npm install -g ${NPM_PACKAGE_NAME}@${version}`;
86 }
87}
88
89export function canAutoInstall(source: InstallSource, platform: NodeJS.Platform): boolean {
90 switch (source) {

Callers 2

handleUpgradeFunction · 0.90
runUpdatePreflightFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected