2026-04-25 17:51:37 +00:00
|
|
|
import { Global } from "@opencode-ai/core/global"
|
2026-05-03 02:31:20 +00:00
|
|
|
import { Duration, Effect } from "effect"
|
|
|
|
|
import { effectCmd } from "../../effect-cmd"
|
2025-07-01 16:06:38 +00:00
|
|
|
import { cmd } from "../cmd"
|
2025-10-04 04:07:58 +00:00
|
|
|
import { ConfigCommand } from "./config"
|
2025-07-01 16:06:38 +00:00
|
|
|
import { FileCommand } from "./file"
|
|
|
|
|
import { LSPCommand } from "./lsp"
|
|
|
|
|
import { RipgrepCommand } from "./ripgrep"
|
2025-07-10 15:25:31 +00:00
|
|
|
import { ScrapCommand } from "./scrap"
|
2025-12-22 23:24:06 +00:00
|
|
|
import { SkillCommand } from "./skill"
|
2025-07-01 16:06:38 +00:00
|
|
|
import { SnapshotCommand } from "./snapshot"
|
2025-12-31 17:16:03 +00:00
|
|
|
import { AgentCommand } from "./agent"
|
2026-04-25 15:08:19 +00:00
|
|
|
import { StartupCommand } from "./startup"
|
2025-07-01 16:06:38 +00:00
|
|
|
|
|
|
|
|
export const DebugCommand = cmd({
|
|
|
|
|
command: "debug",
|
2026-01-08 15:42:12 +00:00
|
|
|
describe: "debugging and troubleshooting tools",
|
2025-07-01 16:06:38 +00:00
|
|
|
builder: (yargs) =>
|
|
|
|
|
yargs
|
2025-10-04 04:07:58 +00:00
|
|
|
.command(ConfigCommand)
|
2025-07-01 16:06:38 +00:00
|
|
|
.command(LSPCommand)
|
|
|
|
|
.command(RipgrepCommand)
|
|
|
|
|
.command(FileCommand)
|
2025-07-10 15:25:31 +00:00
|
|
|
.command(ScrapCommand)
|
2025-12-22 23:24:06 +00:00
|
|
|
.command(SkillCommand)
|
2025-07-01 16:06:38 +00:00
|
|
|
.command(SnapshotCommand)
|
2026-04-25 15:08:19 +00:00
|
|
|
.command(StartupCommand)
|
2025-12-31 17:16:03 +00:00
|
|
|
.command(AgentCommand)
|
2025-07-23 16:14:54 +00:00
|
|
|
.command(PathsCommand)
|
2026-05-03 02:31:20 +00:00
|
|
|
.command(WaitCommand)
|
2025-07-01 16:06:38 +00:00
|
|
|
.demandCommand(),
|
|
|
|
|
async handler() {},
|
|
|
|
|
})
|
2025-07-23 16:14:54 +00:00
|
|
|
|
2026-05-03 02:31:20 +00:00
|
|
|
const WaitCommand = effectCmd({
|
|
|
|
|
command: "wait",
|
|
|
|
|
describe: "wait indefinitely (for debugging)",
|
|
|
|
|
handler: Effect.fn("Cli.debug.wait")(function* () {
|
|
|
|
|
yield* Effect.sleep(Duration.days(1))
|
|
|
|
|
}),
|
|
|
|
|
})
|
|
|
|
|
|
2025-07-23 16:14:54 +00:00
|
|
|
const PathsCommand = cmd({
|
|
|
|
|
command: "paths",
|
2026-01-08 15:42:12 +00:00
|
|
|
describe: "show global paths (data, config, cache, state)",
|
2025-07-23 16:14:54 +00:00
|
|
|
handler() {
|
|
|
|
|
for (const [key, value] of Object.entries(Global.Path)) {
|
|
|
|
|
console.log(key.padEnd(10), value)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
})
|