Kagi Assistant Enhancements
Kagi Assistant Enhancements
This Tampermonkey userscript adds two main quality-of-life features to the Kagi Assistant interface.
1. Code Copy Button
- Adds a copy button to the bottom-right corner of every code block
- Mirrors the functionality of the existing top-right copy button
- Makes it easier to copy code without scrolling, especially in long code blocks
- Shows a "Copied to clipboard" tooltip when used
- Automatically appears on new code blocks through DOM observation
2. Prompt Library
- Adds a "Prompts" button to the assistant interface
- Allows users to save and manage frequently used prompts
- Features:
- Save custom prompts with name and content
- Edit existing prompts
- Delete prompts
- Export prompts to JSON file
- Import prompts from JSON file
- Quick access to saved prompts
- Local storage persistence
Technical Details
- Target URL:
https://kagi.com/assistant/*
- Uses localStorage for prompt data persistence
- Implements MutationObserver for dynamic content handling
- No external dependencies required
- Clean and minimal UI matching Kagi's design
Installation
- Install Tampermonkey browser extension
- Add the script to Tampermonkey
- Visit Kagi Assistant to see the new features
The script enhances the user experience by providing quick access to frequently used prompts and making code copying more convenient, especially for mobile users or when dealing with long code blocks.