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

20 lines
624 B
TypeScript
Raw Normal View History

import { EOL } from "os"
import { Project } from "@/project/project"
import * as Log from "@opencode-ai/core/util/log"
import { makeRuntime } from "@opencode-ai/core/effect/runtime"
2025-07-10 15:25:31 +00:00
import { cmd } from "../cmd"
const runtime = makeRuntime(Project.Service, Project.defaultLayer)
2025-07-10 15:25:31 +00:00
export const ScrapCommand = cmd({
command: "scrap",
describe: "list all known projects",
2025-07-10 15:25:31 +00:00
builder: (yargs) => yargs,
async handler() {
const timer = Log.Default.time("scrap")
const list = await runtime.runPromise((project) => project.list())
process.stdout.write(JSON.stringify(list, null, 2) + EOL)
timer.stop()
},
2025-07-10 15:25:31 +00:00
})