| title | Creating a plugin for {% data variables.copilot.copilot_cli %} | |||
|---|---|---|---|---|
| shortTitle | Plugins: Create a plugin | |||
| allowTitleToDifferFromFilename | true | |||
| intro | Create a plugin to share customizations in an easy-to-install package. | |||
| versions |
|
|||
| category |
|
|||
| contentType | how-tos | |||
| docsTeamMetrics |
|
Plugins are packages that extend the functionality of {% data variables.copilot.copilot_cli_short %}. See AUTOTITLE.
{% data reusables.copilot.copilot-cli.cli-help-note %}
A plugin consists of a directory with a specific structure. At minimum, it must contain a plugin.json manifest file at the root of the directory. It can also contain any combination of agents, skills, hooks, and MCP server configurations.
my-plugin/
├── plugin.json # Required manifest
├── agents/ # Custom agents (optional)
│ └── helper.agent.md
├── skills/ # Skills (optional)
│ └── deploy/
│ └── SKILL.md
├── hooks.json # Hook configuration (optional)
└── .mcp.json # MCP server config (optional)
-
Create a directory for your plugin.
-
Add a
plugin.jsonmanifest file to the root of the directory.Example
plugin.jsonfile{% data reusables.copilot.copilot-cli.cli-example-plugin-file %}
For details of the full set of fields you can include in this file, see AUTOTITLE.
-
Add some components to your plugin by creating the appropriate files and directories for agents, skills, hooks, and MCP server configurations.
For example:
-
Add an agent by creating a
NAME.agent.mdfile in anagentssubdirectory.--- name: my-agent description: Helps with specific tasks tools: ["bash", "edit", "view"] --- You are a specialized assistant that...
-
Add a skill by creating a
skills/NAMEsubdirectory of your plugin directory, whereNAMEis the name of your skill. Then, within this subdirectory, create aSKILL.mdfile that defines the skill.For example, to create a "deploy" skill, create
skills/deploy/SKILL.md:--- name: deploy description: Deploy the current project to... --- Instructions for the skill...
-
-
Install your plugin locally, so that you can test it as you develop it.
For example, where
./my-pluginis the path to your plugin directory, enter:copilot plugin install ./my-plugin
-
Verify that the plugin loaded successfully by viewing your list of installed plugins:
copilot plugin list
Or you can start a new interactive session and enter:
/plugin list -
Verify that the agents, skills, hooks, and MCP server configurations you defined are loaded correctly.
For example, in an interactive session, to check that custom agents defined in the plugin were loaded, enter:
/agentTo check that skills defined in the plugin were loaded, enter:
/skills list -
Use the functionality provided by your plugin's components to verify that each component works as expected.
-
Iterate on your plugin development, as required.
[!IMPORTANT] When you install a plugin its components are cached and the CLI reads from the cache for subsequent sessions. To pick up changes made to a local plugin install it again:
copilot plugin install ./my-plugin
-
After you have finished testing, you can uninstall the local version of your plugin by entering:
copilot plugin uninstall NAME
[!NOTE] To uninstall a plugin, use the name of the plugin as specified in the
namefield of the plugin'splugin.jsonmanifest file, not the path to the plugin's directory.
To distribute your plugin, you can add it to a marketplace. See AUTOTITLE.