> For the complete documentation index, see [llms.txt](https://docs.rekit.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rekit.org/plugin/plugin-development.md).

# Plugin Development

## Create a Plugin Project

## Set Test Project Root for the Plugin to Manage

## Test Plugin in Development Mode

## Test Plugin in Production Mode

## Test Plugin in Command Line Mode

Within a terminal, go to the  the project root the plugin is loaded with, you can use `rekit` command line interface to manage project elements like add/move/remove. To let `rekit` know your plugin, you need to set `REKIT_PLUGIN_DIR` environment variable before running the `rekit` command. Say that your plugin manages a new element type of `page` , you can test it with below command:

```bash
> export REKIT_PLUGIN_DIR=/my/workspace/plugin-project-root
> rekit add page my-page
```

If not set the environment variable, Rekit will not load your plugin and you will see errors like below:

![](/files/-LeW6E7vEqdLrDMJmuzM)

## Deploy Plugin to Local Registry

To use the plugin locally in other Rekit Studio instance, you need to deploy built bundle into local Rekit plugin registry. It's very simple, just run npm script `npm run deploy` , or you can run it with Rekit Studio's scripts manager:

![Deploy Plugin Using Rekit Studio](/files/-LeW8ORhZYKHldARYTsz)

To undeploy the plugin, just run the command `npm run undeploy` .

## Publish Plugin

To distribute you plugin, you need to publish to npm registry (either public or private).


---

# 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.rekit.org/plugin/plugin-development.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.
