# CLI-based Data Governance

<p>
    <div>
      <iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="allowfullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/k1Un9Uy8FLU?autoplay=0&amp;controls=1&amp;end=0&amp;loop=0&amp;mute=0&amp;start=0" title="YouTube video"></iframe>
    </div>
<br /></p>
<p>We are excited to announce CLI-based data governance workflows in RudderStack. Our new CLI utility and other features make it easy to manage your <a href="https://www.rudderstack.com/docs/data-governance/data-catalog/" >data catalog</a> and <a href="https://www.rudderstack.com/docs/data-governance/tracking-plans/" >tracking plans</a> as code.</p>
<p>With CLI-based data governance, you can bring the same rigor and process to your data governance workflows that you apply to other development workflows, giving you more control, increased visibility, and ultimately better data quality.</p>

<blockquote class="announcement">
  <div class="tip-quote">
    
    <div class="tip-text"><p>This feature is in <strong>Alpha</strong>, where we work with early users and customers to test new features and get feedback before making them generally available.</p>
<p>Note that these features are functional but can change as we improve them. <a href="mailto:product@rudderstack.com" >Contact the Product team</a> if you have any questions.</p>
</div>
  </div>
</blockquote>

<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="key-features">Key features</h2><p>Some key features of CLI-based tracking plans management include:</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="declarative-yaml-configuration">Declarative YAML configuration</h3><ul>
<li>Define your events, including their names and descriptions, in YAML format.</li>
<li>Create reusable properties with advanced validation rules like min/max length, patterns (through regular expressions), and enums.</li>
<li>Define tracking plan rules by associating events with required properties using a structured reference system.</li>
<li>Reuse property definitions across multiple events with a standardized path reference system.</li>
</ul>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="powerful-cli-tool">Powerful CLI tool</h3><p>The new workflow comes with a powerful <a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/" >Rudder CLI tool</a> that lets you:</p>
<ul>
<li>Create, update, and delete data catalog and tracking plan resources via command line.</li>
<li>Verify your YAML configurations before pushing changes.</li>
<li>Sync changes in your local files or GitHub repo to RudderStack.</li>
</ul>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">The CLI utility currently only supports <em>pushing</em> to RudderStack, so we recommend starting with a clean workspace (pulling existing assets from the UI is in the works!). Reach out to our team if you would like us to create a dedicated workspace for testing. <a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/data-catalog-and-tracking-plans/#limitations" >See our list of limitations</a> to learn more about current differences between the CLI and UI.</div>
  </div>
</blockquote>

</html>
<!-- end-chunk -->
<!-- begin-chunk -->
<h3 id="git-integration--cicd-support">Git Integration &amp; CI/CD support</h3><ul>
<li>Leverage GitHub Actions to automatically validate and deploy tracking plans from your repository.</li>
<li>Implement version control by tracking changes, managing branches, and reviewing modifications through standard Git workflows.</li>
<li>Review any tracking plan changes before they reach production.</li>
</ul>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="use-cases">Use Cases</h2><p>This feature is particularly valuable for teams who:</p>
<ul>
<li>Manage large tracking plans with hundreds of events and properties.</li>
<li>Need better integration with existing development workflows.</li>
<li>Want to maintain consistent tracking standards across multiple applications.</li>
<li>Require version control and review processes for data governance.</li>
</ul>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="get-started">Get started</h2>

<ol>
<li><a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/installation/" >Install the Rudder CLI tool</a> in your preferred environment.</li>
<li>Generate a <a href="https://www.rudderstack.com/docs/access-management/service-access-tokens/#workspace-sat" >workspace-level Service Access Token</a> in the RudderStack dashboard with the following <a href="https://www.rudderstack.com/docs/access-management/policies-overview/#resource-permissions" >permissions</a> to manage Data Catalog and Tracking Plans:</li>
</ol>

<table>
  <thead>
      <tr>
          <th>Resource</th>
          <th>Permissions</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Tracking Plans</td>
          <td><strong>Create &amp; Delete</strong>, <strong>Edit</strong></td>
      </tr>
      <tr>
          <td>Data Catalog</td>
          <td><strong>Edit</strong></td>
      </tr>
  </tbody>
</table>
<ul>
<li><strong>If you&rsquo;re on Free or self-hosted plan, or for testing and development only</strong>: Generate a <a href="https://www.rudderstack.com/docs/access-management/personal-access-tokens/" >Personal Access Token</a> with <strong>Read-Write</strong> role</li>
</ul>

<blockquote class="warning">
  <div class="tip-quote">
    
    <div class="tip-text">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.</div>
  </div>
</blockquote>
<p><strong>Token permissions for legacy RBAC system</strong></p>
<p>If you are on the <a href="https://www.rudderstack.com/docs/archive/dashboard-guides/user-management/" >legacy Permissions Management (RBAC) system</a>, your workspace-level Service Access Token should have minimum <strong>Admin</strong> permissions.</p>
<p>See <a href="https://www.rudderstack.com/docs/archive/dashboard-guides/service-access-tokens/#generate-service-access-token" >Generate a workspace-level Service Access Token</a> for steps to create the token.</p>

<figure class="image--main "  >
    <a 
         href="/docs/images/access-management/permissions/legacy/admin.webp"
        
        >
        <img src="/docs/images/access-management/permissions/legacy/admin.webp" 
         alt="workspace-level Service Access Token with Admin permission"  
         
         
        decoding="async" loading="lazy" class="img-shortcode"/>
    </a>
    
</figure>

<ol start="3">
<li><a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/data-catalog-and-tracking-plans/tracking-plans/" >Initialize a new Tracking Plan project</a> with <a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/yaml-data-catalog-and-tracking-plans/" >YAML definitions</a>. Then, sync the changes to your workspace.</li>
<li>Automate Tracking Plan management using <a href="https://www.rudderstack.com/docs/dev-tools/rudder-cli/github-actions/" >GitHub Actions</a>.</li>
</ol>

<br />
