cloudaxe-opencode/packages/opencode/src/cli/cmd/generate.ts

15 lines
456 B
TypeScript
Raw Normal View History

2025-06-05 15:50:54 +00:00
import { Server } from "../../server/server"
import fs from "fs/promises"
import type { CommandModule } from "yargs"
export const GenerateCommand = {
command: "generate",
handler: async () => {
const specs = await Server.openapi()
const dir = "gen"
await fs.rmdir(dir, { recursive: true }).catch(() => {})
await fs.mkdir(dir, { recursive: true })
2025-07-22 16:14:14 +00:00
process.stdout.write(JSON.stringify(specs, null, 2))
2025-06-05 15:50:54 +00:00
},
} satisfies CommandModule