import { writeFileSync, mkdirSync, existsSync, readFileSync, rmSync } from "node:fs" import path from "node:path" import { fileURLToPath } from "node:url" import os from "node:os" import { spawnSync } from "node:child_process" import { loadBrand } from "./src/config.ts" import { loadTemplate, buildSvg, computeHash } from "./src/render.ts" const __dirname = path.dirname(fileURLToPath(import.meta.url)) function parseArgs(argv: string[]): Record { const out: Record = {} for (let i = 0; i < argv.length; i++) { const a = argv[i] if (a.startsWith("--")) { const key = a.slice(2) const val = argv[i + 1] ?? "" out[key] = val i++ } } return out } function main() { const argv = process.argv.slice(2) if (argv.length < 2 || argv[0] !== "render") { process.stderr.write('usage: node cli.ts render