Appearance
CLI Reference ​
The Voltage Schema CLI provides several commands to help you manage your analytics schema and generate types.
Installation ​
For the core tracking functionality:
bash
npm install voltage-schemaFor documentation generation (recommended as dev dependency):
bash
npm install --save-dev voltage-autodocCommands ​
voltage init ​
Initializes a new Voltage Schema project.
bash
npm voltage initCreates:
voltage.config.js- Configuration file- Initial schema files
- Basic project structure
voltage generate ​
Generates TypeScript types and tracking configuration from your schema files.
bash
npm voltage generateOptions:
--watch- Watch for schema changes and regenerate
voltage events ​
Lists all events defined in your schema.
bash
npm voltage eventsOptions:
-verbose- Output full taxonomy data as JSON
Auto-Documentation ​
The autodoc generation is handled by the separate voltage-autodoc dev package to keep the dependency footprint small for voltage-schema.
voltage-autodoc ​
Generates documentation from your schema files.
bash
npm voltage-autodocOptions:
--output-html- Generate HTML documentation
You can view a sample autodoc to see what the generated documentation looks like.
CI/CD Integration ​
The CLI tools are designed to work well in CI/CD environments:
bash
# Generate types
npm voltage generate
# Output taxonomy data for CI automation
npm voltage events -- -verbose
# Generate documentation for self-hosting
npm voltage-autodoc -- --output-html
