Skip to content

Text Expander (espanso)

You can pair BetterPrompt with espanso, a text expander, to trigger your favorite prompts from anywhere you type, in your email client, notes app, browser, and more.

This article explains the general pattern for using espanso snippets to call BetterPrompt and paste AI‑generated results.

How BetterPrompt + espanso works

At a high level:

  1. You define espanso snippets (short triggers like :blogwriter).
  2. When you type a snippet, espanso:
    • Sends a request to BetterPrompt (usually via a script or HTTP call).
    • Passes any needed context (e.g. selected text or predefined values).
  3. BetterPrompt runs a specific prompt and returns output.
  4. espanso inserts the result into whatever app you're currently typing in.

This gives you "AI macros" powered by your own prompts.

Wiring espanso to BetterPrompt

Follow these steps to mount a prompt into your espanso configuration.

  1. Install espanso if you haven't.
  2. Open espanso configuration
  3. Go to a text prompt that you want to mount to espanso, select "Developer Actions" then "Snippet Shortcuts"
  4. Paste the snippet into your espanso config file.

Now if you trigger the shortcut like :blogwriter it would request additional inputs that map directly to the inputs of the prompt and call BetterPrompt service. Give it a few seconds and it will paste the AI output right where you are working.

Good practices for daily use

To keep the experience smooth:

  • Start with a small set of high‑value snippets and prompts you use often.
  • Give snippet triggers mnemonic names (:reply, :summarize, :outline) so they're easy to remember.
  • Make sure prompts are fast and reliable; test them directly in BetterPrompt before wiring them into espanso.

With a few well‑chosen combinations, BetterPrompt + espanso can turn your favorite prompts into instant, everywhere‑available tools for writing, support, and day‑to‑day productivity.