JPSoftworks.CommandPalette.Extensions.Toolkit 0.3.0-preview.4

This is a prerelease version of JPSoftworks.CommandPalette.Extensions.Toolkit.
There is a newer version of this package available.
See the version list below for details.
dotnet add package JPSoftworks.CommandPalette.Extensions.Toolkit --version 0.3.0-preview.4
                    
NuGet\Install-Package JPSoftworks.CommandPalette.Extensions.Toolkit -Version 0.3.0-preview.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JPSoftworks.CommandPalette.Extensions.Toolkit" Version="0.3.0-preview.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JPSoftworks.CommandPalette.Extensions.Toolkit" Version="0.3.0-preview.4" />
                    
Directory.Packages.props
<PackageReference Include="JPSoftworks.CommandPalette.Extensions.Toolkit" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add JPSoftworks.CommandPalette.Extensions.Toolkit --version 0.3.0-preview.4
                    
#r "nuget: JPSoftworks.CommandPalette.Extensions.Toolkit, 0.3.0-preview.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package JPSoftworks.CommandPalette.Extensions.Toolkit@0.3.0-preview.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=JPSoftworks.CommandPalette.Extensions.Toolkit&version=0.3.0-preview.4&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=JPSoftworks.CommandPalette.Extensions.Toolkit&version=0.3.0-preview.4&prerelease
                    
Install as a Cake Tool

<div align="center">

<p> <img src="art/StoreLogo.png" alt="Logo"> </p>

<h1 align="center"><span style="font-weight: bold">Extension Toolkit</span> <br /><span style="font-weight: 300; opacity: 0.5">for Command Palette</span></h1>

</div>

A set of extensions and utilities for building Command Palette extensions, extending the Microsoft.CommandPalette.Extensions NuGet package with an opinionated feature set.

The implementation may change in the future. As Command Palette evolves, so will this toolkit. Use at your own risk.

Installation

NuGet Version NuGet Version

JPSoftworks.CommandPalette.Extensions.Toolkit at Nuget.org.

Features

Extension Host Runner

ExtensionHostRunner simplifies creating and running Command Palette extensions.

It provides:

  • A message loop that handles OS messages and shutdown requests—helping prevent hangs where the OS might otherwise treat the extension as unresponsive and terminate it.
  • Optional Efficiency Mode to reduce CPU usage when the extension is idle.
    • Lowers process priority and attempts to enable Windows Efficiency Mode (EcoQoS).
  • A simple logger that writes to a custom log file and to the extension host log.
    • See the Logger class.
  • Debug-level logging that can be enabled manually or via a command-line argument.
    • The -Debug argument enables debug-level logging at runtime.
  • Graceful fallback when started without arguments:
    • Either opens Command Palette or prompts the user to install PowerToys.
    • Useful for passing Microsoft Store certification.
    • See the StartupHelper class.
  • Overrides the process shutdown priority to ensure the extension host process is not terminated while the extension is still running.
    • See the ShutdownHelper class.

Usage:

 [MTAThread]
 public static async Task Main(string[] args)
 {
     await ExtensionHostRunner.RunAsync(
         args,
         new ExtensionHostRunnerParameters
         {
             PublisherMoniker = "MyCompany",
             ProductMoniker = "MyExtension",
             IsDebug = false,                        // default is false
             EnableEfficiencyMode = true,            // default is true
             ExtensionFactories = [
                 new DelegateExtensionFactory(manualResetEvent => new MyExtension(manualResetEvent))
             ]
         });
 }

Logger

Logger is a simple logging utility that writes messages to a custom log file and to the extension host log. It supports different log levels and can be used to log debug, info, warning, and error messages.

Debug-level logging can be enabled by passing the -Debug argument to the process or manually by settings IsDebug property of ExtensionHostRunnerParameters.

Usage:

Logger.LogDebug("This is a debug message.");
Logger.LogInformation("This is an info message.");
Logger.LogWarning("This is a warning message.");
Logger.LogError("This is an error message.");

StartupHelper

StartupHelper provides a user interface when the extension is launched without arguments—for example, when the user clicks the extension icon in the Start menu or taskbar. It can be used to open Command Palette or prompt the user to install PowerToys.

ShutdownHelper

ShutdownHelper adjusts the extension process’s shutdown priority relative to the extension host. This ensures the operating system does not terminate the extension process while the host is still running.

AppLifeMonitor

AppLifeMonitor monitors the application’s lifetime and signals when the operating system attempts to close it.

EfficiencyModeHelper

EfficiencyModeHelper enables Windows Efficiency Mode (EcoQoS) for the extension process, reducing CPU usage when the extension is idle. It can also lower process priority and enable EcoQoS.

License

Apache 2.0

Author

Jiří Polášek

Product Compatible and additional computed target framework versions.
.NET net9.0-windows10.0.22621 is compatible.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.5.0 51 9/5/2025
0.3.0-preview.5 118 8/19/2025
0.3.0-preview.4 108 8/19/2025
0.3.0-preview.3 67 7/27/2025
0.3.0-preview.2 213 7/26/2025
0.3.0-preview.1 230 7/26/2025
0.0.2 146 5/11/2025
0.0.1 133 5/11/2025