2025-10-28 20:38:08 +00:00
|
|
|
import { EOL } from "os"
|
2025-07-10 15:25:31 +00:00
|
|
|
import { cmd } from "../cmd"
|
|
|
|
|
|
|
|
|
|
export const ScrapCommand = cmd({
|
|
|
|
|
command: "scrap",
|
2026-01-08 15:42:12 +00:00
|
|
|
describe: "list all known projects",
|
2025-07-10 15:25:31 +00:00
|
|
|
builder: (yargs) => yargs,
|
2025-09-01 21:15:49 +00:00
|
|
|
async handler() {
|
2026-06-02 19:20:25 +00:00
|
|
|
const { Project } = await import("@/project/project")
|
|
|
|
|
const { makeRuntime } = await import("@opencode-ai/core/effect/runtime")
|
|
|
|
|
const runtime = makeRuntime(Project.Service, Project.defaultLayer)
|
2026-05-31 01:08:38 +00:00
|
|
|
const list = await runtime.runPromise((project) => project.list())
|
2025-10-28 20:38:08 +00:00
|
|
|
process.stdout.write(JSON.stringify(list, null, 2) + EOL)
|
2025-09-01 21:15:49 +00:00
|
|
|
},
|
2025-07-10 15:25:31 +00:00
|
|
|
})
|