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:
snowtype [COMMAND] [OPTIONS] [CONTEXT-SPECIFIC-OPTIONS]
# Example:
snowtype init -i my-organization-id -t snowplow-android-tracker -l kotlin -o ./generated-code
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.
| Flag | Description |
|---|---|
-h, --help | Show help for the command. |
-V, --version | Output the package version number. |
-k, --apiKey <string> | Snowplow Console API key. |
-s, --apiKeyId <string> | Snowplow Console API key ID. |
-v, --verbose | Enable verbose logging. |
init
Initializes Snowtype in a project by creating the configuration file.
| Flag | Description |
|---|---|
-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.
| Flag | Description | Default |
|---|---|---|
-c, --config <string> | Config file path. | |
--instructions | Generate event specification instructions. | |
--no-instructions | Generate without instructions. | |
--validations | Add runtime validation using Ajv. Available only for the Browser tracker. | |
--no-validations | Generate without runtime validations. | |
--disallowDevSchemas | Disallow generation of code using schemas only deployed on DEV environment. | false |
--deprecateOnlyOnProdAvailableUpdates | Show 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.
| Flag | Description | Default |
|---|---|---|
-c, --config <string> | Config file path. | |
-y, --yes | Apply 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, --latestDraft | Include 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.
| Flag | Description |
|---|---|
-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.
| Flag | Description |
|---|---|
-c, --config <string> | Config file path |