Preflight Cli

loom-builder-solsourcetypescript
Path: loom-builder-sol/src/preflight-cli.tsRelative: src/preflight-cli.tsSubproject: loom-builder-solCategory: dispatch-system-sol
Lines: 42Bytes: 1,436Imports: 3Exports: 0

Content Preview

  1. /**
  2. * Pre-flight CLI: estimate tokens for a spec and exit non-zero if too large.
  3. * Usage: bun run src/preflight-cli.ts <spec.json>
  4. */
  5. import { readFileSync, writeFileSync } from "node:fs";
  6. import { resolve } from "node:path";
  7. import { preflightCheck, type PreFlightError } from "./preflight.js";
  8. const specPath = process.argv[2];
  9. if (!specPath) {
  10. console.error("usage: bun run src/preflight-cli.ts <spec.json>");
  11. process.exit(1);
  12. }
  13. const specPathResolved = resolve(specPath as string);
  14. async