Query with AI quickly from anywhere using PowerToy

Query with AI quickly from anywhere using PowerToy

I previously documented how to use KRunner to search with AI on Linux. I wanted that exact same frictionless workflow for Windows. By configuring a Windows PowerToys Command Palette AI search utilizing the WebSearchShortcut extension, you can set up custom aliases to instantly query any AI model directly from your desktop.

I specifically configure this to force these searches into specific browser profiles or incognito windows. I don’t like cluttering my primary AI account history with minor syntax checks or brief troubleshooting queries. By routing the command palette through a private window or utilizing temporary chat flags, I keep my main workspace clean while still getting instant answers.

Prerequisites and What You'll Need

Install the following utilities on your Windows machine:

Step 1: Enable Command Palette in PowerToys

  1. Open PowerToys: Launch the application from your system tray or Start menu.
  2. Navigate to Command Palette: Expand System Tools in the left sidebar and select Command Palette.
  3. Enable Module: Ensure the module is toggled On.
  4. Configure Shortcuts: Click on Settings. You can update the activation shortcut by clicking the pencil icon. The default is Win + Space, but I map mine to Alt + Space. Save your configuration.
    Enable Command Palette in PowerToys

Step 2: Configure the WebSearchShortcut Extension

  1. In the PowerToys settings menu, click on Extensions from the left pane.
  2. Search for the WebSearchShortcut extension we installed.
    WebSearchShortcut
  3. Important: Verify you are selecting WebSearchShortcut, not the built-in Windows "Web Search" plugin.
  4. Toggle it On and click it to open its specific settings.
  5. You will see default search engines already configured. You can edit these; for instance, I changed Google's alias to g and set the Alias activation to Indirect.
    websearchshortcut

Step 3: Create the Custom Shortcut Trigger

To add various AI models efficiently, we need to expose the extension's shortcut creator.

  1. Inside the WebSearchShortcut settings, find the Add Search Shortcut option and click to expand it.
  2. Set the Alias to create command.
  3. Set Alias activation to Direct.
  4. Minimize the PowerToys settings window.

Step 4: Add Your Preferred AI Models

This is the core of the setup. You will need the specific search query URL for your chosen AI, using %s as the dynamic query variable.

AI Search Query Endpoints

  • ChatGPT (Standard): https://chatgpt.com/?q=%s
  • ChatGPT (Temporary Chat): https://chatgpt.com/?q=%s&temporary-chat=true
  • Perplexity: https://www.perplexity.ai/search?q=%s
  • Claude: https://claude.ai/new?q=%s

To create the actual shortcut:

  1. Activate your command palette using Alt + Space.
  2. Type create command. The extension window will instantly pop up.
  3. Fill in the parameters. My configuration for a disposable ChatGPT session looks like this:
    Temp GPT
    • Name: Temp gpt
    • URL: https://chatgpt.com/?q=%s&temporary-chat=true
    • Suggestion Provider: None
    • Browser: Default (or specify an installed browser)
    • Browser Arguments (optional): --inprivate (for Edge) or --incognito (for Chrome/Brave)
  4. Click Save Search Shortcut.

Step 5: Assign the AI Activation Alias

  1. Maximize the PowerToys Command Palette settings window.
  2. Under the WebSearchShortcut extension, locate the Temp gpt shortcut we just created and expand it.
  3. Define an Alias to activate it (e.g., igpt).
    tempgpt setup
  4. Set the Alias activation to Indirect.

Testing the Workflow

Hit your activation keys (Alt + Space), type your alias (igpt), press the spacebar, and input your query: igpt how to reverse an array in python.

Success! The command palette will instantly launch a private browser instance and execute the query. Your main profile history remains completely untouched.

Reference: Browser Profile Flags

If you prefer to route AI searches to specific browser profiles rather than incognito mode, use the profile directory flags below in the Browser Arguments field.

Browser Incognito / Private Flag Profile Flag
Chrome --incognito --profile-directory="your profile name"
Edge --inprivate --profile-directory="your profile name"
Firefox --private-window -P "your profile name"
Brave --incognito --profile-directory="your profile name"

Conclusion: Summary & Next Steps

By leveraging PowerToys and the WebSearchShortcut extension, you've turned your Windows desktop into a high-speed AI workstation. This methodology isn't limited to AI—you can apply this to GitHub (https://github.com/search?q=%s) or StackOverflow (https://stackoverflow.com/search?q=%s) for an even more robust developer workflow.

Post a Comment

Previous Post Next Post