cloudaxe-opencode/packages/opencode/src/cli/cmd/acp.ts

22 lines
526 B
TypeScript
Raw Normal View History

import type { CommandModule } from "yargs"
import { ACPServer } from "../../acp/server"
export const AcpCommand: CommandModule = {
command: "acp",
describe: "Start ACP (Agent Client Protocol) server",
builder: (yargs) => {
return yargs.option("cwd", {
describe: "working directory",
type: "string",
default: process.cwd(),
})
},
handler: async (opts) => {
if (opts["cwd"] && typeof opts["cwd"] === "string") {
process.chdir(opts["cwd"])
}
await ACPServer.start()
},
}