Advanced
Command Line Interface
Use the CLI through npx eventvisor. Run any command with --help for its typed options.
npx @eventvisor/cli initnpx eventvisor lintnpx eventvisor testnpx eventvisor buildnpx eventvisor catalogChoose a reference scaffold during initialization:
npx @eventvisor/cli init --project=demonpx @eventvisor/cli init --project=environmentsAvailable learning-oriented scaffolds include demo, no-environments, environments, and test-environments. YAML remains the default.
Run against another checkout with --rootDirectoryPath <path>. The kebab-case --root-directory-path and --projectDirectoryPath forms are also accepted.
Inspecting a project#
npx eventvisor confignpx eventvisor list eventnpx eventvisor info event pageViewnpx eventvisor find-usage attribute userIdnpx eventvisor list schemanpx eventvisor find-usage schema identifiernpx eventvisor find-usage --unused-attributes --unused-schemas --unused-destinationsSupported entity types include events, attributes, destinations, effects, Schemas, Targets, and tests.
Commands that print data support JSON where appropriate. Add --pretty when formatted JSON is easier to inspect.
Runtime simulation#
npx eventvisor simulate pageView --value='{"url":"https://example.com"}'npx eventvisor benchmark pageView -n 1000000 --value='{"url":"https://example.com"}'The benchmark warms up the SDK before measuring. Output reports minimum, average, maximum, p50, p95, and p99 duration for individual evaluations in microseconds.
Selection#
Project commands accept --set in Set projects. Build, test, simulation, benchmark, and code generation accept repeatable --tag and --target options.
npx eventvisor generate-code --language typescript --out-dir src/generated --target checkout --target accountPromotion#
npx eventvisor promote --from development --to stagingnpx eventvisor promote --from development --to staging --target checkout --apply --auditPromotion is available to Set projects. Preview is the default. See Promotions.
Project plugins#
Register project-specific commands in eventvisor.config.js with a type-safe plugin:
const { definePlugin } = require("@eventvisor/core");module.exports = { plugins: [ definePlugin({ command: "publish-preview", description: "publish a preview datafile", options: {}, examples: [], async handler({ datasource }) { console.log(await datasource.readRevision()); }, }), ],};Custom commands run with the same resolved project configuration and datasource as built-in commands. Duplicate command names are ignored with a warning.
Version#
npx eventvisor --version
