Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tftranslate/joplin-prompt-picker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Joplin Prompt Picker

A small AutoHotkey v2 utility that turns Joplin into a keyboard-driven autotext library for AutoHotkey v2. Useful applications include the use as a convenient prompt library for LLM chats with the llama.cpp web UI or other basic chat apps.

Store youre prompts or any other autotext snippets in a top-level Joplin notebook. This utility lets you search them from any application in a popup picker, previews the selected note, and pastes the selected noted into the previously active window.

Why this exists

Nowadays there are plenty web-based and local UI's that enable you to chat with self-hosted chatbots such as llama.cpp and ollama or with public cloud-based chatbots. Some of these offer very sophisticated workspaces logic, prompt libraries and the like. Others don't. Also, the field is evolving fast and you might want to use a different UI tomorrow, requiring you to manually move your hand-crafted prompts from one app or UI to another one.

In contrast, this tool keeps the prompts in Joplin, where they are easy to organize, sync, and edit, while AutoHotkey provides fast keyboard access from anywhere in Windows into any application, any chat app or web ui that you might want to use today or tomorrow.

For example, most UI's for llama.cpp focus on RAG and provide a lot of convenient functionality. However, if you require extended chats with full context insertion or require ephemeral chats for reasons of confidentiality, the new web UI that is offered by llama.cpp's llama-server is currently the preferred option because it offers the cleneast interaction with the underlying llama.cpp server. Joplin prompt picker was created specifically to make working with the llama.cpp web UI more comfortable.

That notwithstanding, this solution will also be of use to users of AutoHotkey and/or Joplin for many other purposes.

Features

  • Search prompt notes by title and notebook path.
  • Preview the selected note before inserting it.
  • Paste into any text field with a hotkey.
  • Works with nested sub-notebooks under Prompts.
  • Uses the local Joplin Web Clipper / Data API.
  • Handles UTF-8 text correctly, including German umlauts.
  • Converts escaped JSON newlines and quotes into normal text when inserting prompts.
  • Retries transient Joplin clipper connection failures.

Requirements

Setup

  1. Install AutoHotkey v2.
  2. Open Joplin Desktop.
  3. Enable Web Clipper in Joplin.
  4. Copy the Web Clipper API token from Joplin settings.
  5. Open JoplinPromptPicker.ahk in a text editor.
  6. Replace:
this.token := "PASTE_YOUR_JOPLIN_TOKEN_HERE"

with your real token.

  1. Optionally configure the top-folder name (currently Prompts). You can choose any name you like.

  2. Create a top-level notebook named Prompts (or the name you configured in step 7).

  3. Put your reusable prompt notes inside that notebook or its sub-notebooks, one prompt or autotext segment per note.

  4. Run joplin-prompt-picker.ahk.

Usage

  • Press Ctrl+Shift+P to open the picker.
  • Type to search by note title or notebook path.
  • Press Enter to paste the selected prompt.
  • Press Ctrl+Enter to copy the selected prompt to the clipboard.
  • Press F5 to reload prompts from Joplin.
  • Press Esc to close the picker.
  • Press Shift+Esc to exit the script.

Notes

  • The script looks for Joplin's clipper service on ports 41184 to 41194.
  • Prompt bodies are loaded lazily when previewed or inserted.
  • Search currently uses title and notebook path, not full body text.
  • The picker stores prompts in Joplin, so syncing and editing can stay inside your existing Joplin workflow.

Suggested prompt organization

Example:

  • Prompts
  • Prompts / Writing
  • Prompts / Translation
  • Prompts / Coding
  • Prompts / Patent

Use one note per reusable prompt.

Known limitations

  • Windows only, because it depends on AutoHotkey.
  • No installer yet.
  • No automatic hotstring expansion yet; this is a popup picker workflow.
  • Parsing is intentionally conservative and optimized for the current Joplin API workflow.
  • Joplin should be started before stargint the .ahk script.

Roadmap ideas

  • Config file instead of editing the token in the script.
  • Custom notebook name.
  • Body-text search as an optional index mode.
  • Better packaging and installer.
  • Optional direct hotstring insertion mode.
  • Better diagnostics and logging.

License

MIT

Credits

Created by Tobias Ernst with AI assistance.

About

Use Joplin as prompt library with AutoHotkey v2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors