Skip to content

Commit ba7a3fa

Browse files
committed
fix other commands
1 parent cd4314d commit ba7a3fa

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

packages/opencode/src/cli/cmd/serve.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Server } from "../../server/server"
22
import { cmd } from "./cmd"
33
import { withNetworkOptions, resolveNetworkOptions } from "../network"
44
import { Flag } from "../../flag/flag"
5+
import { bootstrap } from "../bootstrap"
56

67
export const ServeCommand = cmd({
78
command: "serve",
@@ -11,7 +12,8 @@ export const ServeCommand = cmd({
1112
if (!Flag.OPENCODE_SERVER_PASSWORD) {
1213
console.log("Warning: OPENCODE_SERVER_PASSWORD is not set; server is unsecured.")
1314
}
14-
const opts = await resolveNetworkOptions(args)
15+
16+
const opts = await bootstrap(process.cwd(), () => resolveNetworkOptions(args))
1517
const server = await Server.listen(opts)
1618
console.log(`opencode server listening on http://${server.hostname}:${server.port}`)
1719

packages/opencode/src/cli/cmd/web.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { withNetworkOptions, resolveNetworkOptions } from "../network"
55
import { Flag } from "../../flag/flag"
66
import open from "open"
77
import { networkInterfaces } from "os"
8+
import { bootstrap } from "../bootstrap"
89

910
function getNetworkIPs() {
1011
const nets = networkInterfaces()
@@ -36,7 +37,7 @@ export const WebCommand = cmd({
3637
if (!Flag.OPENCODE_SERVER_PASSWORD) {
3738
UI.println(UI.Style.TEXT_WARNING_BOLD + "! OPENCODE_SERVER_PASSWORD is not set; server is unsecured.")
3839
}
39-
const opts = await resolveNetworkOptions(args)
40+
const opts = await bootstrap(process.cwd(), () => resolveNetworkOptions(args))
4041
const server = await Server.listen(opts)
4142
UI.empty()
4243
UI.println(UI.logo(" "))

packages/opencode/src/project/bootstrap.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import * as Vcs from "./vcs"
77
import { Bus } from "../bus"
88
import { Command } from "../command"
99
import { Instance } from "./instance"
10+
import * as Plugin from "../plugin"
1011
import { Log } from "@/util"
1112
import { FileWatcher } from "@/file/watcher"
1213
import { ShareNext } from "@/share"
@@ -16,6 +17,7 @@ export const InstanceBootstrap = Effect.gen(function* () {
1617
Log.Default.info("bootstrapping", { directory: Instance.directory })
1718
yield* Effect.all(
1819
[
20+
Plugin.Service,
1921
LSP.Service,
2022
ShareNext.Service,
2123
Format.Service,

0 commit comments

Comments
 (0)