Skip to main content

For AI agents: a Markdown version of this page is at https://docs.snowplow.io/docs/event-studio/implement-tracking/command-reference.md. The index of all documentation pages is at https://docs.snowplow.io/llms.txt, and the index for this section is at https://docs.snowplow.io/docs/cdi/llms.txt.

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.

login​

Applies to Snowtype 0.21.0+Latest: 0.21.0

Logs in to Snowplow Console in the browser. Snowtype uses the login when no API key is set. Snowplow CLI shares the same login. See authenticate for when to use a login or an API key.

FlagDescription
--clientId <string>Auth0 client ID. The default works for Snowplow Console.
--auth0Domain <string>Auth0 domain. The default works for Snowplow Console.

logout​

Applies to Snowtype 0.21.0+Latest: 0.21.0

Logs out of Snowplow Console. Snowplow CLI shares the same login, so this logs it out too. API keys aren't affected. This command has no flags.

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

check​

Applies to Snowtype 0.20.0+Latest: 0.21.0

Reports whether the generated code in the output path matches what generate writes, without writing anything. check uses the same configuration file and takes the same flags as generate.

The --instructions flag behaves differently: check ignores event specification instructions in the output path, and warns that the check doesn't cover them.

check exits with code 0 when the generated code is up to date. It exits with code 1 when any file differs or when Snowtype can't generate the code, for example without Console credentials. check doesn't compare or update .snowtype-lock.json.

When the generated code is out of date, check fails with this error and lists each file in the output path that differs, is missing, or isn't one that generate writes. To fix it, run snowtype generate and commit the result:

✗ Error: The generated code is not up to date with the tracking definitions. Run `snowtype generate` and commit the result.
src/tracking/snowplow.ts

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 schema version 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

Was this page helpful?