Commands, Context Control & Custom Prompts - samwega/obsidian-wordsmith GitHub Wiki

WordSmith Usage

WordSmith is designed for a keyboard-centric workflow. Configure your preferred hotkeys in Obsidian's settings for the commands below. In the screenshot you can see a workable suggested setup, but feel free to make it your own:

WordSmith suggested hotkeys

Commands

  1. WordSmith: Open Al Context Control Panel: no need to hotkey this, just trigger it once from the drop-down menu to add it to the Side Panel (then move it wherever)
  2. WordSmith: Transform selection/paragraph: This is your main command.
    • If you have text selected, it will be used for transformation.
    • If no text is selected, the current paragraph (where your cursor is) will be targeted.
    • Invoking this command opens the Prompt Palette, allowing you to choose from enabled default and custom prompts.
  3. WordSmith: Prompt Based Context Aware Generation at Cursor: set up your context, type a prompt, et voilà! Type [[ to include any note in your context.
  4. WordSmith Accept/Reject next suggestion: whether your next (highlighted) suggestion is red (to be removed) or green (to be added), you can accept or reject it with these commands
  5. WordSmith Accept/Reject in selection/paragraph: accept/reject the whole paragraph where the cursor currently is
  6. WordSmith: Focus previous/next suggestion: moves the cursor at the beginning of the next/previous suggestion, highlighting it (brighter, with glowing border)
  7. WordSmith: Clear all active suggestions (reject all): reject all the remaining suggestions. Note: suggestions that have already been accepted or rejected will not be undone. You can use Ctrl-Z to undo those.

Using the AI Context Control Panel

The AI Context Control Panel allows you to manage what contextual information is sent to the AI with your text.

How to Open the Panel:

  1. Plugin Enable State: Make sure the WordSmith plugin is enabled in Settings -> Community plugins. The icon and panel will only be available if the plugin is active.
  2. Command Palette: Search in the command palette (usually Ctrl/Cmd+P) for the command "WordSmith: Open AI Context Control Panel".

Once the panel is open, you can drag its icon to reorder is, or drag the panel itself to different parts of your workspace (e.e., left sidebar, right sidebar, or even as a new tab in the main workspace).

WordSmith Context Side Panel

Panel Options:

Once open, you can use the toggles for:

  • Dynamic Context: Toggle on to automatically include a configurable number of lines (paragraphs) surrounding your selection/current paragraph as context for the AI. Adjust the line count in the plugin settings (Settings → WordSmith → Dynamic context lines).
  • Entire Note as Context: Toggle on to send the entire content of the current note as context.
  • Custom Context: Toggle on and paste any specific text into the provided text area to use as context. This overrides Dynamic and Entire Note context if active.

Customizing Prompts

Tailor WordSmith to your exact needs:

  • Add Custom Prompts: In plugin settings (Settings → WordSmith → Prompt Management), click "Add Custom Prompt". Give your prompt a name and provide the instructional text for the AI.
  • Manage Prompts: Enable or disable any default or custom prompt using the toggles in the settings.
  • Edit/Delete Custom Prompts: Use the pencil and trash icons next to your custom prompts.
  • Advanced - Modify Default Prompts: If you need to alter the behavior of default prompts, you can find them in [YourVault]/.obsidian/plugins/text-transformer/data.json. Edit this file directly (be cautious!) and reload Obsidian for changes to take effect. It's often safer to create a new custom prompt based on a default one. WordSmith Custom Prompt editor