Skip to main content
The context menu feature allows you to quickly access AI assistant actions by opening a menu on your selected text.

How to Use

Opening the Context Menu

There are two ways to access the context menu:
  1. Configure a Hotkey (Recommended):
    • Open Obsidian Settings
    • Go to Hotkeys
    • Search for “Local GPT: Show context menu”
    • Click the + icon and set your preferred hotkey (e.g., ⌘ + M or Ctrl + M)
  2. Command Palette:
    • Open the command palette (⌘/Ctrl + P)
    • Search for “Local GPT: Show context menu”

Using the Context Menu

  1. Select the text you want to process
  2. Trigger the context menu using your configured hotkey
  3. Choose an action from the menu
  4. The AI will process your selection and insert the result
Context Menu Demo

Default Actions

Local GPT comes with several built-in actions:

Continue Writing

Generates a continuation of your selected text

Summarize Text

Creates a concise summary of the selected content

Fix Spelling and Grammar

Corrects spelling and grammatical errors

Find Action Items

Extracts actionable tasks from your text

General Help

Uses your selected text as a prompt for any purpose

New System Prompt

Create custom actions tailored to your needs

Quick Access Commands

You can also assign hotkeys to individual actions for even faster access:
  1. Open Hotkeys in Obsidian Settings
  2. Search for “Local GPT”
  3. You’ll see numbered commands like “1 | Continue writing”, “2 | Summarize text”, etc.
  4. Assign hotkeys to your most-used actions
this.addCommand({
  id: "context-menu",
  name: I18n.t("commands.showContextMenu"),
  editorCallback: (editor: Editor) => {
    const contextMenu = new Menu();
    
    populateActionContextMenu(
      contextMenu,
      this.settings.actions,
      (action) => this.runAction(action, editor),
    );
    
    // Show menu at cursor position
    contextMenu.showAtPosition({
      x: fromRect.left,
      y: toRect.top + editorView.defaultLineHeight,
    });
  },
});

Tips

If no text is selected, the context menu actions will process the entire document.
Press Escape to cancel any running action.

Next Steps

Action Palette

Learn about the Action Palette for one-time actions

Enhanced Actions

Discover how to use RAG for context-aware actions

Build docs developers (and LLMs) love