# Snowtype CLI command reference
> Summary of Snowtype CLI commands and options for code generation, with details on usage scenarios and configuration.
> Source: https://docs.snowplow.io/docs/event-studio/implement-tracking/command-reference/
> Documentation index: https://docs.snowplow.io/llms.txt

This page lists every Snowtype CLI command and its options. For more details about configuring Snowtype, see the [sources and output configuration](/docs/event-studio/implement-tracking/snowtype-config/) and [configuration reference](/docs/event-studio/implement-tracking/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
```

> **Info: 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.

| 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.            |

## `login`

Applies to **Snowtype 0.21.0+**[Latest: 0.21.0](/docs/api-reference/versions/#feature-availability-by-version "The latest Snowtype version is 0.21.0")

Logs in to Snowplow Console in the browser. Snowtype uses the login when no API key is set. [Snowplow CLI](/docs/api-reference/snowplow-cli/#configure) shares the same login. See [authenticate](/docs/event-studio/implement-tracking/install-snowtype/#authenticate) for when to use a login or an API key.

| Flag                     | Description                                              |
| ------------------------ | -------------------------------------------------------- |
| `--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](/docs/api-reference/versions/#feature-availability-by-version "The latest Snowtype version is 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.

| 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](/docs/event-studio/implement-tracking/configuration-reference/#supported-trackers-and-languages) 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](/docs/event-studio/implement-tracking/generate-tracking-code/#markdown-instructions).                                                        |         |
| `--no-instructions`                     | Generate without instructions.                                                                                                                                                           |         |
| `--validations`                         | Add [runtime validation](/docs/event-studio/implement-tracking/client-side-validation/) using Ajv. Available only for the Browser tracker.                                               |         |
| `--no-validations`                      | Generate without runtime validations.                                                                                                                                                    |         |
| `--disallowDevSchemas`                  | Disallow [generation of code](/docs/event-studio/implement-tracking/generate-tracking-code/#prevent-generation-from-development-schemas) using schemas only deployed on DEV environment. | `false` |
| `--deprecateOnlyOnProdAvailableUpdates` | Show [deprecation warnings](/docs/event-studio/implement-tracking/generate-tracking-code/#deprecation-and-hidden-warnings) only when there are PROD-available schema updates.            | `false` |

## `check`

Applies to **Snowtype 0.20.0+**[Latest: 0.21.0](/docs/api-reference/versions/#feature-availability-by-version "The latest Snowtype version is 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`](/docs/event-studio/implement-tracking/command-reference/#generate).

The `--instructions` flag behaves differently: `check` ignores [event specification instructions](/docs/event-studio/implement-tracking/generate-tracking-code/#markdown-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:

```text
✗ 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`.

| 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 [schema version](/docs/fundamentals/schemas/versioning/) 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](/docs/api-reference/snowplow-cli/data-structures/) 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 |
