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

Function openInAppCommandFor

packages/server/src/lib/fileLaunch.ts:73–91  ·  view source on GitHub ↗
(
  appId: OpenInAppId,
  absolutePath: string,
  options: OpenInAppOptions = {},
  platform: NodeJS.Platform = process.platform,
)

Source from the content-addressed store, hash-verified

71}
72
73export function openInAppCommandFor(
74 appId: OpenInAppId,
75 absolutePath: string,
76 options: OpenInAppOptions = {},
77 platform: NodeJS.Platform = process.platform,
78): LaunchCommand {
79 switch (appId) {
80 case 'vscode':
81 return openInVsCodeLike('code', absolutePath, options.line, platform);
82 case 'cursor':
83 return openInVsCodeLike('cursor', absolutePath, options.line, platform);
84 case 'finder':
85 return openInFinder(absolutePath, options.isDirectory, platform);
86 case 'iterm':
87 return openInMacApp('iTerm', absolutePath, platform);
88 case 'terminal':
89 return openInMacApp('Terminal', absolutePath, platform);
90 }
91}
92
93export function getAvailableOpenInApps(
94 platform: NodeJS.Platform = process.platform,

Callers 2

fileLaunch.test.tsFile · 0.90
handleOpenInFunction · 0.90

Calls 3

openInVsCodeLikeFunction · 0.85
openInFinderFunction · 0.85
openInMacAppFunction · 0.85

Tested by

no test coverage detected