Skip to main content

Snowtype CLI command reference

This page lists every Snowtype CLI command and its options. For more details about configuring Snowtype, see the sources and output configuration and configuration reference pages.

Use each command like this:

bash
snowtype [COMMAND] [OPTIONS] [CONTEXT-SPECIFIC-OPTIONS]

# Example:
snowtype init -i my-organization-id -t snowplow-android-tracker -l kotlin -o ./generated-code
Terminology

We originally called tracking plans "data products". You'll still find the old term used in some existing APIs and CLI commands.

Global options

These options work with any command.

FlagDescription
-h, --helpShow help for the command.
-V, --versionOutput the package version number.
-k, --apiKey <string>Snowplow Console API key.
-s, --apiKeyId <string>Snowplow Console API key ID.
-v, --verboseEnable verbose logging.

init

Initializes Snowtype in a project by creating the configuration file.

FlagDescription
-i, --organizationId <string>Organization ID
-t, --tracker <tracker>Tracker to use
-l, --language <language>Language to use
-o, --outpath <string>Output path for generated code

See the configuration reference for details of the valid tracker and language options.

generate

Generates tracking code based on the configuration file.

FlagDescriptionDefault
-c, --config <string>Config file path.
--instructionsGenerate event specification instructions.
--no-instructionsGenerate without instructions.
--validationsAdd runtime validation using Ajv. Available only for the Browser tracker.
--no-validationsGenerate without runtime validations.
--disallowDevSchemasDisallow generation of code using schemas only deployed on DEV environment.false
--deprecateOnlyOnProdAvailableUpdatesShow deprecation warnings only when there are PROD-available schema updates.false

update

Checks for updates to event specifications and data structures. Event specification updates are checked against the versions pinned in .snowtype-lock.json. Data structure updates are checked against versions in snowtype.config.json.

FlagDescriptionDefault
-c, --config <string>Config file path.
-y, --yesApply all available updates without prompting. Overwrites the configuration and lock files.false
-m, --maximumBump <level>For data structures and schemas only. Maximum SchemaVer bump to show update notifications for. Values: patch, minor, major.major
-d, --latestDraftInclude draft versions when checking for event specification updates. By default, only published versions are shown. Does not affect data structures.
-e, --eventSpecs <ids...>Check only the specified event specifications.
-p, --dataProducts <ids...>Check only event specifications belonging to the specified tracking plans.

patch

Adds new items to the configuration file without modifying it by hand.

FlagDescription
-c, --config <string>Config file path
-e, --eventSpecificationIds <ids...>Event specification IDs
-p, --dataProductIds <ids...>Tracking plan IDs
-d, --dataStructures <uris...>Data structure schema URIs
-i, --igluCentralSchemas <uris...>Iglu Central schema URI.
-r, --repositories <paths...>Local data structure repository paths

purge

Removes event specification entries from the lock file that no longer appear in the configuration file.

FlagDescription
-c, --config <string>Config file path

On this page

Want to see a custom demo?

Our technical experts are here to help.