Introduction
Plugins are packages that extend the functionality of CLI do Copilot. See About plugins for CLI do GitHub Copilot.
Observação
You can find help on using plugins by entering copilot plugin [SUBCOMMAND] --help in the terminal.
Plugin structure
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.
Example plugin structure
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)
Creating a plugin
-
Create a directory for your plugin.
-
Add a
plugin.jsonmanifest file to the root of the directory.Example
plugin.jsonfileJSON { "name": "my-dev-tools", "description": "React development utilities", "version": "1.2.0", "author": { "name": "Jane Doe", "email": "[email protected]" }, "license": "MIT", "keywords": ["react", "frontend"], "agents": "agents/", "skills": ["skills/", "extra-skills/"], "hooks": "hooks.json", "mcpServers": ".mcp.json" }{ "name": "my-dev-tools", "description": "React development utilities", "version": "1.2.0", "author": { "name": "Jane Doe", "email": "[email protected]" }, "license": "MIT", "keywords": ["react", "frontend"], "agents": "agents/", "skills": ["skills/", "extra-skills/"], "hooks": "hooks.json", "mcpServers": ".mcp.json" }For details of the full set of fields you can include in this file, see GitHub Copilot CLI plugin reference.
-
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.Markdown --- name: my-agent description: Helps with specific tasks tools: ["bash", "edit", "view"] --- You are a specialized assistant that...
--- 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:Markdown --- name: deploy description: Deploy the current project to... --- Instructions for the skill...
--- 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:Shell copilot plugin install ./my-plugin
copilot plugin install ./my-plugin -
Verify that the plugin loaded successfully by viewing your list of installed plugins:
Shell copilot plugin list
copilot plugin listOr you can start a new interactive session and enter:
Copilot prompt /plugin list
/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:
Copilot prompt /agent
/agentTo check that skills defined in the plugin were loaded, enter:
Copilot prompt /skills list
/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.
Importante
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:
Shell copilot plugin install ./my-plugin
copilot plugin install ./my-plugin -
After you have finished testing, you can uninstall the local version of your plugin by entering:
Shell copilot plugin uninstall NAME
copilot plugin uninstall NAMEObservação
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.
Distributing your plugin
To distribute your plugin, you can add it to a marketplace. See Creating a plugin marketplace for CLI do GitHub Copilot.