refactor(cli): convert debug wait, agent list, acp to effectCmd (#25518)

This commit is contained in:
Kit Langton
2026-05-02 22:31:20 -04:00
committed by GitHub
parent c4311dda31
commit 2829943ad1
3 changed files with 76 additions and 77 deletions
+11 -10
View File
@@ -1,5 +1,6 @@
import { Global } from "@opencode-ai/core/global"
import { bootstrap } from "../../bootstrap"
import { Duration, Effect } from "effect"
import { effectCmd } from "../../effect-cmd"
import { cmd } from "../cmd"
import { ConfigCommand } from "./config"
import { FileCommand } from "./file"
@@ -26,19 +27,19 @@ export const DebugCommand = cmd({
.command(StartupCommand)
.command(AgentCommand)
.command(PathsCommand)
.command({
command: "wait",
describe: "wait indefinitely (for debugging)",
async handler() {
await bootstrap(process.cwd(), async () => {
await new Promise((resolve) => setTimeout(resolve, 1_000 * 60 * 60 * 24))
})
},
})
.command(WaitCommand)
.demandCommand(),
async handler() {},
})
const WaitCommand = effectCmd({
command: "wait",
describe: "wait indefinitely (for debugging)",
handler: Effect.fn("Cli.debug.wait")(function* () {
yield* Effect.sleep(Duration.days(1))
}),
})
const PathsCommand = cmd({
command: "paths",
describe: "show global paths (data, config, cache, state)",