Logo
Winget-Repo Documentation

🔌 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 🐳

  1. Download one of the available Winget-Repo plugins.
  2. Extract the plugin folder and copy it into the container:
    docker cp ./plugin-folder <container id>:/wingetrepo/Plugins/
  1. Restart the container:
    docker-compose restart

Note: The plugin will be lost if the container is recreated. To persist plugins, mount the Plugins directory as a volume.

Option B: Manual Installation 🐍

  1. Download one of the available Winget-Repo plugins.
  2. Extract it and place the folder inside the Plugins directory in the Winget-Repo root.
  3. 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"
  }
}