| 559 | E2E_SELFHOST_URL=<app url> vitest run --project selfhost <file>`; |
| 560 | |
| 561 | const main = async () => { |
| 562 | const [, , command, ...rest] = process.argv; |
| 563 | const flags = new Set(rest.filter((a) => a.startsWith("--"))); |
| 564 | const args = rest.filter((a) => !a.startsWith("--")); |
| 565 | switch (command) { |
| 566 | case "up": |
| 567 | return up(args[0] ?? "selfhost", flags); |
| 568 | case "__run": |
| 569 | return run(args[0] as "selfhost" | "cloud", flags); |
| 570 | case "status": |
| 571 | return await status(); |
| 572 | case "identity": |
| 573 | return identity(args[0] ?? "", flags); |
| 574 | case "api": |
| 575 | return apiCall(args[0] ?? "", args[1], args[2]); |
| 576 | case "mcp": |
| 577 | return mcpCall(args[0] ?? "", args[1], args.slice(2)); |
| 578 | case "ledger": |
| 579 | return ledger(args[0] ?? "", args[1]); |
| 580 | case "logs": |
| 581 | return logs(args[0] ?? ""); |
| 582 | case "down": |
| 583 | return down(args[0] ?? ""); |
| 584 | default: |
| 585 | console.log(HELP); |
| 586 | if (command !== undefined && command !== "help" && command !== "--help") process.exit(1); |
| 587 | } |
| 588 | }; |
| 589 | |
| 590 | main().then( |
| 591 | () => { |