Skip to content

shivakharbanda/prompt-ace

Repository files navigation

PROMPT ACE

Prompt ACE is an advanced Chrome extension designed to help users efficiently manage, version, and enhance their AI prompts directly in the browser. It provides a robust suite of tools for prompt engineers, developers, writers, and anyone who regularly works with AI models.

✨ Features

  • 📝 Full Prompt Management: Create, read, update, and delete prompts with a user-friendly interface.
  • 📚 Version Control: Automatically saves a new version of a prompt whenever the content is changed, allowing you to track history and restore previous versions.
  • 🏷️ Organization: Organize prompts using domains, categories, and tags for easy filtering and retrieval.
  • 🚀 In-Page Text Enhancement: Select text on any webpage and use the "Enhance" feature to rewrite it using the Google Gemini API. You can adjust the tone, format, and length of the output.
  • ⚡ Quick Access: Use keyboard shortcuts (Ctrl+Shift+P) and right-click context menus to quickly open the extension or insert prompts.
  • 🌐 Universal Compatibility: Works with most text fields on the web, including standard inputs, textareas, and contentEditable divs (used in platforms like Gmail, ChatGPT, and Notion).
  • 🔐 Secure API Key Storage: Your Google Gemini API key is stored securely in local browser storage and is never shared.
  • 📤 Import/Export: Easily back up your prompt library to a JSON file or import prompts from a backup.

🛠️ Technology Stack

  • Manifest V3: The latest Chrome Extension platform for enhanced security and performance.
  • JavaScript (ES Modules): Modern JavaScript for a modular and maintainable codebase.
  • Google Gemini & LangChain.js: Powers the AI-driven text enhancement features.
  • Dexie.js: A powerful wrapper for IndexedDB, used for storing and managing the prompt library.
  • Fuse.js: For intelligent fuzzy search capabilities.
  • Webpack: Used to bundle LangChain dependencies for use in the browser environment.

🚀 Getting Started

Prerequisites

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd Prompt ACE-extension
  2. Install dependencies:

    npm install
  3. Build the LangChain bundle: The LangChain library needs to be bundled to work correctly in a browser extension environment.

    npm run webpack

    This command creates the src/lib/langchain.bundle.js file.

  4. Load the extension in Chrome:

    • Open Chrome and navigate to chrome://extensions.
    • Enable Developer mode using the toggle in the top-right corner.
    • Click the "Load unpacked" button.
    • Select the Prompt ACE-extension directory.
  5. Configure the API Key:

    • Once the extension is loaded, click its icon in the Chrome toolbar to open the popup.
    • Go to the "Settings" tab.
    • Enter your Google Gemini API key and click "Save & Test".

💻 Usage

  • Managing Prompts: Open the popup to view, create, edit, or delete your prompts.
  • Using a Prompt: Click the "Copy" button on a prompt to copy its content to the clipboard, or the "Insert" button to inject it directly into the active text field on the current page.
  • Enhancing Text: Select any text on a webpage, right-click, and choose "Enhance selected text" from the context menu. A modal will appear, allowing you to rewrite the text with different parameters.

🏗️ Project Architecture

The extension is built with a modular architecture to separate concerns:

  • src/background: Contains the service worker scripts that handle background tasks like context menu creation, command listeners, and core AI logic.
  • src/content: The content script that is injected into web pages to handle DOM manipulation, such as inserting prompt text and displaying the enhancement modal.
  • src/popup: The UI and logic for the main extension popup, broken down into modules for displaying prompts, handling the form, filtering, etc.
  • src/lib: Shared libraries and services, including the ai-service.js for Gemini integration and db.js/prompt-manager.js for all database operations.
  • assets: Contains icons and other static assets.

🔧 Development

  • Any changes to the LangChain dependencies in src/lib/langchain-bundle.js require a rebuild using the npm run webpack command.
  • The extension currently does not have an automated testing suite.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published