🔌 Winget-Repo Plugins Documentation
Overview
This document provides an overview of installing and creating plugins. Make sure to use the latest version of Winget-Repo.
Installation
Option A: Docker 🐳
- Download one of the available Winget-Repo plugins.
- Extract the plugin folder and copy it into the container:
docker cp ./plugin-folder <container id>:/wingetrepo/Plugins/
- Restart the container:
docker-compose restart
Note: The plugin will be lost if the container is recreated. To persist plugins, mount the
Pluginsdirectory as a volume.
Option B: Manual Installation 🐍
- Download one of the available Winget-Repo plugins.
- Extract it and place the folder inside the
Pluginsdirectory in the Winget-Repo root. - Restart the server.
Creating a Plugin
A plugin can contain any functionality that extends Winget-Repo. It is a standard
Python package — create a module and add an __init__.py to the root directory.
Plugin Metadata
In __init__.py, define a PLUGIN_METADATA dictionary:
PLUGIN_METADATA = {
# Required
"name": "Test Plugin",
"description": "Test",
"icon": "cpu",
"color": "rose",
"blueprint": test_bp,
"endpoint": "test_bp.index",
# Optional
"fastapi_mounts": [
("/example", test_app),
],
"fastapi_config": {
"allow_origins": ["*"],
"allow_methods": ["GET", "POST", "OPTIONS"],
"allow_headers": ["Content-Type", "Accept", "Authorization", "Cache-Control"],
},
"permissions": ["test_bp.index"],
}
Required fields: name, description, icon, color, blueprint, endpoint
Optional fields: fastapi_mounts, fastapi_config, permissions
Permissions
To restrict access to specific routes, add an empty permissions.json to the plugin's
root directory and list the Flask routes that should be secured:
["test_bp.index"]
If permissions are defined, also add a translation.json to the root directory with
the following structure:
{
"TEST_BP.INDEX": {
"TEXT": "Test text",
"SECTION": "PERMISSIONS",
"LANGUAGE": "EN"
},
"TEST_BP": {
"TEXT": "123",
"SECTION": "PERMISSIONS",
"LANGUAGE": "EN"
}
}