# Create Models

> A comprehensive guide on creating models in Meshery, covering both CLI and UI methods.

---

LLMS index: [llms.txt](/llms.txt)

---

Meshery offers two primary ways to bring models into your system: **Create** and **[Import](/guides/configuration-management/importing-models/)**.

- **Import** is ideal when you already have a model definition file (e.g., JSON, CSV) and simply want to bring it into Meshery.
- **Create** is the recommended approach if you are starting fresh. A wizard in Meshery UI walks you through building a model step by step.

This page walks you through the **Create** workflow, which gives you full control over naming, styling, and categorizing your model while sourcing its CRDs from GitHub or ArtifactHub.

> Tip: If you don’t have any files yet, start with **Create**. You can always [export](/guides/configuration-management/exporting-models/) or re-import your model later.

<div class="tab-container tab-level-1"><input id="creating-models-tabs-6-1" type="radio" name="creating-models-tabs-6" checked>
    <label for="creating-models-tabs-6-1"><i class="fa fa-desktop" aria-hidden="true"></i>Meshery UI
    </label>
    <section class="tabbed" id="creating-models-tabs-6-content-1"><p>The URL Create feature allows you to create models in Meshery by providing URLs to source repositories or package registries. Here's how to use it:</p>
<h4>Step 1: Open the Model Generation Interface</h4>
<p>Open the Registry: click your avatar in the top right and choose <strong>Registry</strong>, or go to <strong>Settings</strong> &gt; <strong>Registry</strong>. On the <strong>Models</strong> tab, click <strong>Create Model</strong>. To try it without installing Meshery, use the <a href="https://playground.meshery.io/settings?settingsCategory=Registry&tab=Models">Registry in the Meshery Playground</a>.</p>
<a href="./images/create-ui-where.gif">
    <img src="./images/create-ui-where.gif" alt="registry generate model" style="width: 50%; max-width: 400px;">
  </a>
<h4>Step 2: Set Up Your Model Name</h4>
<p>Enter the following names for your model:</p>
<ul>
  <li><strong>Model Name:</strong> This is the unique, system identifier. Use lowercase letters and hyphens only (no spaces). <br>Example: <code>cert-manager</code></li>
  <li><strong>Model Display Name:</strong> This is the friendly name displayed in the UI. It can include spaces and uppercase letters. <br>Example: <code>Cert Manager</code></li>
</ul>
<a href="./images/create-ui-name.png">
    <img src="./images/create-ui-name.png" alt="registry generate model name" style="width: 50%; max-width: 400px;">
  </a>
<h4>Step 3: Set Model Categorization</h4>
<p>Select the appropriate <strong>Category</strong> and <strong>Subcategory</strong> from the dropdowns. If your model doesn't match any available category, choose Uncategorized to ensure it can be easily located later.</p>
<a href="./images/create-ui-category.png">
    <img src="./images/create-ui-category.png" alt="registry generate model categorization" style="width: 50%; max-width: 400px;">
  </a>
<h4>Step 4: Configure Model Styling</h4>
<p>Customize your model's appearance:</p>
<ul>
  <li><strong>Logos:</strong> Upload separate images for dark and light themes.</li>
  <li><strong>Colors:</strong> Define the primary and secondary colors for your model's visual elements.</li>
  <li><strong>Icon Shape:</strong> Choose a shape for the model’s icon as displayed in the UI.</li>
</ul>
<p>Note: If you don't provide custom styling, Meshery's default values will be used.</p>
<a href="./images/create-ui-styling.png">
    <img src="./images/create-ui-styling.png" alt="registry generate model styling" style="width: 50%; max-width: 400px;">
  </a>
<h4>Step 5: Provide the Source Location</h4>
<p>Specify the source for your model by entering one of the following URL types:</p>
<ul>
  <li>
    <strong>GitHub Repository:</strong><br>
    Enter a URL using the following format:  
    <code>git://github.com/[organization]/[repository]/[branch]/path/to/crds</code><br>
    Example:  
    <code>git://github.com/cert-manager/cert-manager/master/deploy/crds</code>
  </li>
  <li>
    <strong>ArtifactHub Package:</strong><br>
    Enter a URL in this format:  
    <code>https://artifacthub.io/packages/search?ts_query_web={model-name}</code>
  </li>
</ul>
<div class="alert alert-light" role="alert"><div class="h4 alert-heading" role="heading">Need a Source URL?</div>
<p>Check the<code>sourceURL</code>column in the <a href='https://docs.google.com/spreadsheets/d/1DZHnzxYWOlJ69Oguz4LkRVTFM79kC2tuvdwizOJmeMw' target='_blank' rel='noopener'>Meshery Integration Sheet</a> and try one of the listed sources.</p>
</div>
<a href="./images/create-ui-source.png">
    <img src="./images/create-ui-source.png" alt="registry generate model source selection" style="width: 50%; max-width: 400px;">
  </a>
<h4>Step 6: Additional Settings</h4>
<ul>
<li><strong>Immediate Registration:</strong> Enable this option to register your model instantly, making it available in your Meshery instance right away.</li>
<li><strong>Visual Annotation Only:</strong> Mark this option if your model is intended solely for visual diagramming rather than infrastructure management.</li>
</ul>
<a href="./images/create-ui-details.png">
    <img src="./images/create-ui-details.png" alt="registry generate model additional settings" style="width: 50%; max-width: 400px;">
  </a>
<div class="alert alert-light" role="alert"><div class="h4 alert-heading" role="heading">Visual Annotation Models</div>
<p>When a model is marked for visual annotation only, it means the model will be used purely for visualization and diagramming purposes within Meshery&rsquo;s interface, rather than for actual infrastructure management.</p>
</div>
<h4>Step 7: Finalize and Create Your Model</h4>
<p>Review your model details. If everything looks good, click "Generate" to create your model.</p>
<p>Meshery will process the provided source URL, extract the necessary information, and create the model based on the specified details.</p>
<p>If you want to make any changes before generation, you can go back to the previous steps using the navigation buttons and edit the details as needed.</p>
<a href="./images/create-ui-finalize.png">
    <img src="./images/create-ui-finalize.png" alt="registry generate model generate" style="width: 50%; max-width: 400px;">
  </a>
<h4>Step 8: Check Model Generation Status</h4>
<p>Once the model is successfully generated, a confirmation message will appear. You'll be able to view the model along with its components and relationships directly in the Registry page.</p>
<p>If any issues occur, Meshery will display an error message detailing what went wrong so you can correct it and try again.</p>
<p>A notification will also appear in the <a href="/guides/infrastructure-management/notification-management/">Notification Center</a> to confirm whether the operation succeeded or failed, providing additional context if needed.</p>
<div class="alert alert-warning" role="alert"><div class="h4 alert-heading" role="heading">Note on Deletion</div>
<p>You cannot delete a generated model from Meshery UI. To stop using it, mark it as ignored, or delete it with <code>mesheryctl model delete &lt;model-name&gt;</code>.</p>
</div></section><input id="creating-models-tabs-6-2" type="radio" name="creating-models-tabs-6">
    <label for="creating-models-tabs-6-2"><i class="fa fa-terminal" aria-hidden="true"></i>mesheryctl
    </label>
    <section class="tabbed" id="creating-models-tabs-6-content-2"><h3>Prerequisites:</h3>
<ul>
  <li>Fork the <a href="https://github.com/meshery/meshery" target="_blank" rel="noopener">meshery/meshery repository.</a></li>
  <li>Install the Meshery CLI by following the <a href="/installation/" target="_blank" rel="noopener">installation instructions.</a></li>
</ul>
<div class="alert alert-info" role="alert"><div class="h4 alert-heading" role="heading">Generating Models does not require Meshery Server</div>
<p>Meshery Server is not required to generate models. The Meshery CLI can be used to generate models. Model and Component generation logic is MeshKit. <code>mesheryctl</code> and Meshery Server both utilize MeshKit&rsquo;s libraries for ongoing programmatic generation of models and components.</p>
</div>
<br />
<div class="tab-container tab-level-2 tab-container--nested"><input id="mesheryctl-tabs-5-1" type="radio" name="mesheryctl-tabs-5" checked>
    <label for="mesheryctl-tabs-5-1"><i class="fa fa-folder-tree" aria-hidden="true"></i>Using Scaffold (model init)
    </label>
    <section class="tabbed" id="mesheryctl-tabs-5-content-1"><p>The scaffold workflow is the most direct way to hand-author a model - especially an <strong>annotation-only</strong> model (a curated set of icons used purely for visual diagramming). Unlike the CSV and Spreadsheet workflows, it does not require forking <code>meshery/meshery</code> or a Google Spreadsheet credential; it produces model files locally, packages them as an OCI image, and registers them into a running Meshery Server.</p>
<h4>1. Scaffold the model</h4>
<p>Generate the folder structure with <code>mesheryctl model init</code>:</p>
<code>mesheryctl model init digitalocean-icons --version v0.1.0</code>
<p>This creates:</p>
<code>
digitalocean-icons/
<br />└── v0.1.0/
<br />&nbsp;&nbsp;&nbsp;&nbsp;├── model.json          # model definition (name and displayName are pre-filled from the argument)
<br />&nbsp;&nbsp;&nbsp;&nbsp;├── components/          # one sample component; add one JSON file per component
<br />&nbsp;&nbsp;&nbsp;&nbsp;├── relationships/
<br />&nbsp;&nbsp;&nbsp;&nbsp;├── connections/
<br />&nbsp;&nbsp;&nbsp;&nbsp;└── credentials/
</code>
<h4>2. Edit <code>model.json</code></h4>
<p>Open <code>digitalocean-icons/v0.1.0/model.json</code> and set the model's identity and appearance:</p>
<ul>
  <li><code>category.name</code> and <code>subCategory</code> - e.g. <code>Platform</code> / <code>Cloud Provider</code>.</li>
  <li><code>registrant.kind</code> - e.g. <code>meshery</code>.</li>
  <li><code>description</code> - a short summary of what the model provides.</li>
  <li><code>metadata.svgColor</code> and <code>metadata.svgWhite</code> - the model's display icon, as an inline SVG string (strip any <code>&lt;?xml ...?&gt;</code> header and collapse the SVG to a single line).</li>
  <li><code>metadata.isAnnotation</code> - set to <code>true</code> for an annotation-only (visual diagramming) model.</li>
</ul>
<h4>3. Add one component per capability</h4>
<p><code>model init</code> drops a single sample component under <code>components/</code>. Add one JSON file per component (delete the sample if unused). For each component set:</p>
<ul>
  <li><code>displayName</code> - the human-readable name shown in the UI (e.g. <code>DO Logo Icon Blue</code>).</li>
  <li><code>component.kind</code> - the unique identifier for the component (e.g. <code>do-logo-icon-blue</code>).</li>
  <li><code>styles.svgColor</code> and <code>styles.svgWhite</code> - the component's inline SVG.</li>
  <li><code>metadata.isAnnotation</code> - <code>true</code> for annotation components.</li>
</ul>
<div class="alert alert-warning" role="alert"><div class="h4 alert-heading" role="heading">Component schemaVersion compatibility</div>
<p>For the widest server compatibility, set each component&rsquo;s <code>schemaVersion</code> to <code>components.meshery.io/v1beta1</code> and the model&rsquo;s to <code>models.meshery.io/v1beta2</code>. Meshery Servers only accept the <code>v1beta3</code> component wire format once they ship a MeshKit new enough to recognize it; a released server that predates that support rejects <code>v1beta3</code> components with a generic &ldquo;No valid component or relationship found in the Model provided&rdquo; error at import time.</p>
</div>
<h4>4. Package the model as an OCI image</h4>
<code>mesheryctl model build digitalocean-icons/v0.1.0</code>
<p>This writes an OCI artifact named <code>&lt;model&gt;-&lt;version&gt;.tar</code> (e.g. <code>digitalocean-icons-v0-1-0.tar</code>) to your current directory.</p>
<h4>5. Register the model into a Meshery Server</h4>
<p>Import the packaged artifact (or the model directory) into your connected Meshery Server. This step requires a running server and an authenticated <code>mesheryctl</code> context (see <a href="/reference/mesheryctl/system/login/"><code>mesheryctl system login</code></a>):</p>
<code>mesheryctl model import -f digitalocean-icons-v0-1-0.tar</code>
<p>Verify the result:</p>
<code>mesheryctl model view digitalocean-icons</code>
<p>See <a href="/guides/configuration-management/importing-models/">Importing Models</a> for the full set of import sources and <a href="/guides/configuration-management/push-pull-model-image/">Push or Pull a Model Image</a> for packaging details.</p></section><input id="mesheryctl-tabs-5-2" type="radio" name="mesheryctl-tabs-5">
    <label for="mesheryctl-tabs-5-2"><i class="fa fa-list" aria-hidden="true"></i>Using CSV
    </label>
    <section class="tabbed" id="mesheryctl-tabs-5-content-2"><h4>1. Understanding the Template Directory</h4>
<p>Inside your forked Meshery repository, you'll find the <code>template-csvs</code> directory containing three essential CSV files:</p>
<code>
    mesheryctl/templates/template-csvs/
    <br />
    ├── Models.csv       # Define model metadata and core properties
    <br />
    ├── Components.csv   # Specify individual components and their characteristics
    <br />
    └── Relationships.csv # Define how components interact and connect
    <br />
</code>
<h4>2. Customizing Your Model</h4>
<p>Creating your model involves modifying these CSV files to match your specific requirements. When making changes, you have two valuable references at your disposal: the existing entries in the CSV files serve as practical examples, while the <a href="https://docs.google.com/spreadsheets/d/1DZHnzxYWOlJ69Oguz4LkRVTFM79kC2tuvdwizOJmeMw">integration spreadsheet</a> provides comprehensive documentation of all possible fields and their purposes.</p>
<h4>3. Generating Your Model</h4>
<p>Once you've customized your CSV files, you can generate your model using a single command. Ensure you're in the root directory of your forked Meshery repository, as this maintains the correct file path relationships:</p>
<code>mesheryctl registry generate --directory mesheryctl/templates/template-csvs --model "YOUR_MODEL_NAME"</code>
<p>The <code>--directory</code> flag takes the path to the folder that contains <code>Models.csv</code> and <code>Components.csv</code> (<code>Relationships.csv</code> is optional). This path is CSV-driven and does <strong>not</strong> require a Google Spreadsheet credential.</p>
<h4>4. Locating Generated Files</h4>
<p>After successful generation, <code>mesheryctl</code> writes your model's files to the repository's <code>models/</code> directory, or to the directory you pass with <code>-o</code>. With the default output, find them at <code>meshery/models/[YOUR_MODEL_NAME]/</code>. Take time to review these generated files to ensure they accurately reflect your intended model structure.</p>
<h4>5. Troubleshooting</h4>
<p>If you encounter issues during the generation process, you can use these diagnostic approaches to identify and resolve problems:</p>
<ul>
  <li>Examine the detailed error logs at <code>~/.meshery/logs/registry/</code> to understand specific generation issues.</li>
  <li>Review your CSV files for proper formatting, ensuring all required columns are present and correctly populated.</li>
  <li>Confirm you're executing the command from the root of your forked Meshery repository.</li>
</ul></section><input id="mesheryctl-tabs-5-3" type="radio" name="mesheryctl-tabs-5">
    <label for="mesheryctl-tabs-5-3"><i class="fa fa-table" aria-hidden="true"></i>Using Integration Spreadsheet
    </label>
    <section class="tabbed" id="mesheryctl-tabs-5-content-3"><h3>Setting Up Your Environment</h3>
<p>Before you begin working with the Integration Spreadsheet, you'll need to complete several important setup steps:</p>
<h4>1. Spreadsheet Preparation</h4>
<p>Start by creating your own copy of the Meshery Integration Sheet:</p>
<ol>
  <li>Visit the <a href="https://docs.google.com/spreadsheets/d/1DZHnzxYWOlJ69Oguz4LkRVTFM79kC2tuvdwizOJmeMw" target="_blank" rel="noopener">Meshery Integration Sheet</a></li>
  <li>Make a copy using File > Make a copy</li>
  <li>Look at the URL of your new spreadsheet and note the ID (the long string between /d/ and /edit)</li>
</ol>
<h4>2. Google Cloud Configuration</h4>
<p>Set up your Google Cloud environment with these steps:</p>
<ol>
  <li><a href="https://developers.google.com/workspace/guides/create-project" target="_blank" rel="noopener">Create a new Google Cloud Project or select an existing one</a></li>
  <li><a href="https://support.google.com/googleapi/answer/6158841" target="_blank" rel="noopener">Enable the Google Sheets API for your project</a></li>
  <li><a href="https://developers.google.com/workspace/guides/create-credentials#create_credentials_for_a_service_account" target="_blank" rel="noopener">Create service account credentials</a></li>
</ol>
<h4>3. Credential Configuration</h4>
<p>Set up your credentials in your local environment:</p>
<code>
  base64 -w 0 /path/to/your-service-account-creds.json
</code>
[For Linux users]
<br />
<code>
  base64 -b 0 -i /path/to/your-service-account-creds.json
</code>
[For MacOS users]
<br />
<code>
  echo 'export SHEET_CRED="paste-base64-output-here"' >> ~/.bashrc
</code>
<br />
<code>
  source ~/.bashrc
</code>
<p>The value passed to <code>--spreadsheet-cred</code> is the <strong>base64-encoded contents of the service-account JSON</strong> (the string itself), not a file path and not <code>GOOGLE_APPLICATION_CREDENTIALS</code>. Pass it as <code>--spreadsheet-cred "$SHEET_CRED"</code>.</p>
<div class="alert alert-warning" role="alert"><div class="h4 alert-heading" role="heading">Trap: a misleading &quot;Invalid JWT Token&quot; error</div>
<p>If <code>$SHEET_CRED</code> is empty or is not valid base64, <code>mesheryctl</code> reports <code>Invalid JWT Token</code> even though the real problem is the credential never decoded. Before running <code>registry generate</code>/<code>registry update</code>, confirm the variable is set and decodes cleanly: <code>echo &ldquo;$SHEET_CRED&rdquo; | base64 &ndash;decode | head -c 20</code> should print the start of the JSON (e.g. <code>{&ldquo;type&rdquo;: &ldquo;service_</code>).</p>
</div>
<h4>4. Spreadsheet Access Configuration</h4>
<ol>
  <li>Open your copied spreadsheet</li>
  <li>Click "Share" in the top right</li>
  <li>Add your service account email (ends with @developer.gserviceaccount.com)</li>
  <li>Grant "Editor" permissions</li>
  <li>Publish the spreadsheet:
    <ul>
      <li>File > Share > Publish to web</li>
      <li>Select "Comma-separated values (.csv)"</li>
      <li>Click "Publish"</li>
    </ul>
  </li>
</ol>
<h3>Working with the Integration Spreadsheet</h3>
<p>Once your environment is set up, you can begin working with the spreadsheet:</p>
<h4>1. Adding Your Model</h4>
<p>The integration spreadsheet contains existing model definitions that serve as practical examples. You can either create a new entry following the patterns in existing rows, or practice by generating an existing model first to understand the process. Each row represents a complete model definition, use them as reference for creating a new row.</p>
<h4>2. Generating the Model</h4>
<p>Use mesheryctl to generate your models. Make sure to run the command inside your forked <code>meshery/meshery</code> repo</p>
<code>mesheryctl registry generate --spreadsheet-id "YOUR_SPREADSHEET_ID" --spreadsheet-cred "$SHEET_CRED" --model "YOUR_MODEL_NAME"</code>
<p>The command will:</p>
<ul>
  <li>Read your spreadsheet data</li>
  <li>Validate the model definition</li>
  <li>Generate the model files</li>
  <li>For error logs, check <code>~/.meshery/logs/registry/</code></li>
</ul>
<h4>3. Verification</h4>
<p>The model will be generated in <code>meshery/models/[YOUR_MODEL_NAME]</code></p>
<div class="alert alert-info" role="alert"><div class="h4 alert-heading" role="heading">Using Meshery CLI with the Meshery Registry and Meshery Models</div>
<p>Meshery CLI has a set of commands that pertain to the lifecycle management of models:</p>
<ul>
<li><code>mesheryctl registry</code> generates models from CSV files or the integration spreadsheet.</li>
<li><code>mesheryctl model</code> lists, views, imports, exports, and deletes models in Meshery Server. <code>mesheryctl model build</code> packages a model into an OCI image locally, without Meshery Server.</li>
<li><code>mesheryctl component</code> lists, searches, and views components in Meshery Server.</li>
<li><code>mesheryctl relationship</code> manages relationships in Meshery Server.</li>
</ul>
</div></section></div></section></div>
