Skip to main content

PowerToys Run Plugins

PowerToys Run is a quick launcher that allows users to search for applications, files, and perform various actions. The plugin system enables developers to extend PowerToys Run with custom functionality.

Plugin Architecture

PowerToys Run plugins are C# class libraries that implement the IPlugin interface from the Wox.Plugin namespace. Each plugin is loaded dynamically by PowerToys Run and can respond to user queries.

Core Interfaces

IPlugin Interface

Every plugin must implement the IPlugin interface:
src/modules/launcher/Wox.Plugin/IPlugin.cs

Optional Interfaces

Plugins can implement additional interfaces for extended functionality:
  • IPluginI18n - Localization support
  • IContextMenu - Right-click context menu
  • ISettingProvider - Settings UI
  • IDelayedExecutionPlugin - Async query processing
  • IResultUpdated - Dynamic result updates

Creating Your First Plugin

Step 1: Create the Project

Create a new C# class library project:
Naming Convention:
  • Microsoft plugins: Microsoft.PowerToys.Run.Plugin.{PluginName}
  • Community plugins: Community.PowerToys.Run.Plugin.{PluginName}

Step 2: Implement the Plugin

Create a Main.cs file:

Step 3: Create plugin.json

Create a plugin.json file in your project root:
plugin.json Fields:
Make sure the ID in plugin.json matches the PluginID property in your Main class.

Plugin API Reference

Query Object

The Query object contains information about the user’s search:
src/modules/launcher/Wox.Plugin/Query.cs

Result Object

The Result object represents a single result item:
src/modules/launcher/Wox.Plugin/Result.cs

PluginInitContext

Provided during plugin initialization:
src/modules/launcher/Wox.Plugin/PluginInitContext.cs

IPublicAPI Interface

Provides access to PowerToys Run functionality:
src/modules/launcher/Wox.Plugin/IPublicAPI.cs

Real-World Example: Unit Converter Plugin

Here’s a simplified version of the actual Unit Converter plugin from PowerToys:
src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.UnitConverter/Main.cs
Key features demonstrated:
  • Custom query parsing with InputInterpreter
  • Business logic in separate UnitHandler class
  • Context menu with copy action
  • Theme-aware icons
  • Proper disposal pattern

Adding Context Menus

Implement IContextMenu to add right-click actions:
Example context menu implementation:

Testing Your Plugin

Local Testing

  1. Build your plugin:
  2. Copy plugin files to PowerToys plugins folder:
  3. Required files:
    • {YourPluginName}.dll
    • plugin.json
    • Icon files (light and dark)
    • Any dependencies
  4. Restart PowerToys Run:
    • Open PowerToys settings
    • Go to PowerToys Run
    • Toggle it off and on

Unit Testing

Create unit tests using MSTest:

Plugin Checklist

Before submitting your plugin, ensure:
  • Project follows naming pattern: {Type}.PowerToys.Run.Plugin.{PluginName}
  • Target framework is net9.0-windows10.0.22621.0
  • plugin.json file is present and valid
  • Plugin ID in code matches plugin.json
  • Both light and dark theme icons are included
  • Unit tests are written using MSTest
  • Plugin handles empty/invalid queries gracefully
  • Action returns true (close) or false (keep open) appropriately
  • Theme change events are handled
  • Resources are properly disposed (implement IDisposable if needed)

Distribution

Contributing to PowerToys

To include your plugin in PowerToys:
  1. Add plugin to installer (installer/PowerToysSetup/Product.wxs)
  2. Add to signed build pipeline (.pipelines/pipeline.user.windows.yml)
  3. Create unit tests
  4. Follow localization process
  5. Submit pull request
See the Plugin Checklist for full details.

Independent Distribution

You can distribute plugins independently:
  1. Build your plugin
  2. Package DLL, plugin.json, and icons
  3. Provide installation instructions for users
  4. Users copy files to: %LOCALAPPDATA%\Microsoft\PowerToys\PowerToys Run\Plugins\{YourPluginName}\
Plugins run with full user privileges. Only install plugins from trusted sources.

Additional Resources