# CLI-based Data Catalog and Tracking Plan Management


> Track, version control, and manage your events, properties, and Tracking Plans as code.



RudderStack's CLI-based Tracking Plans management feature helps you manage [Tracking Plans](https://www.rudderstack.com/docs/data-governance/tracking-plans/) and [Data Catalog](https://www.rudderstack.com/docs/data-governance/data-catalog/) as code by leveraging the new CLI-based workflow. It helps you bring data governance into your existing development workflows through code-first management.

**Success:** An agent writes the YAML, you approve the change, and apply the spec to any environment.

With this feature, you can bring the same rigor and process to your Tracking Plans that you apply to your application code, ensuring consistency and quality in your data collection strategy.

## Key features

With RudderStack's CLI-based Tracking Plan management, you get the following features:

### Declarative YAML configuration

- Define and manage events, properties, and Tracking Plans directly in your codebase using simple [YAML files](https://www.rudderstack.com/docs/rudder-cli/yaml-data-catalog-and-tracking-plans/).
- Create reusable property definitions with [advanced validation rules](https://www.rudderstack.com/docs/data-governance/data-catalog/properties/#advanced-rules) like minimum/maximum length, patterns, enums, etc. across multiple events.
- Define dynamic validation rules using [Conditional Validation](https://www.rudderstack.com/docs/rudder-cli/data-catalog-and-tracking-plans/conditional-validation/) that adapt based on context.
- Leverage a structured referencing system to associate events and properties to a Tracking Plan.

### Powerful Rudder CLI tool

This feature comes with a powerful [Rudder CLI](https://www.rudderstack.com/docs/rudder-cli/) utility that lets you:

- Create, update, and delete Tracking Plan resources via command line.
- Verify your YAML configurations locally before pushing changes to production.
- Sync the local configuration files with your RudderStack workspace.

**Success**

In contrast to how Infrastructure-as-Code (IaC) tools typically depend on external object storage like S3 to maintain their state, you can store the relevant state directly in RudderStack, thereby significantly reducing configuration overhead.

You only need the YAML configuration files and a [RudderStack token](https://www.rudderstack.com/docs/rudder-cli/data-governance-walkthrough/#prerequisites) to use Rudder CLI.

### Git integration and CI/CD support

- Leverage [GitHub Actions](https://www.rudderstack.com/docs/rudder-cli/github-actions/) to automatically validate and deploy Tracking Plans from your repository.
- Use the standard Git workflows to track changes, implement version control, manage branches, and make any other modifications.

## Who can use this feature?

The CLI-based Data Catalog and Tracking Plan management feature is helpful for data teams who need to:

- Manage their Tracking Plans and Data Catalog programmatically with consistent tracking standards.
- Integrate their Tracking Plan changes into their existing development workflows.
- Validate their Tracking Plan changes before deployment.

## Get started

1. [Install the Rudder CLI tool](https://www.rudderstack.com/docs/rudder-cli/installation/) in your preferred environment.
2. Generate a [workspace-level Service Access Token](https://www.rudderstack.com/docs/access-management/service-access-tokens/#workspace-sat) in the RudderStack dashboard with the following [permissions](https://www.rudderstack.com/docs/access-management/policies-overview/#resource-permissions) to manage Data Catalog and Tracking Plans:

| Resource | Permissions |
| --- | --- |
| Tracking Plans | **Create & Delete**, **Edit** |
| Data Catalog | **Edit** |
- **If you're on Free or self-hosted plan, or for testing and development only**: Generate a [Personal Access Token](https://www.rudderstack.com/docs/access-management/personal-access-tokens/) with **Read-Write** role
**Warning:** Any action authenticated by a Personal Access Token will break if the user generating the token is removed from the organization or there is a breaking change to their permissions.

**Token permissions for legacy RBAC system**

If you are on the [legacy Permissions Management (RBAC) system](https://www.rudderstack.com/docs/archive/dashboard-guides/user-management/), your workspace-level Service Access Token should have minimum **Admin** permissions.

See [Generate a workspace-level Service Access Token](https://www.rudderstack.com/docs/archive/dashboard-guides/service-access-tokens/#generate-service-access-token) for steps to create the token.

![workspace-level Service Access Token with Admin permission](/docs/images/access-management/permissions/legacy/admin.webp)

3. [Initialize a new Tracking Plan project](https://www.rudderstack.com/docs/rudder-cli/data-catalog-and-tracking-plans/tracking-plans/) with [YAML definitions](https://www.rudderstack.com/docs/rudder-cli/yaml-data-catalog-and-tracking-plans/). Then, sync the changes to your workspace.
4. Automate Tracking Plan management using [GitHub Actions](https://www.rudderstack.com/docs/rudder-cli/github-actions/).

## Limitations

Rudder CLI only supports **pushing** updates to RudderStack, not **pulling**. This means you will need to test with a clean **Dev** workspace where the Data Catalog is empty and there are no Tracking Plans.

[Contact the Product team](mailto:product@rudderstack.com) or your Technical Account Manager if you need a new workspace.

<br />

