51 lines
1.4 KiB
TypeScript
51 lines
1.4 KiB
TypeScript
import { Global } from "@opencode-ai/core/global"
|
|
import { Duration, Effect } from "effect"
|
|
import { effectCmd } from "../../effect-cmd"
|
|
import { cmd } from "../cmd"
|
|
import { ConfigCommand } from "./config"
|
|
import { FileCommand } from "./file"
|
|
import { LSPCommand } from "./lsp"
|
|
import { RipgrepCommand } from "./ripgrep"
|
|
import { ScrapCommand } from "./scrap"
|
|
import { SkillCommand } from "./skill"
|
|
import { SnapshotCommand } from "./snapshot"
|
|
import { AgentCommand } from "./agent"
|
|
import { StartupCommand } from "./startup"
|
|
|
|
export const DebugCommand = cmd({
|
|
command: "debug",
|
|
describe: "debugging and troubleshooting tools",
|
|
builder: (yargs) =>
|
|
yargs
|
|
.command(ConfigCommand)
|
|
.command(LSPCommand)
|
|
.command(RipgrepCommand)
|
|
.command(FileCommand)
|
|
.command(ScrapCommand)
|
|
.command(SkillCommand)
|
|
.command(SnapshotCommand)
|
|
.command(StartupCommand)
|
|
.command(AgentCommand)
|
|
.command(PathsCommand)
|
|
.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)",
|
|
handler() {
|
|
for (const [key, value] of Object.entries(Global.Path)) {
|
|
console.log(key.padEnd(10), value)
|
|
}
|
|
},
|
|
})
|