@vibecheckai/cli 2.8.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/bin/_deprecations.js +35 -0
- package/bin/_router.js +46 -0
- package/bin/cli-hygiene.js +241 -0
- package/bin/guardrail.js +834 -0
- package/bin/runners/cli-utils.js +1070 -0
- package/bin/runners/context/ai-task-decomposer.js +337 -0
- package/bin/runners/context/analyzer.js +462 -0
- package/bin/runners/context/api-contracts.js +427 -0
- package/bin/runners/context/context-diff.js +342 -0
- package/bin/runners/context/context-pruner.js +291 -0
- package/bin/runners/context/dependency-graph.js +414 -0
- package/bin/runners/context/generators/claude.js +107 -0
- package/bin/runners/context/generators/codex.js +108 -0
- package/bin/runners/context/generators/copilot.js +119 -0
- package/bin/runners/context/generators/cursor.js +514 -0
- package/bin/runners/context/generators/mcp.js +151 -0
- package/bin/runners/context/generators/windsurf.js +180 -0
- package/bin/runners/context/git-context.js +302 -0
- package/bin/runners/context/index.js +1042 -0
- package/bin/runners/context/insights.js +173 -0
- package/bin/runners/context/mcp-server/generate-rules.js +337 -0
- package/bin/runners/context/mcp-server/index.js +1176 -0
- package/bin/runners/context/mcp-server/package.json +24 -0
- package/bin/runners/context/memory.js +200 -0
- package/bin/runners/context/monorepo.js +215 -0
- package/bin/runners/context/multi-repo-federation.js +404 -0
- package/bin/runners/context/patterns.js +253 -0
- package/bin/runners/context/proof-context.js +972 -0
- package/bin/runners/context/security-scanner.js +303 -0
- package/bin/runners/context/semantic-search.js +350 -0
- package/bin/runners/context/shared.js +264 -0
- package/bin/runners/context/team-conventions.js +310 -0
- package/bin/runners/lib/ai-bridge.js +416 -0
- package/bin/runners/lib/analysis-core.js +271 -0
- package/bin/runners/lib/analyzers.js +541 -0
- package/bin/runners/lib/audit-bridge.js +391 -0
- package/bin/runners/lib/auth-truth.js +193 -0
- package/bin/runners/lib/auth.js +215 -0
- package/bin/runners/lib/backup.js +62 -0
- package/bin/runners/lib/billing.js +107 -0
- package/bin/runners/lib/claims.js +118 -0
- package/bin/runners/lib/cli-ui.js +540 -0
- package/bin/runners/lib/compliance-bridge-new.js +0 -0
- package/bin/runners/lib/compliance-bridge.js +165 -0
- package/bin/runners/lib/contracts/auth-contract.js +194 -0
- package/bin/runners/lib/contracts/env-contract.js +178 -0
- package/bin/runners/lib/contracts/external-contract.js +198 -0
- package/bin/runners/lib/contracts/guard.js +168 -0
- package/bin/runners/lib/contracts/index.js +89 -0
- package/bin/runners/lib/contracts/plan-validator.js +311 -0
- package/bin/runners/lib/contracts/route-contract.js +192 -0
- package/bin/runners/lib/detect.js +89 -0
- package/bin/runners/lib/doctor/autofix.js +254 -0
- package/bin/runners/lib/doctor/index.js +37 -0
- package/bin/runners/lib/doctor/modules/dependencies.js +325 -0
- package/bin/runners/lib/doctor/modules/index.js +46 -0
- package/bin/runners/lib/doctor/modules/network.js +250 -0
- package/bin/runners/lib/doctor/modules/project.js +312 -0
- package/bin/runners/lib/doctor/modules/runtime.js +224 -0
- package/bin/runners/lib/doctor/modules/security.js +348 -0
- package/bin/runners/lib/doctor/modules/system.js +213 -0
- package/bin/runners/lib/doctor/modules/vibecheck.js +394 -0
- package/bin/runners/lib/doctor/reporter.js +262 -0
- package/bin/runners/lib/doctor/service.js +262 -0
- package/bin/runners/lib/doctor/types.js +113 -0
- package/bin/runners/lib/doctor/ui.js +263 -0
- package/bin/runners/lib/doctor-enhanced.js +233 -0
- package/bin/runners/lib/doctor-v2.js +608 -0
- package/bin/runners/lib/enforcement.js +72 -0
- package/bin/runners/lib/enterprise-detect.js +603 -0
- package/bin/runners/lib/enterprise-init.js +942 -0
- package/bin/runners/lib/entitlements-v2.js +381 -0
- package/bin/runners/lib/entitlements.generated.js +0 -0
- package/bin/runners/lib/entitlements.js +332 -0
- package/bin/runners/lib/env-template.js +66 -0
- package/bin/runners/lib/env.js +189 -0
- package/bin/runners/lib/error-handler.js +320 -0
- package/bin/runners/lib/firewall-prompt.js +50 -0
- package/bin/runners/lib/graph/graph-builder.js +265 -0
- package/bin/runners/lib/graph/html-renderer.js +413 -0
- package/bin/runners/lib/graph/index.js +32 -0
- package/bin/runners/lib/graph/runtime-collector.js +215 -0
- package/bin/runners/lib/graph/static-extractor.js +518 -0
- package/bin/runners/lib/init-wizard.js +308 -0
- package/bin/runners/lib/json-output.js +76 -0
- package/bin/runners/lib/llm.js +75 -0
- package/bin/runners/lib/meter.js +61 -0
- package/bin/runners/lib/missions/evidence.js +126 -0
- package/bin/runners/lib/missions/plan.js +69 -0
- package/bin/runners/lib/missions/templates.js +147 -0
- package/bin/runners/lib/patch.js +40 -0
- package/bin/runners/lib/permissions/auth-model.js +213 -0
- package/bin/runners/lib/permissions/idor-prover.js +205 -0
- package/bin/runners/lib/permissions/index.js +45 -0
- package/bin/runners/lib/permissions/matrix-builder.js +198 -0
- package/bin/runners/lib/pkgjson.js +28 -0
- package/bin/runners/lib/preflight.js +142 -0
- package/bin/runners/lib/reality-findings.js +84 -0
- package/bin/runners/lib/redact.js +29 -0
- package/bin/runners/lib/replay/capsule-manager.js +154 -0
- package/bin/runners/lib/replay/index.js +263 -0
- package/bin/runners/lib/replay/player.js +348 -0
- package/bin/runners/lib/replay/recorder.js +331 -0
- package/bin/runners/lib/report-engine.js +447 -0
- package/bin/runners/lib/report-html.js +1117 -0
- package/bin/runners/lib/report-templates.js +964 -0
- package/bin/runners/lib/route-detection.js +1140 -0
- package/bin/runners/lib/route-truth.js +477 -0
- package/bin/runners/lib/sandbox/index.js +59 -0
- package/bin/runners/lib/sandbox/proof-chain.js +399 -0
- package/bin/runners/lib/sandbox/sandbox-runner.js +205 -0
- package/bin/runners/lib/sandbox/worktree.js +174 -0
- package/bin/runners/lib/scan-cache.js +330 -0
- package/bin/runners/lib/scan-output-schema.js +344 -0
- package/bin/runners/lib/score-history.js +282 -0
- package/bin/runners/lib/security-bridge.js +249 -0
- package/bin/runners/lib/server-usage.js +513 -0
- package/bin/runners/lib/share-pack.js +239 -0
- package/bin/runners/lib/snippets.js +67 -0
- package/bin/runners/lib/truth.js +667 -0
- package/bin/runners/lib/unified-output.js +189 -0
- package/bin/runners/lib/validate-patch.js +156 -0
- package/bin/runners/lib/verification.js +345 -0
- package/bin/runners/reality/engine.js +917 -0
- package/bin/runners/reality/flows.js +122 -0
- package/bin/runners/reality/report.js +378 -0
- package/bin/runners/reality/session.js +193 -0
- package/bin/runners/runAIAgent.js +2 -0
- package/bin/runners/runAudit.js +2 -0
- package/bin/runners/runAuth.js +106 -0
- package/bin/runners/runAutopilot.js +2 -0
- package/bin/runners/runBadge.js +2 -0
- package/bin/runners/runCertify.js +2 -0
- package/bin/runners/runClaimVerifier.js +483 -0
- package/bin/runners/runContext.js +56 -0
- package/bin/runners/runContextCompiler.js +385 -0
- package/bin/runners/runCtx.js +187 -0
- package/bin/runners/runCtxGuard.js +176 -0
- package/bin/runners/runCtxSync.js +116 -0
- package/bin/runners/runDashboard.js +10 -0
- package/bin/runners/runDoctor.js +245 -0
- package/bin/runners/runEnhancedShip.js +2 -0
- package/bin/runners/runFix.js +735 -0
- package/bin/runners/runFixPacks.js +2 -0
- package/bin/runners/runGate.js +17 -0
- package/bin/runners/runGraph.js +283 -0
- package/bin/runners/runInit.js +260 -0
- package/bin/runners/runInitGha.js +101 -0
- package/bin/runners/runInstall.js +76 -0
- package/bin/runners/runInteractive.js +388 -0
- package/bin/runners/runLaunch.js +2 -0
- package/bin/runners/runMcp.js +19 -0
- package/bin/runners/runMdc.js +2 -0
- package/bin/runners/runMissionGenerator.js +282 -0
- package/bin/runners/runNaturalLanguage.js +3 -0
- package/bin/runners/runPR.js +96 -0
- package/bin/runners/runPermissions.js +290 -0
- package/bin/runners/runPromptFirewall.js +211 -0
- package/bin/runners/runProof.js +2 -0
- package/bin/runners/runProve.js +392 -0
- package/bin/runners/runReality.js +489 -0
- package/bin/runners/runRealitySniff.js +2 -0
- package/bin/runners/runReplay.js +469 -0
- package/bin/runners/runReport.js +478 -0
- package/bin/runners/runScan.js +835 -0
- package/bin/runners/runShare.js +34 -0
- package/bin/runners/runShip.js +1062 -0
- package/bin/runners/runStatus.js +136 -0
- package/bin/runners/runTruthpack.js +634 -0
- package/bin/runners/runUpgrade.js +2 -0
- package/bin/runners/runValidate.js +2 -0
- package/bin/runners/runVerifyAgentOutput.js +2 -0
- package/bin/runners/runWatch.js +230 -0
- package/bin/runners/utils.js +360 -0
- package/bin/scan.js +612 -0
- package/bin/vibecheck.js +834 -0
- package/package.json +11 -11
- package/dist/autopatch/verified-autopatch.d.ts +0 -111
- package/dist/autopatch/verified-autopatch.d.ts.map +0 -1
- package/dist/autopatch/verified-autopatch.js +0 -503
- package/dist/autopatch/verified-autopatch.js.map +0 -1
- package/dist/bundles/index.js +0 -8
- package/dist/bundles/vibecheck-core.js +0 -25799
- package/dist/bundles/vibecheck-security.js +0 -208693
- package/dist/bundles/vibecheck-ship.js +0 -2318
- package/dist/commands/baseline.d.ts +0 -7
- package/dist/commands/baseline.d.ts.map +0 -1
- package/dist/commands/baseline.js +0 -79
- package/dist/commands/baseline.js.map +0 -1
- package/dist/commands/cache.d.ts +0 -13
- package/dist/commands/cache.d.ts.map +0 -1
- package/dist/commands/cache.js +0 -165
- package/dist/commands/cache.js.map +0 -1
- package/dist/commands/checkpoint.d.ts +0 -8
- package/dist/commands/checkpoint.d.ts.map +0 -1
- package/dist/commands/checkpoint.js +0 -35
- package/dist/commands/checkpoint.js.map +0 -1
- package/dist/commands/doctor.d.ts +0 -17
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js +0 -226
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/evidence.d.ts +0 -45
- package/dist/commands/evidence.d.ts.map +0 -1
- package/dist/commands/evidence.js +0 -197
- package/dist/commands/evidence.js.map +0 -1
- package/dist/commands/explain.d.ts +0 -8
- package/dist/commands/explain.d.ts.map +0 -1
- package/dist/commands/explain.js +0 -52
- package/dist/commands/explain.js.map +0 -1
- package/dist/commands/fix-consolidated.d.ts +0 -19
- package/dist/commands/fix-consolidated.d.ts.map +0 -1
- package/dist/commands/fix-consolidated.js +0 -165
- package/dist/commands/fix-consolidated.js.map +0 -1
- package/dist/commands/index.d.ts +0 -8
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/index.js +0 -15
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/init.d.ts +0 -8
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -125
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/launcher.d.ts +0 -10
- package/dist/commands/launcher.d.ts.map +0 -1
- package/dist/commands/launcher.js +0 -174
- package/dist/commands/launcher.js.map +0 -1
- package/dist/commands/on.d.ts +0 -8
- package/dist/commands/on.d.ts.map +0 -1
- package/dist/commands/on.js +0 -123
- package/dist/commands/on.js.map +0 -1
- package/dist/commands/replay.d.ts +0 -8
- package/dist/commands/replay.d.ts.map +0 -1
- package/dist/commands/replay.js +0 -52
- package/dist/commands/replay.js.map +0 -1
- package/dist/commands/scan-consolidated.d.ts +0 -61
- package/dist/commands/scan-consolidated.d.ts.map +0 -1
- package/dist/commands/scan-consolidated.js +0 -243
- package/dist/commands/scan-consolidated.js.map +0 -1
- package/dist/commands/scan-secrets.d.ts +0 -47
- package/dist/commands/scan-secrets.d.ts.map +0 -1
- package/dist/commands/scan-secrets.js +0 -225
- package/dist/commands/scan-secrets.js.map +0 -1
- package/dist/commands/scan-vulnerabilities-enhanced.d.ts +0 -41
- package/dist/commands/scan-vulnerabilities-enhanced.d.ts.map +0 -1
- package/dist/commands/scan-vulnerabilities-enhanced.js +0 -368
- package/dist/commands/scan-vulnerabilities-enhanced.js.map +0 -1
- package/dist/commands/scan-vulnerabilities-osv.d.ts +0 -58
- package/dist/commands/scan-vulnerabilities-osv.d.ts.map +0 -1
- package/dist/commands/scan-vulnerabilities-osv.js +0 -722
- package/dist/commands/scan-vulnerabilities-osv.js.map +0 -1
- package/dist/commands/scan-vulnerabilities.d.ts +0 -32
- package/dist/commands/scan-vulnerabilities.d.ts.map +0 -1
- package/dist/commands/scan-vulnerabilities.js +0 -283
- package/dist/commands/scan-vulnerabilities.js.map +0 -1
- package/dist/commands/secrets-allowlist.d.ts +0 -7
- package/dist/commands/secrets-allowlist.d.ts.map +0 -1
- package/dist/commands/secrets-allowlist.js +0 -85
- package/dist/commands/secrets-allowlist.js.map +0 -1
- package/dist/commands/ship-consolidated.d.ts +0 -58
- package/dist/commands/ship-consolidated.d.ts.map +0 -1
- package/dist/commands/ship-consolidated.js +0 -515
- package/dist/commands/ship-consolidated.js.map +0 -1
- package/dist/commands/stats.d.ts +0 -8
- package/dist/commands/stats.d.ts.map +0 -1
- package/dist/commands/stats.js +0 -134
- package/dist/commands/stats.js.map +0 -1
- package/dist/commands/upgrade.d.ts +0 -8
- package/dist/commands/upgrade.d.ts.map +0 -1
- package/dist/commands/upgrade.js +0 -30
- package/dist/commands/upgrade.js.map +0 -1
- package/dist/fix/applicator.d.ts +0 -44
- package/dist/fix/applicator.d.ts.map +0 -1
- package/dist/fix/applicator.js +0 -144
- package/dist/fix/applicator.js.map +0 -1
- package/dist/fix/backup.d.ts +0 -38
- package/dist/fix/backup.d.ts.map +0 -1
- package/dist/fix/backup.js +0 -154
- package/dist/fix/backup.js.map +0 -1
- package/dist/fix/engine.d.ts +0 -55
- package/dist/fix/engine.d.ts.map +0 -1
- package/dist/fix/engine.js +0 -285
- package/dist/fix/engine.js.map +0 -1
- package/dist/fix/index.d.ts +0 -5
- package/dist/fix/index.d.ts.map +0 -1
- package/dist/fix/index.js +0 -12
- package/dist/fix/index.js.map +0 -1
- package/dist/fix/interactive.d.ts +0 -22
- package/dist/fix/interactive.d.ts.map +0 -1
- package/dist/fix/interactive.js +0 -172
- package/dist/fix/interactive.js.map +0 -1
- package/dist/formatters/index.d.ts +0 -6
- package/dist/formatters/index.d.ts.map +0 -1
- package/dist/formatters/index.js +0 -11
- package/dist/formatters/index.js.map +0 -1
- package/dist/formatters/sarif-enhanced.d.ts +0 -78
- package/dist/formatters/sarif-enhanced.d.ts.map +0 -1
- package/dist/formatters/sarif-enhanced.js +0 -144
- package/dist/formatters/sarif-enhanced.js.map +0 -1
- package/dist/formatters/sarif-v2.d.ts +0 -121
- package/dist/formatters/sarif-v2.d.ts.map +0 -1
- package/dist/formatters/sarif-v2.js +0 -356
- package/dist/formatters/sarif-v2.js.map +0 -1
- package/dist/formatters/sarif.d.ts +0 -72
- package/dist/formatters/sarif.d.ts.map +0 -1
- package/dist/formatters/sarif.js +0 -146
- package/dist/formatters/sarif.js.map +0 -1
- package/dist/index.d.ts +0 -61
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -4388
- package/dist/index.js.map +0 -1
- package/dist/init/ci-generator.d.ts +0 -18
- package/dist/init/ci-generator.d.ts.map +0 -1
- package/dist/init/ci-generator.js +0 -317
- package/dist/init/ci-generator.js.map +0 -1
- package/dist/init/detect-framework.d.ts +0 -15
- package/dist/init/detect-framework.d.ts.map +0 -1
- package/dist/init/detect-framework.js +0 -301
- package/dist/init/detect-framework.js.map +0 -1
- package/dist/init/hooks-installer.d.ts +0 -22
- package/dist/init/hooks-installer.d.ts.map +0 -1
- package/dist/init/hooks-installer.js +0 -310
- package/dist/init/hooks-installer.js.map +0 -1
- package/dist/init/index.d.ts +0 -8
- package/dist/init/index.d.ts.map +0 -1
- package/dist/init/index.js +0 -22
- package/dist/init/index.js.map +0 -1
- package/dist/init/templates.d.ts +0 -402
- package/dist/init/templates.d.ts.map +0 -1
- package/dist/init/templates.js +0 -240
- package/dist/init/templates.js.map +0 -1
- package/dist/mcp/server.d.ts +0 -12
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/mcp/server.js +0 -42
- package/dist/mcp/server.js.map +0 -1
- package/dist/mcp/telemetry.d.ts +0 -40
- package/dist/mcp/telemetry.d.ts.map +0 -1
- package/dist/mcp/telemetry.js +0 -98
- package/dist/mcp/telemetry.js.map +0 -1
- package/dist/reality/no-dead-buttons/button-sweep-generator.d.ts +0 -32
- package/dist/reality/no-dead-buttons/button-sweep-generator.d.ts.map +0 -1
- package/dist/reality/no-dead-buttons/button-sweep-generator.js +0 -236
- package/dist/reality/no-dead-buttons/button-sweep-generator.js.map +0 -1
- package/dist/reality/no-dead-buttons/index.d.ts +0 -11
- package/dist/reality/no-dead-buttons/index.d.ts.map +0 -1
- package/dist/reality/no-dead-buttons/index.js +0 -18
- package/dist/reality/no-dead-buttons/index.js.map +0 -1
- package/dist/reality/no-dead-buttons/static-scanner.d.ts +0 -34
- package/dist/reality/no-dead-buttons/static-scanner.d.ts.map +0 -1
- package/dist/reality/no-dead-buttons/static-scanner.js +0 -230
- package/dist/reality/no-dead-buttons/static-scanner.js.map +0 -1
- package/dist/reality/reality-graph.d.ts +0 -192
- package/dist/reality/reality-graph.d.ts.map +0 -1
- package/dist/reality/reality-graph.js +0 -600
- package/dist/reality/reality-graph.js.map +0 -1
- package/dist/reality/reality-runner.d.ts +0 -89
- package/dist/reality/reality-runner.d.ts.map +0 -1
- package/dist/reality/reality-runner.js +0 -540
- package/dist/reality/reality-runner.js.map +0 -1
- package/dist/reality/receipt-generator.d.ts +0 -152
- package/dist/reality/receipt-generator.d.ts.map +0 -1
- package/dist/reality/receipt-generator.js +0 -495
- package/dist/reality/receipt-generator.js.map +0 -1
- package/dist/reality/runtime-tracer.d.ts +0 -75
- package/dist/reality/runtime-tracer.d.ts.map +0 -1
- package/dist/reality/runtime-tracer.js +0 -109
- package/dist/reality/runtime-tracer.js.map +0 -1
- package/dist/runtime/auth-utils.d.ts +0 -43
- package/dist/runtime/auth-utils.d.ts.map +0 -1
- package/dist/runtime/auth-utils.js +0 -130
- package/dist/runtime/auth-utils.js.map +0 -1
- package/dist/runtime/client.d.ts +0 -74
- package/dist/runtime/client.d.ts.map +0 -1
- package/dist/runtime/client.js +0 -222
- package/dist/runtime/client.js.map +0 -1
- package/dist/runtime/creds.d.ts +0 -48
- package/dist/runtime/creds.d.ts.map +0 -1
- package/dist/runtime/creds.js +0 -245
- package/dist/runtime/creds.js.map +0 -1
- package/dist/runtime/exit-codes.d.ts +0 -49
- package/dist/runtime/exit-codes.d.ts.map +0 -1
- package/dist/runtime/exit-codes.js +0 -93
- package/dist/runtime/exit-codes.js.map +0 -1
- package/dist/runtime/index.d.ts +0 -9
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/index.js +0 -25
- package/dist/runtime/index.js.map +0 -1
- package/dist/runtime/json-output.d.ts +0 -42
- package/dist/runtime/json-output.d.ts.map +0 -1
- package/dist/runtime/json-output.js +0 -59
- package/dist/runtime/json-output.js.map +0 -1
- package/dist/runtime/semver.d.ts +0 -37
- package/dist/runtime/semver.d.ts.map +0 -1
- package/dist/runtime/semver.js +0 -110
- package/dist/runtime/semver.js.map +0 -1
- package/dist/scan/dead-ui-detector.d.ts +0 -48
- package/dist/scan/dead-ui-detector.d.ts.map +0 -1
- package/dist/scan/dead-ui-detector.js +0 -170
- package/dist/scan/dead-ui-detector.js.map +0 -1
- package/dist/scan/playwright-sweep.d.ts +0 -40
- package/dist/scan/playwright-sweep.d.ts.map +0 -1
- package/dist/scan/playwright-sweep.js +0 -216
- package/dist/scan/playwright-sweep.js.map +0 -1
- package/dist/scan/proof-bundle.d.ts +0 -25
- package/dist/scan/proof-bundle.d.ts.map +0 -1
- package/dist/scan/proof-bundle.js +0 -203
- package/dist/scan/proof-bundle.js.map +0 -1
- package/dist/scan/proof-graph.d.ts +0 -59
- package/dist/scan/proof-graph.d.ts.map +0 -1
- package/dist/scan/proof-graph.js +0 -64
- package/dist/scan/proof-graph.js.map +0 -1
- package/dist/scan/reality-sniff.d.ts +0 -56
- package/dist/scan/reality-sniff.d.ts.map +0 -1
- package/dist/scan/reality-sniff.js +0 -200
- package/dist/scan/reality-sniff.js.map +0 -1
- package/dist/scan/structural-verifier.d.ts +0 -20
- package/dist/scan/structural-verifier.d.ts.map +0 -1
- package/dist/scan/structural-verifier.js +0 -112
- package/dist/scan/structural-verifier.js.map +0 -1
- package/dist/scan/verification-engine.d.ts +0 -47
- package/dist/scan/verification-engine.d.ts.map +0 -1
- package/dist/scan/verification-engine.js +0 -141
- package/dist/scan/verification-engine.js.map +0 -1
- package/dist/scanner/baseline.d.ts +0 -52
- package/dist/scanner/baseline.d.ts.map +0 -1
- package/dist/scanner/baseline.js +0 -85
- package/dist/scanner/baseline.js.map +0 -1
- package/dist/scanner/incremental.d.ts +0 -30
- package/dist/scanner/incremental.d.ts.map +0 -1
- package/dist/scanner/incremental.js +0 -82
- package/dist/scanner/incremental.js.map +0 -1
- package/dist/scanner/parallel.d.ts +0 -43
- package/dist/scanner/parallel.d.ts.map +0 -1
- package/dist/scanner/parallel.js +0 -99
- package/dist/scanner/parallel.js.map +0 -1
- package/dist/standalone.d.ts +0 -1
- package/dist/standalone.d.ts.map +0 -1
- package/dist/standalone.js +0 -1
- package/dist/standalone.js.map +0 -1
- package/dist/truth-pack/index.d.ts +0 -102
- package/dist/truth-pack/index.d.ts.map +0 -1
- package/dist/truth-pack/index.js +0 -694
- package/dist/truth-pack/index.js.map +0 -1
- package/dist/ui/frame.d.ts +0 -68
- package/dist/ui/frame.d.ts.map +0 -1
- package/dist/ui/frame.js +0 -165
- package/dist/ui/frame.js.map +0 -1
- package/dist/ui/index.d.ts +0 -5
- package/dist/ui/index.d.ts.map +0 -1
- package/dist/ui/index.js +0 -16
- package/dist/ui/index.js.map +0 -1
- package/dist/ui.d.ts +0 -36
- package/dist/ui.d.ts.map +0 -1
- package/dist/ui.js +0 -45
- package/dist/ui.js.map +0 -1
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Vibecheck Replay CLI
|
|
5
|
+
*
|
|
6
|
+
* Commands:
|
|
7
|
+
* vibecheck replay record <url> [options] Record a user session
|
|
8
|
+
* vibecheck replay play <capsule> Replay a recorded session
|
|
9
|
+
* vibecheck replay list List available replay capsules
|
|
10
|
+
* vibecheck replay show <id> Show details of a replay capsule
|
|
11
|
+
* vibecheck replay delete <id> Delete a replay capsule
|
|
12
|
+
* vibecheck replay export <id> <file> Export a replay capsule
|
|
13
|
+
* vibecheck replay import <file> Import a replay capsule
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const { program } = require('commander');
|
|
17
|
+
const chalk = require('chalk');
|
|
18
|
+
const fs = require('fs').promises;
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const { chromium } = require('playwright');
|
|
21
|
+
const { createReplayEngine } = require('./lib/replay');
|
|
22
|
+
const { version } = require('../../package.json');
|
|
23
|
+
|
|
24
|
+
// Global options
|
|
25
|
+
let verbose = false;
|
|
26
|
+
let outputDir = path.join(process.cwd(), '.vibecheck', 'replays');
|
|
27
|
+
|
|
28
|
+
// Initialize replay engine
|
|
29
|
+
let replayEngine;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Initialize the replay engine
|
|
33
|
+
*/
|
|
34
|
+
async function initEngine() {
|
|
35
|
+
if (!replayEngine) {
|
|
36
|
+
replayEngine = await createReplayEngine({
|
|
37
|
+
basePath: process.cwd(),
|
|
38
|
+
verbose
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return replayEngine;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Record a user session
|
|
46
|
+
*/
|
|
47
|
+
async function recordSession(url, options) {
|
|
48
|
+
console.log(chalk.blue(`\n🚀 Starting recording session for ${url}\n`));
|
|
49
|
+
|
|
50
|
+
const browser = await chromium.launch({
|
|
51
|
+
headless: !options.headed,
|
|
52
|
+
devtools: options.devtools
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
try {
|
|
56
|
+
const context = await browser.newContext({
|
|
57
|
+
viewport: options.viewport || { width: 1280, height: 800 },
|
|
58
|
+
recordVideo: options.video ? { dir: path.join(outputDir, 'videos') } : undefined
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const page = await context.newPage();
|
|
62
|
+
|
|
63
|
+
// Initialize recorder
|
|
64
|
+
const engine = await initEngine();
|
|
65
|
+
const recorder = engine.createPlaywrightRecorder(page, {
|
|
66
|
+
name: options.name || `Session at ${new Date().toLocaleString()}`,
|
|
67
|
+
description: options.description || `Recorded from ${url}`,
|
|
68
|
+
tags: options.tags ? options.tags.split(',') : []
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
// Set up event listeners
|
|
72
|
+
recorder.on('start', () => {
|
|
73
|
+
console.log(chalk.green('\n🔴 Recording started. Press Ctrl+C to stop.\n'));
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
recorder.on('step', (step) => {
|
|
77
|
+
if (verbose) {
|
|
78
|
+
console.log(chalk.gray(` [${step.type}] ${JSON.stringify(step).slice(0, 100)}...`));
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// Navigate to the URL
|
|
83
|
+
await page.goto(url, { waitUntil: 'networkidle' });
|
|
84
|
+
|
|
85
|
+
// Wait for user to stop recording
|
|
86
|
+
console.log(chalk.blue('\n🛑 Press Ctrl+C when done recording...'));
|
|
87
|
+
|
|
88
|
+
// Handle process termination
|
|
89
|
+
const stopRecording = async () => {
|
|
90
|
+
console.log('\n\nStopping recording...');
|
|
91
|
+
const result = await recorder.save(outputDir);
|
|
92
|
+
console.log(chalk.green(`\n✅ Recording saved as capsule: ${result.id}`));
|
|
93
|
+
console.log(chalk.gray(`Path: ${result.path}`));
|
|
94
|
+
|
|
95
|
+
await browser.close();
|
|
96
|
+
process.exit(0);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
process.on('SIGINT', stopRecording);
|
|
100
|
+
|
|
101
|
+
// If auto-stop is enabled, wait for the specified duration
|
|
102
|
+
if (options.duration) {
|
|
103
|
+
console.log(`Will auto-stop after ${options.duration} seconds...`);
|
|
104
|
+
setTimeout(stopRecording, options.duration * 1000);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
} catch (error) {
|
|
108
|
+
console.error(chalk.red('\n❌ Error during recording:'), error);
|
|
109
|
+
await browser.close();
|
|
110
|
+
process.exit(1);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Replay a recorded session
|
|
116
|
+
*/
|
|
117
|
+
async function replaySession(capsuleId, options) {
|
|
118
|
+
console.log(chalk.blue(`\n▶️ Replaying capsule: ${capsuleId}\n`));
|
|
119
|
+
|
|
120
|
+
const browser = await chromium.launch({
|
|
121
|
+
headless: !options.headed,
|
|
122
|
+
devtools: options.devtools
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
try {
|
|
126
|
+
const engine = await initEngine();
|
|
127
|
+
const capsule = await engine.getCapsule(capsuleId);
|
|
128
|
+
|
|
129
|
+
if (!capsule) {
|
|
130
|
+
console.error(chalk.red(`\n❌ Capsule not found: ${capsuleId}`));
|
|
131
|
+
process.exit(1);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
console.log(chalk.blue(`📼 ${capsule.metadata.name || 'Untitled Session'}`));
|
|
135
|
+
if (capsule.metadata.description) {
|
|
136
|
+
console.log(chalk.gray(` ${capsule.metadata.description}`));
|
|
137
|
+
}
|
|
138
|
+
console.log(chalk.gray(` ${capsule.metadata.steps} steps, recorded ${new Date(capsule.metadata.createdAt).toLocaleString()}\n`));
|
|
139
|
+
|
|
140
|
+
const player = engine.createPlayer({
|
|
141
|
+
speed: options.speed,
|
|
142
|
+
headless: !options.headed,
|
|
143
|
+
waitForNetworkIdle: true,
|
|
144
|
+
stopOnFailure: options.stopOnFailure
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
await player.loadCapsule(capsule);
|
|
148
|
+
await player.setupPlaywright(browser);
|
|
149
|
+
|
|
150
|
+
// Set up event listeners
|
|
151
|
+
player.on('stepStart', ({ step, total, type }) => {
|
|
152
|
+
process.stdout.write(chalk.blue(`\r[${step}/${total}] ${type}...`));
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
player.on('stepPass', ({ step, type, duration }) => {
|
|
156
|
+
process.stdout.write(chalk.green(`\r[${step}] ${type} ✓ (${duration.toFixed(0)}ms)\n`));
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
player.on('stepFail', ({ step, type, error, duration }) => {
|
|
160
|
+
process.stdout.write(chalk.red(`\r[${step}] ${type} ✗ (${duration.toFixed(0)}ms)\n`));
|
|
161
|
+
if (verbose) {
|
|
162
|
+
console.error(chalk.red(` Error: ${error.message}`));
|
|
163
|
+
if (error.stack) {
|
|
164
|
+
console.error(chalk.gray(error.stack.split('\n').slice(1).join('\n')));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
player.on('complete', (result) => {
|
|
170
|
+
console.log('\n');
|
|
171
|
+
console.log(chalk.bold('🏁 Replay Complete'));
|
|
172
|
+
console.log(chalk.gray('━'.repeat(40)));
|
|
173
|
+
console.log(` Steps: ${result.passed + result.failed + result.skipped} total`);
|
|
174
|
+
console.log(` ${chalk.green(`✓ ${result.passed} passed`)}`);
|
|
175
|
+
if (result.failed > 0) {
|
|
176
|
+
console.log(` ${chalk.red(`✗ ${result.failed} failed`)}`);
|
|
177
|
+
}
|
|
178
|
+
if (result.skipped > 0) {
|
|
179
|
+
console.log(` ${chalk.yellow(`↷ ${result.skipped} skipped`)}`);
|
|
180
|
+
}
|
|
181
|
+
console.log(`\n Duration: ${(result.duration / 1000).toFixed(2)}s`);
|
|
182
|
+
console.log(chalk.gray('━'.repeat(40) + '\n'));
|
|
183
|
+
|
|
184
|
+
if (result.failed > 0) {
|
|
185
|
+
console.log(chalk.red('❌ Some steps failed during replay'));
|
|
186
|
+
process.exit(1);
|
|
187
|
+
} else {
|
|
188
|
+
console.log(chalk.green('✅ Replay completed successfully'));
|
|
189
|
+
process.exit(0);
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
// Start playback
|
|
194
|
+
await player.play();
|
|
195
|
+
|
|
196
|
+
} catch (error) {
|
|
197
|
+
console.error(chalk.red('\n❌ Error during replay:'), error);
|
|
198
|
+
await browser.close();
|
|
199
|
+
process.exit(1);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* List available replay capsules
|
|
205
|
+
*/
|
|
206
|
+
async function listCapsules() {
|
|
207
|
+
try {
|
|
208
|
+
const engine = await initEngine();
|
|
209
|
+
const capsules = await engine.listCapsules();
|
|
210
|
+
|
|
211
|
+
if (capsules.length === 0) {
|
|
212
|
+
console.log(chalk.yellow('\nNo replay capsules found.\n'));
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
console.log(chalk.blue('\n📼 Available Replay Capsules\n'));
|
|
217
|
+
|
|
218
|
+
capsules.forEach((capsule, index) => {
|
|
219
|
+
const { id, name, timestamp, metadata } = capsule;
|
|
220
|
+
const date = new Date(timestamp).toLocaleString();
|
|
221
|
+
const steps = metadata.steps || '?';
|
|
222
|
+
|
|
223
|
+
console.log(chalk.bold(`${index + 1}. ${name || 'Untitled Session'}`));
|
|
224
|
+
console.log(` ID: ${chalk.gray(id)}`);
|
|
225
|
+
console.log(` Steps: ${chalk.cyan(steps)}`);
|
|
226
|
+
console.log(` Recorded: ${chalk.gray(date)}`);
|
|
227
|
+
|
|
228
|
+
if (metadata.tags && metadata.tags.length > 0) {
|
|
229
|
+
console.log(` Tags: ${metadata.tags.map(t => chalk.cyan(`#${t}`)).join(' ')}`);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
if (metadata.description) {
|
|
233
|
+
console.log(` ${chalk.gray(metadata.description)}`);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
console.log();
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
} catch (error) {
|
|
240
|
+
console.error(chalk.red('\n❌ Error listing capsules:'), error);
|
|
241
|
+
process.exit(1);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Show details of a specific capsule
|
|
247
|
+
*/
|
|
248
|
+
async function showCapsule(capsuleId) {
|
|
249
|
+
try {
|
|
250
|
+
const engine = await initEngine();
|
|
251
|
+
const capsule = await engine.getCapsule(capsuleId);
|
|
252
|
+
|
|
253
|
+
if (!capsule) {
|
|
254
|
+
console.error(chalk.red(`\n❌ Capsule not found: ${capsuleId}`));
|
|
255
|
+
process.exit(1);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
const { metadata, steps } = capsule;
|
|
259
|
+
|
|
260
|
+
console.log(chalk.blue('\n📼 Replay Capsule Details\n'));
|
|
261
|
+
console.log(chalk.bold(metadata.name || 'Untitled Session'));
|
|
262
|
+
console.log(chalk.gray('━'.repeat(60)));
|
|
263
|
+
|
|
264
|
+
// Basic info
|
|
265
|
+
console.log(chalk.bold('\n📋 Metadata'));
|
|
266
|
+
console.log(` ID: ${chalk.gray(metadata.id)}`);
|
|
267
|
+
console.log(` Recorded: ${chalk.gray(new Date(metadata.createdAt).toLocaleString())}`);
|
|
268
|
+
console.log(` Duration: ${chalk.cyan((metadata.duration / 1000).toFixed(2))}s`);
|
|
269
|
+
console.log(` Steps: ${chalk.cyan(steps.length)}`);
|
|
270
|
+
|
|
271
|
+
if (metadata.tags && metadata.tags.length > 0) {
|
|
272
|
+
console.log(` Tags: ${metadata.tags.map(t => chalk.cyan(`#${t}`)).join(' ')}`);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
if (metadata.url) {
|
|
276
|
+
console.log(` URL: ${chalk.cyan(metadata.url)}`);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
if (metadata.userAgent) {
|
|
280
|
+
console.log(` User Agent: ${chalk.gray(metadata.userAgent)}`);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
if (metadata.viewport) {
|
|
284
|
+
console.log(` Viewport: ${metadata.viewport.width}x${metadata.viewport.height}`);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// Description
|
|
288
|
+
if (metadata.description) {
|
|
289
|
+
console.log(`\n${chalk.bold('📝 Description')}\n${metadata.description}`);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// Steps summary
|
|
293
|
+
console.log(`\n${chalk.bold('🔍 Steps')}`);
|
|
294
|
+
|
|
295
|
+
const stepTypes = {};
|
|
296
|
+
steps.forEach(step => {
|
|
297
|
+
stepTypes[step.type] = (stepTypes[step.type] || 0) + 1;
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
console.log(' ' + Object.entries(stepTypes)
|
|
301
|
+
.map(([type, count]) => `${chalk.cyan(type)}: ${count}`)
|
|
302
|
+
.join(', '));
|
|
303
|
+
|
|
304
|
+
// Sample of steps
|
|
305
|
+
console.log(`\n${chalk.bold('🔎 Sample Steps')}`);
|
|
306
|
+
const sampleSize = Math.min(5, steps.length);
|
|
307
|
+
steps.slice(0, sampleSize).forEach((step, i) => {
|
|
308
|
+
const time = (step.timestamp / 1000).toFixed(2).padStart(6, ' ');
|
|
309
|
+
const type = step.type.padEnd(15, ' ');
|
|
310
|
+
let details = '';
|
|
311
|
+
|
|
312
|
+
switch (step.type) {
|
|
313
|
+
case 'navigation':
|
|
314
|
+
details = step.url;
|
|
315
|
+
break;
|
|
316
|
+
case 'click':
|
|
317
|
+
details = step.selector || `x:${step.x}, y:${step.y}`;
|
|
318
|
+
break;
|
|
319
|
+
case 'input':
|
|
320
|
+
details = `${step.selector} = "${step.value}"`;
|
|
321
|
+
break;
|
|
322
|
+
default:
|
|
323
|
+
details = JSON.stringify(step).slice(0, 50) + '...';
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
console.log(` ${chalk.gray(time + 's')} ${chalk.cyan(type)} ${details}`);
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
if (steps.length > sampleSize) {
|
|
330
|
+
console.log(` ... and ${steps.length - sampleSize} more steps`);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
console.log();
|
|
334
|
+
|
|
335
|
+
} catch (error) {
|
|
336
|
+
console.error(chalk.red('\n❌ Error showing capsule:'), error);
|
|
337
|
+
process.exit(1);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Delete a replay capsule
|
|
343
|
+
*/
|
|
344
|
+
async function deleteCapsule(capsuleId) {
|
|
345
|
+
try {
|
|
346
|
+
const engine = await initEngine();
|
|
347
|
+
await engine.deleteCapsule(capsuleId);
|
|
348
|
+
console.log(chalk.green(`\n✅ Deleted capsule: ${capsuleId}\n`));
|
|
349
|
+
} catch (error) {
|
|
350
|
+
console.error(chalk.red('\n❌ Error deleting capsule:'), error);
|
|
351
|
+
process.exit(1);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Export a replay capsule to a file
|
|
357
|
+
*/
|
|
358
|
+
async function exportCapsule(capsuleId, outputFile) {
|
|
359
|
+
try {
|
|
360
|
+
const engine = await initEngine();
|
|
361
|
+
const outputPath = await engine.exportCapsule(capsuleId, outputFile);
|
|
362
|
+
console.log(chalk.green(`\n✅ Exported capsule to: ${outputPath}\n`));
|
|
363
|
+
} catch (error) {
|
|
364
|
+
console.error(chalk.red('\n❌ Error exporting capsule:'), error);
|
|
365
|
+
process.exit(1);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Import a replay capsule from a file
|
|
371
|
+
*/
|
|
372
|
+
async function importCapsule(filePath) {
|
|
373
|
+
try {
|
|
374
|
+
const engine = await initEngine();
|
|
375
|
+
const result = await engine.importCapsule(filePath);
|
|
376
|
+
console.log(chalk.green(`\n✅ Imported capsule: ${result.id}`));
|
|
377
|
+
console.log(chalk.gray(`Path: ${result.path}\n`));
|
|
378
|
+
} catch (error) {
|
|
379
|
+
console.error(chalk.red('\n❌ Error importing capsule:'), error);
|
|
380
|
+
process.exit(1);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
// Set up CLI
|
|
385
|
+
program
|
|
386
|
+
.name('vibecheck replay')
|
|
387
|
+
.description('Record and replay user interactions for testing and debugging')
|
|
388
|
+
.version(version)
|
|
389
|
+
.option('-v, --verbose', 'Enable verbose output', false)
|
|
390
|
+
.option('--output-dir <dir>', 'Directory to save replay files', outputDir)
|
|
391
|
+
.hook('preAction', (thisCommand) => {
|
|
392
|
+
verbose = thisCommand.opts().verbose;
|
|
393
|
+
outputDir = thisCommand.opts().outputDir || outputDir;
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
// Record command
|
|
397
|
+
program
|
|
398
|
+
.command('record <url>')
|
|
399
|
+
.description('Record a user session')
|
|
400
|
+
.option('-n, --name <name>', 'Name for this recording')
|
|
401
|
+
.option('-d, --description <description>', 'Description of the recording')
|
|
402
|
+
.option('--tags <tags>', 'Comma-separated list of tags')
|
|
403
|
+
.option('--duration <seconds>', 'Auto-stop after specified seconds')
|
|
404
|
+
.option('--headed', 'Run browser in headed mode', false)
|
|
405
|
+
.option('--devtools', 'Open devtools', false)
|
|
406
|
+
.option('--video', 'Record video', false)
|
|
407
|
+
.action((url, options) => {
|
|
408
|
+
recordSession(url, options).catch(console.error);
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
// Play command
|
|
412
|
+
program
|
|
413
|
+
.command('play <capsule>')
|
|
414
|
+
.description('Replay a recorded session')
|
|
415
|
+
.option('--speed <speed>', 'Playback speed (1.0 = normal, 2.0 = 2x, etc.)', parseFloat, 1.0)
|
|
416
|
+
.option('--headed', 'Run browser in headed mode', false)
|
|
417
|
+
.option('--devtools', 'Open devtools', false)
|
|
418
|
+
.option('--stop-on-failure', 'Stop on first failure', false)
|
|
419
|
+
.action((capsule, options) => {
|
|
420
|
+
replaySession(capsule, options).catch(console.error);
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
// List command
|
|
424
|
+
program
|
|
425
|
+
.command('list')
|
|
426
|
+
.description('List available replay capsules')
|
|
427
|
+
.action(() => {
|
|
428
|
+
listCapsules().catch(console.error);
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
// Show command
|
|
432
|
+
program
|
|
433
|
+
.command('show <id>')
|
|
434
|
+
.description('Show details of a replay capsule')
|
|
435
|
+
.action((id) => {
|
|
436
|
+
showCapsule(id).catch(console.error);
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
// Delete command
|
|
440
|
+
program
|
|
441
|
+
.command('delete <id>')
|
|
442
|
+
.description('Delete a replay capsule')
|
|
443
|
+
.action((id) => {
|
|
444
|
+
deleteCapsule(id).catch(console.error);
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
// Export command
|
|
448
|
+
program
|
|
449
|
+
.command('export <id> <file>')
|
|
450
|
+
.description('Export a replay capsule to a file')
|
|
451
|
+
.action((id, file) => {
|
|
452
|
+
exportCapsule(id, file).catch(console.error);
|
|
453
|
+
});
|
|
454
|
+
|
|
455
|
+
// Import command
|
|
456
|
+
program
|
|
457
|
+
.command('import <file>')
|
|
458
|
+
.description('Import a replay capsule from a file')
|
|
459
|
+
.action((file) => {
|
|
460
|
+
importCapsule(file).catch(console.error);
|
|
461
|
+
});
|
|
462
|
+
|
|
463
|
+
// Show help if no arguments
|
|
464
|
+
if (process.argv.length <= 2) {
|
|
465
|
+
program.help();
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
// Parse command line arguments
|
|
469
|
+
program.parse(process.argv);
|