Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions packages/opencode/src/cli/cmd/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@ import { withNetworkOptions, resolveNetworkOptions } from "../network"
import { Flag } from "../../flag/flag"

export const ServeCommand = cmd({
command: "serve",
builder: (yargs) => withNetworkOptions(yargs),
command: "serve [cwd]",
builder: (yargs) =>
withNetworkOptions(yargs).positional("cwd", {
type: "string",
describe: "path to start kilo server in", // kilocode_change
}),
describe: "starts a headless kilo server", // kilocode_change
handler: async (args) => {
if (!Flag.OPENCODE_SERVER_PASSWORD) {
console.log("Warning: OPENCODE_SERVER_PASSWORD is not set; server is unsecured.")
}
const opts = await resolveNetworkOptions(args)
if (args.cwd) {
process.chdir(args.cwd)
}
const server = Server.listen(opts)
console.log(`kilo server listening on http://${server.hostname}:${server.port}`) // kilocode_change
await new Promise(() => {})
Expand Down
Loading