# UI extensions as code

> Synchronize UI extensions with a remote source code repository

---

Site [llms.txt](/llms.txt)

---

Once a UI extension is linked to a repository, you can push it, preview the changes, and later refresh the extension from the repository. You can also add an extension package from one already in a repository. This requires a repository linked to Cloud Management Platform (CMP) and repository credentials on your profile so commits are attributed to you. See [Integrate a remote source code repository](/docs/cmp/configure/integrations/source-code-repository/).

## Push and refresh a UI extension

Go to **Admin** > **Manage UI Extensions**, open the extension, and select the **Repository** tab. Unlike other content types, this tab keeps the same name regardless of which provider the repository belongs to.

![Screenshot of the Repository tab for a UI extension.](/img/cmp/configure/integrations/source-code-repository/ui-extensions-as-code/ui-extension-repository-tab.png)

**Push to Remote Source** opens a form for a **Repository**, **Branch**, and **Commit Message**. If the extension has been pushed before, select **Preview** first to see what changed. After the push, the result includes a link to open a pull request.

![Screenshot of the Push to Remote Source form.](/img/cmp/configure/integrations/source-code-repository/ui-extensions-as-code/push-to-remote-source.png)

**Refresh from Remote Source** prompts for a **Repository** and **Branch**, then updates the extension in CMP based on the repository's contents. It appears once the extension has been pushed or added from a repository, and the tab also shows the repository, the remote source URL, and the last refresh time.

<div class="alert alert-info" role="alert">


An extension that came from a repository is read-only unless **Remote Content Mode** in [Miscellaneous Settings](/docs/cmp/configure/administration/system/miscellaneous-settings/) allows editing. While it is read-only, **Push to Remote Source** is disabled.
</div>


## Add an extension package from a repository

1. Go to **Admin** > **Manage UI Extensions**.
1. Select **Add**, then **Add package from Repository**.
1. Select a **Repository**, **Branch**, and **Extension JSON File**.

   ![Screenshot of the Create Extension from Repository form.](/img/cmp/configure/integrations/source-code-repository/ui-extensions-as-code/create-from-repository.png)
1. Select **Save**.
1. Select **Sync Static Assets** to copy the extension's CSS, JavaScript, and images to the web server.
1. Restart the Apache HTTP Server on each web server, and the job engine on each job engine node. A new package is not loaded until Apache restarts.

## Related

- [Integrate a remote source code repository](/docs/cmp/configure/integrations/source-code-repository/): Linking a repository and setting credentials for your commits.
- [UI extensions](/docs/cmp/developer-resources/ui-extensions/): Building an extension and the parts of the interface it can extend.
