summaryrefslogtreecommitdiffhomepage
path: root/packages/trace-store/src/cli.ts
blob: 9092c91ddb1d68eeede40b71f65b0b81b2972a3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { createTraceStore } from "./store.js";

const turnId = process.argv[2];
if (turnId === undefined) {
	console.error("Usage: bun packages/trace-store/src/cli.ts <turnId> [dbPath]");
	process.exit(1);
}

const dbPath = process.argv[3] ?? process.env.TRACE_DB_PATH ?? "./.dispatch-data/traces.db";
const store = createTraceStore({ path: dbPath });
try {
	const output = store.easyView(turnId);
	console.log(output);
} finally {
	store.close();
}