mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-14 08:32:33 +00:00
17 lines
648 B
TypeScript
17 lines
648 B
TypeScript
import { cmd } from "./cmd"
|
|
import { withNetworkOptions, resolveNetworkOptions } from "../network"
|
|
import { WorkspaceServer } from "../../control-plane/workspace-server/server"
|
|
|
|
export const WorkspaceServeCommand = cmd({
|
|
command: "workspace-serve",
|
|
builder: (yargs) => withNetworkOptions(yargs),
|
|
describe: "starts a remote workspace event server",
|
|
handler: async (args) => {
|
|
const opts = await resolveNetworkOptions(args)
|
|
const server = WorkspaceServer.Listen(opts)
|
|
console.log(`workspace event server listening on http://${server.hostname}:${server.port}/event`)
|
|
await new Promise(() => {})
|
|
await server.stop()
|
|
},
|
|
})
|