MCPcopy Create free account
hub / github.com/xpf0000/FlyEnv / installOpenCode

Method installOpenCode

src/render/components/OpenCode/setup.ts:151–175  ·  view source on GitHub ↗
(domRef: Ref<HTMLElement>)

Source from the content-addressed store, hash-verified

149 }
150
151 async installOpenCode(domRef: Ref<HTMLElement>) {
152 if (this.installing) {
153 return
154 }
155 this.currentAction = 'install'
156 this.installEnd = false
157 this.installing = true
158 await nextTick()
159
160 const execXTerm = new XTerm()
161 this.xterm = markRaw(execXTerm)
162 await execXTerm.mount(domRef.value)
163 const installPlatform: InstallProxyPlatform = window.Server.isWindows
164 ? 'windows'
165 : window.Server.isMacOS
166 ? 'macos'
167 : 'linux'
168 const command = buildInstallProxyEnvCommands(
169 installPlatform,
170 (window.Server.Proxy ?? {}) as Record<string, string>
171 )
172 command.push('npm install -g opencode-ai')
173 await execXTerm.send(command, false)
174 this.installEnd = true
175 }
176
177 doAction(item: CommandItem) {
178 clipboard.writeText(item.label).then(() => {

Callers

nothing calls this directly

Calls 4

mountMethod · 0.95
sendMethod · 0.95
pushMethod · 0.80

Tested by

no test coverage detected