Kagi Assistant Enhancements

Adds prompt library and code copy features to Kagi Assistant

Yazar
stanyslassz
Günlük kurulumlar
0
Toplam kurulumlar
9
Değerlendirmeler
0 0 0
Versiyon
0.3
Oluşturulma
06.01.2025
Güncellenme
06.01.2025
Size
13,8 KB
Lisans
MIT
Geçerli

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

  1. Install Tampermonkey browser extension
  2. Add the script to Tampermonkey
  3. 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.