cloudaxe-opencode/packages/opencode/src/cli/cmd/debug/index.ts

42 lines
1.1 KiB
TypeScript
Raw Normal View History

2025-07-23 16:14:54 +00:00
import { Global } from "../../../global"
2025-07-01 17:44:52 +00:00
import { bootstrap } from "../../bootstrap"
2025-07-01 16:06:38 +00:00
import { cmd } from "../cmd"
2025-08-28 19:34:12 +00:00
import { AppCommand } from "./app"
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-07-01 16:06:38 +00:00
import { SnapshotCommand } from "./snapshot"
export const DebugCommand = cmd({
command: "debug",
builder: (yargs) =>
yargs
2025-08-28 19:34:12 +00:00
.command(AppCommand)
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-07-01 16:06:38 +00:00
.command(SnapshotCommand)
2025-07-23 16:14:54 +00:00
.command(PathsCommand)
2025-07-01 17:44:52 +00:00
.command({
command: "wait",
async handler() {
await bootstrap({ cwd: process.cwd() }, async () => {
await new Promise((resolve) => setTimeout(resolve, 1_000 * 60 * 60 * 24))
2025-07-01 17:44:52 +00:00
})
},
})
2025-07-01 16:06:38 +00:00
.demandCommand(),
async handler() {},
})
2025-07-23 16:14:54 +00:00
const PathsCommand = cmd({
command: "paths",
handler() {
for (const [key, value] of Object.entries(Global.Path)) {
console.log(key.padEnd(10), value)
}
},
})