|
1 | 1 | --- |
2 | | -title: Command Palette Extensibility |
3 | | -description: The Command Palette provides a full extension model, allowing you to create custom experiences for the palette. Learn how to create an extension and publish it. |
4 | | -ms.date: 2/28/2025 |
| 2 | +title: How Command Palette extensions work |
| 3 | +description: Understand the Command Palette extension model, including how extensions register, communicate, and provide commands and pages. |
| 4 | +ms.date: 04/10/2026 |
5 | 5 | ms.topic: concept-article |
6 | 6 | no-loc: [PowerToys, Windows, Insider] |
7 | | -# Customer intent: As a Windows developer, I want to learn how to develop an extension for the Command Palette. |
| 7 | +# Customer intent: As a Windows developer, I want to understand how the Command Palette extension model works. |
8 | 8 | --- |
9 | 9 |
|
10 | | -# Extensibility overview |
| 10 | +# How Command Palette extensions work |
11 | 11 |
|
12 | | -The Command Palette provides a full extension model, allowing developers to create their own experiences for the palette. |
| 12 | +Command Palette extensions are standalone .NET applications that communicate with Command Palette through a WinRT API. Each extension runs in its own process and registers with Command Palette through its app manifest, making extensions isolated, secure, and easy to deploy. |
13 | 13 |
|
14 | | -The fastest way to get started writing extensions is from the Command Palette itself. Just run the "Create a new extension" command, fill out the fields to populate the template project, and you should be ready to start. |
| 14 | +This page explains the core concepts behind the extension model — how extensions are discovered, how they provide commands and pages, and what kinds of experiences you can build. |
15 | 15 |
|
16 | | -For more detailed instructions, you can follow these pages: |
| 16 | +## How Command Palette discovers installed extensions |
17 | 17 |
|
18 | | -* [Creating an extension](../command-palette/creating-an-extension.md) |
19 | | -* [Adding commands](../command-palette/adding-commands.md) |
20 | | -* [Update a list of commands](../command-palette/update-a-list-of-commands.md) |
21 | | -* [Add top-level commands to your extension](../command-palette/add-top-level-commands-to-your-extension.md) |
22 | | -* [Command results](../command-palette/command-results.md) |
23 | | -* [Display markdown content](../command-palette/using-markdown-content.md) |
24 | | -* [Get user input with forms](../command-palette/using-form-pages.md) |
25 | | -* [Adding Dock support](../command-palette/adding-dock-support.md) |
26 | | -<!-- * [Handle the search text](../command-palette/dynamic-lists.md) --> |
27 | | -<!-- * [Advanced: Adding an extension to your package](../command-palette/adding-an-extension-to-your-package.md) --> |
28 | | - |
29 | | - |
30 | | -## Extension details |
31 | | - |
32 | | -Command Palette defines a WinRT API ([Microsoft.CommandPalette.Extensions](./microsoft-commandpalette-extensions/microsoft-commandpalette-extensions.md)), which is how extensions can communicate with Command Palette. |
33 | | - |
34 | | -Command Palette will use the Package Catalog to find apps that list themselves as an `windows.appExtension` for `com.microsoft.commandpalette`. |
35 | | - |
36 | | -### Registering your extension |
37 | | - |
38 | | -Extensions can register themselves with the Command Palette using their `.appxmanifest`. As an example: |
| 18 | +Command Palette uses the Windows Package Catalog to find installed apps that declare themselves as Command Palette extensions. Extensions register through their `.appxmanifest` by declaring a `windows.appExtension` with the name `com.microsoft.commandpalette`: |
39 | 19 |
|
40 | 20 | ```xml |
41 | 21 | <Extensions> |
@@ -67,19 +47,47 @@ Extensions can register themselves with the Command Palette using their `.appxma |
67 | 47 | </Extensions> |
68 | 48 | ``` |
69 | 49 |
|
70 | | -In this manifest, we're using an out-of-process COM server to act as the communication layer between your app and Command Palette. **Don't worry about this**! The template project will take care of creating a COM server for you, starting it, and marshalling your objects to Command Palette. |
| 50 | +Extensions use an out-of-process COM server as the communication layer between your app and Command Palette. **Don't worry about the details** — the template project handles creating the COM server, starting it, and marshalling your objects to Command Palette automatically. |
| 51 | + |
| 52 | +### Important notes about the manifest |
| 53 | + |
| 54 | +- The `AppExtension` must set `Name` to `com.microsoft.commandpalette`. This is the unique identifier that Command Palette uses to discover extensions. |
| 55 | +- The `ComServer` element registers a COM class GUID that Command Palette uses to instantiate your extension. Make sure this CLSID is unique and matches across all three locations in the manifest. |
| 56 | +- The `CmdPalProvider` element in the `Properties` section specifies the CLSID of the COM class that Command Palette will instantiate. Currently, only `Commands` is supported. |
| 57 | + |
| 58 | +## The extension API |
71 | 59 |
|
72 | | -### Important notes |
| 60 | +Command Palette defines a WinRT API ([Microsoft.CommandPalette.Extensions](./microsoft-commandpalette-extensions/microsoft-commandpalette-extensions.md)) that extensions use to communicate with Command Palette. A companion toolkit library ([Microsoft.CommandPalette.Extensions.Toolkit](./microsoft-commandpalette-extensions-toolkit/microsoft-commandpalette-extensions-toolkit.md)) provides base classes and helpers that simplify common patterns. |
73 | 61 |
|
74 | | -Some notable elements about the manifest example: |
| 62 | +Every extension implements the `IExtension` interface, which provides a `GetProvider` method that returns your `ICommandProvider`. The command provider is where you define the commands and pages that your extension offers. |
75 | 63 |
|
76 | | -- The application must specify a `Extensions.uap3Extension.AppExtension` with the Name set to `com.microsoft.commandpalette`. This is the unique identifier which Command Palette uses to find it's extensions. |
77 | | -- The application must specify a `Extensions.comExtension.ComServer` to host their COM class. This allows for the OS to register that GUID as a COM class we can instantiate. |
78 | | - - Make sure that this CLSID is unique, and matches the one in your application. If you change one, you need to change all three. |
79 | | -- In the `Properties` of your `AppExtension`, you must specify a `CmdPalProvider` element. This is where you specify the CLSID of the COM class that Command Palette will instantiate to interact with your extension. |
80 | | - - Currently, only `Commands` is supported. |
| 64 | +## Commands and pages |
| 65 | + |
| 66 | +Extensions can provide several types of content: |
| 67 | + |
| 68 | +- **Top-level commands** — Commands that appear on the Command Palette home page, making them immediately accessible to users. |
| 69 | +- **Fallback commands** — Commands that are triggered when no other results match a user's query, useful for search-based or catch-all functionality. |
| 70 | +- **Context menu items** — Additional actions that appear in the right-click context menu of other commands. |
| 71 | + |
| 72 | +Each command can navigate to a **page** that displays content. Command Palette supports the following page types: |
| 73 | + |
| 74 | +| Page type | Description | |
| 75 | +| :--- | :--- | |
| 76 | +| **List pages** | Display a searchable list of selectable items. | |
| 77 | +| **Detail pages** | Show rich content with sections, tags, and links. | |
| 78 | +| **Form pages** | Present user input fields for interactive workflows. | |
| 79 | +| **Markdown pages** | Render formatted markdown content. | |
| 80 | +| **Grid pages** | Display items in a gallery or grid layout. | |
| 81 | + |
| 82 | +Extensions can also provide their own settings pages for per-extension configuration, and support pinning commands to the [Dock](dock.md). |
| 83 | + |
| 84 | +## Get started |
| 85 | + |
| 86 | +Ready to build your first extension? Head to [Getting started](creating-an-extension.md) to set up your project and create your first command. |
81 | 87 |
|
82 | 88 | ## Related content |
83 | 89 |
|
84 | | -- [PowerToys Command Palette utility](overview.md) |
| 90 | +- [Getting started](creating-an-extension.md) |
85 | 91 | - [Extension samples](samples.md) |
| 92 | +- [API reference](sdk-namespaces.md) |
| 93 | +- [PowerToys Command Palette utility](overview.md) |
0 commit comments