File tree Expand file tree Collapse file tree
packages/opencode/src/cli/cmd Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { Server } from "../../server/server"
22import { cmd } from "./cmd"
33import { withNetworkOptions , resolveNetworkOptions } from "../network"
44import { Flag } from "../../flag/flag"
5+ import { bootstrap } from "../bootstrap"
56
67export 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
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { withNetworkOptions, resolveNetworkOptions } from "../network"
55import { Flag } from "../../flag/flag"
66import open from "open"
77import { networkInterfaces } from "os"
8+ import { bootstrap } from "../bootstrap"
89
910function 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 ( " " ) )
You can’t perform that action at this time.
0 commit comments