Skip to main content

Snowtype CLI command reference

Terminology

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

info

This page only summarizes the CLI commands and the options for each command. For details on which scenarios they can be used, you can go to the Working with the CLI page.

Usage

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

Available CLI commands

snowtype init

Initialize the setup of Snowtype code generation in a project. Creates the configuration file.

Options

  • -i, --organizationId Organization ID.
  • -t, --tracker Tracker to use. See available
  • -l, --language Language to use. See available
  • -o, --outpath Output path.

snowtype generate

Generates tracking code based on the configuration file. On the first run, Snowtype creates a .snowtype-lock.json file next to the configuration file to pin the resolved versions. On subsequent runs, generate reads versions from the lock file rather than fetching the latest. To update the pinned versions, use the snowtype update command.

Options

  • -c, --config Config file path.
  • --instructions Generate event specification instructions.
  • --no-instructions Generate without instructions.
  • --validations Add runtime validation on events. Currently available for the Browser tracker.
  • --no-validations Do not add runtime validation on events.
  • --disallowDevSchemas Disallow generation of code using schemas deployed on DEV environment. Sending events using schemas deployed on DEV, will result in failed events in production pipelines. (default: false)
  • --deprecateOnlyOnProdAvailableUpdates Show deprecation warnings only when there are PROD available schema updates. (default: false)

snowtype update

Updates the pinned versions in the .snowtype-lock.json file. By default, updates all event specifications to the latest published versions.

Options

  • -c, --config Config file path.
  • -y, --yes Updates all to latest version without prompting. (default: false)
  • -m, --maximumBump The maximum SchemaVer update to show an available update notification for. Possible values are 'patch', 'minor', 'major' and will work as expected regular SemVer bumps. (default: 'major')
  • --latestDraft Update to the latest draft version.
  • --eventSpecs <ids...> Update only the specified event specifications.
  • --dataProducts <ids...> Update only the specified tracking plans.

snowtype patch

Adds new Data Structures and Event Specifications in the snowtype.config.json file without needing to modify the file by hand.

Options

  • -c, --config Config file path.
  • -e, --eventSpecificationIds Event Specification ID/s.
  • -p, --dataProductIds Tracking Plan ID/s.
  • -d, --dataStructures Data structure schema URI/s.
  • -i, --igluCentralSchemas Iglu central schema URI/s.
  • -r, --repositories Local Data Structure repositories generated from the snowplow-cli.

snowtype help

Shows a helpful message and brief instructions for the Snowtype CLI usage.

Global options

  • -h, --help Shows helpful instructions for the command.
  • -V, --version Output the package version number.
  • -k, --apiKey Provide the Snowplow Console API key as a CLI option.
  • -v, --verbose Enable verbose logging.