{"meta":{"title":"Creating a plugin for GitHub Copilot CLI","intro":"Create a plugin to share customizations in an easy-to-install package.","product":"GitHub Copilot","breadcrumbs":[{"href":"/en/enterprise-cloud@latest/copilot","title":"GitHub Copilot"},{"href":"/en/enterprise-cloud@latest/copilot/how-tos","title":"How-tos"},{"href":"/en/enterprise-cloud@latest/copilot/how-tos/copilot-cli","title":"Copilot CLI"},{"href":"/en/enterprise-cloud@latest/copilot/how-tos/copilot-cli/customize-copilot","title":"Customize Copilot CLI"},{"href":"/en/enterprise-cloud@latest/copilot/how-tos/copilot-cli/customize-copilot/plugins-creating","title":"Plugins: Create a plugin"}],"documentType":"article"},"body":"# Creating a plugin for GitHub Copilot CLI\n\nCreate a plugin to share customizations in an easy-to-install package.\n\n## Introduction\n\nPlugins are packages that extend the functionality of Copilot CLI. See [About GitHub Copilot plugins](/en/enterprise-cloud@latest/copilot/concepts/agents/about-plugins).\n\n> \\[!NOTE]\n> You can find help on using plugins by entering `copilot plugin [SUBCOMMAND] --help` in the terminal.\n\n## Plugin structure\n\nA 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.\n\n### Example plugin structure\n\n```text\nmy-plugin/\n├── plugin.json           # Required manifest\n├── agents/               # Custom agents (optional)\n│   └── helper.agent.md\n├── skills/               # Skills (optional)\n│   └── deploy/\n│       └── SKILL.md\n├── hooks.json            # Hook configuration (optional)\n└── .mcp.json             # MCP server config (optional)\n```\n\n## Creating a plugin\n\n1. Create a directory for your plugin.\n\n2. Add a `plugin.json` manifest file to the root of the directory.\n\n   **Example `plugin.json` file**\n\n   ```json copy\n   {\n     \"name\": \"my-dev-tools\",\n     \"description\": \"React development utilities\",\n     \"version\": \"1.2.0\",\n     \"author\": {\n       \"name\": \"Jane Doe\",\n       \"email\": \"jane@example.com\"\n     },\n     \"license\": \"MIT\",\n     \"keywords\": [\"react\", \"frontend\"],\n     \"agents\": \"agents/\",\n     \"skills\": [\"skills/\", \"extra-skills/\"],\n     \"hooks\": \"hooks.json\",\n     \"mcpServers\": \".mcp.json\"\n   }\n   ```\n\n   For details of the full set of fields you can include in this file, see [GitHub Copilot CLI plugin reference](/en/enterprise-cloud@latest/copilot/reference/copilot-cli-reference/cli-plugin-reference#pluginjson).\n\n3. Add some components to your plugin by creating the appropriate files and directories for agents, skills, hooks, and MCP server configurations.\n\n   For example:\n\n   1. Add an agent by creating a `NAME.agent.md` file in an `agents` subdirectory.\n\n      ```markdown copy\n      ---\n      name: my-agent\n      description: Helps with specific tasks\n      tools: [\"bash\", \"edit\", \"view\"]\n      ---\n\n      You are a specialized assistant that...\n      ```\n\n   2. Add a skill by creating a `skills/NAME` subdirectory of your plugin directory, where `NAME` is the name of your skill. Then, within this subdirectory, create a `SKILL.md` file that defines the skill.\n\n      For example, to create a \"deploy\" skill, create `skills/deploy/SKILL.md`:\n\n      ```markdown copy\n      ---\n      name: deploy\n      description: Deploy the current project to...\n      ---\n\n      Instructions for the skill...\n      ```\n\n4. Install your plugin locally, so that you can test it as you develop it.\n\n   For example, where `./my-plugin` is the path to your plugin directory, enter:\n\n   ```shell copy\n   copilot plugin install ./my-plugin\n   ```\n\n5. Verify that the plugin loaded successfully by viewing your list of installed plugins:\n\n   ```shell copy\n   copilot plugin list\n   ```\n\n   Or you can start a new interactive session and enter:\n\n   ```copilot copy\n   /plugin list\n   ```\n\n6. Verify that the agents, skills, hooks, and MCP server configurations you defined are loaded correctly.\n\n   For example, in an interactive session, to check that custom agents defined in the plugin were loaded, enter:\n\n   ```copilot copy\n   /agent\n   ```\n\n   To check that skills defined in the plugin were loaded, enter:\n\n   ```copilot copy\n   /skills list\n   ```\n\n7. Use the functionality provided by your plugin's components to verify that each component works as expected.\n\n8. Iterate on your plugin development, as required.\n\n   > \\[!IMPORTANT]\n   > 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:\n   >\n   > ```shell copy\n   > copilot plugin install ./my-plugin\n   > ```\n\n9. After you have finished testing, you can uninstall the local version of your plugin by entering:\n\n   ```shell copy\n   copilot plugin uninstall NAME\n   ```\n\n   > \\[!NOTE]\n   > To uninstall a plugin, use the name of the plugin as specified in the `name` field of the plugin's `plugin.json` manifest file, not the path to the plugin's directory.\n\n## Distributing your plugin\n\nTo distribute your plugin, you can add it to a marketplace. See [Creating a plugin marketplace for GitHub Copilot CLI](/en/enterprise-cloud@latest/copilot/how-tos/copilot-cli/customize-copilot/plugins-marketplace).\n\n## Further reading\n\n* [Finding and installing plugins for GitHub Copilot CLI](/en/enterprise-cloud@latest/copilot/how-tos/copilot-cli/customize-copilot/plugins-finding-installing)\n* [GitHub Copilot CLI plugin reference](/en/enterprise-cloud@latest/copilot/reference/copilot-cli-reference/cli-plugin-reference)"}