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

44 lines
1.2 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-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"
import { SkillCommand } from "./skill"
2025-07-01 16:06:38 +00:00
import { SnapshotCommand } from "./snapshot"
export const DebugCommand = cmd({
command: "debug",
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)
.command(SkillCommand)
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(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)
}
},
})