Edit text anywhere with AI!
Knowbridge is a KDE Plasma 6 tool that lets you leverage Large Language Models (LLMs) to edit text directly within any application. Simply select text, press a global keyboard shortcut, choose an action (like "Fix Grammar" or your own custom prompts) from a pop-up menu, and Knowbridge modifies the text in-place or copies the result to your clipboard.
- 🌐 Global Shortcut: Trigger Knowbridge from any application using a configurable key combination.
- ✍️ In-Place Editing: Uses Accessibility Technology (AT-SPI) to retrieve selected text and replace it directly in most compatible applications.
- 🖱️ Action Menu: A convenient pop-up menu appears near your cursor, listing predefined and customizable actions (prompts).
- ⚙️ GUI Configuration: Easily configure API endpoint, model name, API key, system prompt, and manage custom actions through a user-friendly settings dialog.
- 🔌 Flexible AI Backend: Designed to work with any OpenAI-compatible API. Use commercial services or local LLMs via tools like Ollama, llama.cpp, Jan, LM Studio, etc.
- 📋 Clipboard Fallback: Automatically copies the AI-generated result to your clipboard if in-place editing fails or isn't supported by the current application.
- 💙 KDE Plasma Integration: Built natively with Qt 6 and KDE Frameworks 6. Includes a system tray icon and allows shortcut configuration via KDE System Settings.
- 🔔 Notifications: Provides feedback on processing status (running, success, copied, error).
- Operating System: Linux distribution running KDE Plasma 6.
- Accessibility: A running AT-SPI D-Bus service (
at-spi2-core). This is usually enabled by default on modern Linux desktops. - API Access: An accessible OpenAI-compatible API endpoint URL (e.g.,
http://localhost:11434/v1for Ollama) and, if required by the endpoint, an API key.
- Ensure you have
dockeranddocker-composeinstalled. - Clone the repository:
git clone https://github.com/OPHoperHPO/knowbridge.git # Replace with your actual repo URL cd knowbridge
- Build and run the container detached:
docker compose up -d --build
- After the build completes, binaries will be available in the
./distdirectory. You can run the application from there:./dist/bin/knowbridge
To install the application, copy the contents of the
./distdirectory to your desired installation location (e.g.,~/.local/or/usr/).
If you got libraries errors, you need to install the required runtime libraries on your system.
-
Install Build Dependencies:
- Core Build Tools:
cmake(>= 3.16), C++17 compliant compiler (likegccorclang),pkg-config,git - Qt 6:
qt6-base,qt6-tools(Development packages, version >= 6.6) - KDE Frameworks 6:
extra-cmake-modules,kcoreaddons,kglobalaccel,ki18n,kxmlgui,knotifications,kconfig,kconfigwidgets,kwidgetsaddons(Development packages, version >= 6.0) - Accessibility:
at-spi2-core,atk,glib2(Development packages)
Package names vary by distribution. You typically need the
-devel(Fedora/openSUSE) or-dev(Debian/Ubuntu) versions.Example (Arch Linux):
sudo pacman -S --needed base-devel cmake extra-cmake-modules qt6-base qt6-tools kcoreaddons kglobalaccel ki18n kxmlgui knotifications kconfig kconfigwidgets kwidgetsaddons at-spi2-core atk glib2 git
- Core Build Tools:
-
Clone the Repository:
git clone https://your-repo-url/knowbridge.git # Replace with your actual repo URL cd knowbridge
-
Configure and Build:
cmake -B build -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release cmake --build build
-
Install:
sudo cmake --install build
-
(Optional) Update System Databases: After installation, sometimes required for icons, shortcuts, etc., to appear immediately.
kbuildsycoca6 --noincremental update-mime-database /usr/share/mime
Knowbridge needs to know how to connect to your LLM API endpoint.
- Start Knowbridge: Launch it from your application menu or run
knowbridgein the terminal. A tray icon should appear. - Open Settings: Right-click the System Tray Icon and select "Settings…".
- General Tab:
- API Endpoint URL: The full URL to your OpenAI-compatible API (e.g.,
https://api.openai.com/v1orhttp://localhost:11434/v1). - API Key: Your API key (if required by the endpoint). Leave blank if not needed.
- Model: The name of the model to use (e.g.,
gpt-4o,llama3). - System Prompt: (Optional) A default instruction given to the AI for context.
- Notifications: Configure if you don't want to see notifications.
- API Endpoint URL: The full URL to your OpenAI-compatible API (e.g.,
- Actions Tab:
- Add, edit, remove, and reorder the custom actions/prompts that appear in the pop-up menu. Each action needs a Name (shown in menu) and a Prompt.
- General Tab:
- Set Global Shortcut:
- Go to KDE System Settings -> Keyboard -> Shortcuts -> Knowbridge.
- Find the Knowbridge entry.
- Select the "Modify Text (AI)" action.
- Click the button to assign your preferred shortcut (Default suggested:
Meta+Ctrl+SpaceorCtrl+Alt+Space).
- Run Knowbridge: Make sure Knowbridge is running (check for the system tray icon).
- Select Text: Highlight the text you want to modify in any application.
- Press Shortcut: Trigger the global shortcut you configured.
- Choose Action: The Knowbridge Action Menu will pop up near your cursor. Click the desired action (e.g., "Fix Grammar", "Summarize", "Translate to French").
- Wait for Result: You'll see a notification indicating progress.
- ✅ Success: The selected text is automatically replaced with the AI's response.
- 📋 Result Copied: In-place editing failed (e.g., unsupported application). The AI's response has been copied to your clipboard. Paste it manually (
Ctrl+V). - ❌ Error: An error occurred (e.g., API connection issue, invalid key). Check the notification details and your settings.
- If text starts duplicating after modifying actions in the settings, you may need to restart the application.
- If you receive an error message that requires authorization, it means your API key is missing or incorrect. Please set a valid API key in the settings.
- Improve AT-SPI compatibility, especially under Wayland and with GTK applications.
- Advanced context integration (e.g., using
at-spi2to get context of the all visble text in window. - Enhance User Experience (e.g., clearer progress indication during API calls, more informative error messages).
- Add advanced features to custom actions (e.g., placeholders beyond
{selected_text}, import/export actions, custom action model provider / system prompt and etc). - Add structured output support.
- Improve code quality, add unit/integration tests.
- Explore packaging options (AUR, Flathub, distribution repositories).
Contributions are welcome! Please feel free to submit Issues and Pull Requests. If you plan to add a major feature, please open an issue first to discuss the approach.
This project is licensed under the GPLv3.0. See the LICENSE file for details.


