Lines 1-39javascript
2// pricekit CLI entry point. Dispatches to the tsx-run scripts so the published
3// package needs no build step — just this shebang + tsx as a real dependency.
4import { fileURLToPath } from "node:url";
5import { dirname, join } from "node:path";
6import { spawn } from "node:child_process";
7
HighChild Process
Package source references child process execution.
bin/pricekit.jsView on unpkg · L5 8const __dirname = dirname(fileURLToPath(import.meta.url));
9const root = join(__dirname, "..");
12 plan: "scripts/plan.ts",
13 provision: "scripts/provision.ts",
14 verify: "scripts/verify.ts",
15 "fire-usage": "scripts/fire-usage.ts",
18const [, , cmd, ...rest] = process.argv;
20if (!cmd || !(cmd in COMMANDS)) {
21 console.log(`pricekit — pricing copilot for Dodo Payments credit billing
24 npx pricekit plan --app <name> --profile '<AppProfile JSON>'
25 npx pricekit provision
26 npx pricekit verify [--json]
27 npx pricekit fire-usage [count]
29Docs: https://github.com/reetbatra/pricekit`);
30 process.exit(cmd ? 1 : 0);
33const tsxBin = join(root, "node_modules", ".bin", "tsx");
34const child = spawn(tsxBin, [join(root, COMMANDS[cmd]), ...rest], {
35 stdio: "inherit",
HighRuntime Package Install
Package source invokes a package manager install command at runtime.
bin/pricekit.jsView on unpkg · L23 36 cwd: process.cwd(), // run against the CALLER's project, not pricekit's own install dir
38child.on("exit", (code) => process.exit(code ?? 1));