-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcli.ts
More file actions
21 lines (20 loc) · 729 Bytes
/
cli.ts
File metadata and controls
21 lines (20 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env node
/**
* X402-14 binary entry. `package.json` `bin.x402trace` points at
* `dist/cli.js` (the compiled form of this file). Pure shim: wire real
* `process` handles to `runCli` and translate its return value to
* `process.exit`.
*
* Keep this file dependency-light — actual command logic lives under
* `src/cli/`. The reason for the split is that `runCli` is testable in
* isolation (with injected stdout/stderr/env/waitForShutdown) while
* `process.exit` cannot be safely called from a vitest worker.
*/
import { runCli } from "./cli/index.js";
void runCli(process.argv.slice(2), {
stdout: process.stdout,
stderr: process.stderr,
env: process.env,
}).then((code) => {
process.exit(code);
});