> For the complete documentation index, see [llms.txt](https://docs.cortex.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cortex.io/streamline/plugins/creating-plugins/editing-a-plugin.md).

# Editing a plugin

As your workflows evolve and you gather feedback from users, you may want to refine what a plugin does and where it shows up. Cortex lets you edit any plugin's configuration, code, and display settings after it's been registered, so you can iterate without starting over.

## Viewing the plugin in Cortex

1. From the main sidebar, select **Plugins**.
2. Locate the plugin you want to view, then click the **Overflow menu**.
3. Select **Edit plugin**.
4. In the bottom-right corner, toggle on **Dev mode**. The **Plugin preview** uses code running at `http://localhost:9000/ui.html`.
5. Click the **down arrow** next to the toggle.
6. In the command line, navigate to your scaffolded plugin directory and run `yarn dev`.
7. Review the plugin in the **Plugin preview**.

## Editing a plugin

Users with the `Edit Plugins` permission can edit plugins.

1. In your text editor, open the cloned repository for your plugin.
2. Make any necessary changes.
3. Save and run `yarn build`.
4. Optionally, run `yarn dev` to preview your changes in Cortex.
5. Upload or drop the new HTML file into the **Upload & preview plugin** grid. Cortex automatically deletes the old HTML file and replaces it with the new one.
6. Review the plugin in the **Plugin preview**.
7. Click **Save plugin**.

## Adding theme-based styling

The `react-plugin-ui` package includes CSS variables for theme-based styling. These styles adjust to match the [brand color you have configured](/configure/settings/workspace-customization.md#customize-for-your-organization) and reflect the light or dark mode settings for your Cortex workspace. The styles are injected via an iframe `postMessage` request, initiated by the Cortex `CortexApi.pluginInit()` call.

If your plugin needs additional styling beyond what's available in `react-plugin-ui`, you can use the Cortex CSS API. Refer to the documentation in the [plugin template repository](https://github.com/cortexapps/cookiecutter-cortex-plugin/blob/master/%7B%7Bcookiecutter.project_name%7D%7D/src/components/ColorSwatches.tsx).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cortex.io/streamline/plugins/creating-plugins/editing-a-plugin.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
