Skip to content

Latest commit

 

History

History
243 lines (179 loc) · 5.98 KB

README.md

File metadata and controls

243 lines (179 loc) · 5.98 KB

prompt-library-manager

📚 Prompt Library Manager

Capture, organize, and remix prompts from any AI tool — Midjourney, ComfyUI, ChatGPT, Stable Diffusion, Flux, and more.

Python FastAPI Streamlit License

The Problem

AI artists and prompt engineers accumulate hundreds of prompts across tools — scattered across Discord chat logs, text files, browser bookmarks, and memory. When you find a prompt that produces amazing results, there's no system to:

  • Save it with full context (model, parameters, tool)
  • Organize it by project, client, or style
  • Remix it for variations
  • Share it with your team
  • Never lose it again

The Solution

A self-hosted prompt library with:

  • CLI for quick capture from terminal
  • Web UI (Streamlit) for visual browsing and management
  • REST API for integration with any tool
  • SQLite storage — no cloud dependency, your data stays yours

Quick Start

# Clone
git clone https://github.com/darshd9941/prompt-library-manager.git
cd prompt-library-manager

# Install dependencies
pip install -r requirements.txt

# Start the API server
cd backend
uvicorn main:app --reload

# In another terminal — start the web UI
cd frontend
streamlit run app.py

# Or use the CLI
python cli/capture.py add
python cli/capture.py list
python cli/capture.py stats

Architecture

prompt-library-manager/
├── backend/
│   ├── main.py          # FastAPI REST API
│   ├── models.py        # SQLAlchemy ORM models
│   ├── schemas.py       # Pydantic request/response schemas
│   └── database.py      # SQLite connection
├── frontend/
│   └── app.py           # Streamlit web UI
├── cli/
│   └── capture.py       # Click CLI tool
└── requirements.txt

Features

Prompt Capture

  • Save prompts with title, content, tool, model, parameters
  • Tag with custom labels (style, mood, technique)
  • Assign to projects and clients
  • Rate prompts 0-5 stars

Organization

  • Filter by tool, project, client, tags, rating
  • Full-text search across all prompts
  • Browse with visual preview

Remixing

  • Fork any prompt and modify it
  • Track what changed between versions
  • Build prompt evolution histories

CLI Quick Capture

# Add a prompt in one command
python cli/capture.py add \
  --title "Cinematic Portrait" \
  --tool midjourney \
  --content "cinematic portrait, golden hour, shallow DOF --ar 2:3 --v 6" \
  --project "client-brand-x" \
  --tags "portrait,cinematic,warm"

# List all prompts
python cli/capture.py list --tool midjourney

# Show full details
python cli/capture.py show 1

# Quick stats
python cli/capture.py stats

REST API

# Create a prompt
curl -X POST http://localhost:8000/prompts \
  -H "Content-Type: application/json" \
  -d '{"title": "Test", "content": "test prompt", "tool": "midjourney"}'

# Search prompts
curl "http://localhost:8000/prompts?search=portrait&tool=midjourney"

# Get stats
curl http://localhost:8000/stats

API Endpoints

Method Endpoint Description
POST /prompts Create a prompt
GET /prompts List/search prompts
GET /prompts/{id} Get prompt details
PUT /prompts/{id} Update a prompt
DELETE /prompts/{id} Delete a prompt
POST /prompts/{id}/remixes Remix a prompt
GET /prompts/{id}/remixes List remixes
POST /tags Create a tag
GET /tags List all tags
GET /stats Library statistics

Supported Tools

Works with prompts from any AI tool:

  • Midjourney — /imagine prompts with parameters
  • ComfyUI — Workflow descriptions and node configs
  • ChatGPT / Claude — System prompts and conversation starters
  • Stable Diffusion — txt2img prompts with negative prompts
  • Flux — Flux-specific prompt formats
  • DALL-E — Image generation prompts
  • Custom — Any other tool

Future Plans

  • Browser extension for one-click capture from AI tool UIs
  • Import/export to JSON for backup sharing
  • Team collaboration with user auth
  • AI-powered prompt enhancement suggestions
  • Visual search using CLIP embeddings
  • Integration with ComfyUI as a custom node

Contributing

Contributions welcome! See CONTRIBUTING.md for guidelines.

License

MIT License — see LICENSE for details.

Installation

Prerequisites

  • Python 3.8 or higher
  • pip (Python package manager)

Clone the Repository

git clone https://github.com/darshd9941/prompt-library-manager.git
cd prompt-library-manager

Install Dependencies

pip install -r requirements.txt

Environment Setup

  1. Copy the example environment file:

    cp .env.example .env
  2. Edit .env and add your API keys:

    # Required for Claude vision features
    ANTHROPIC_API_KEY=your-api-key-here

Usage

Web App (if applicable)

streamlit run app.py

CLI Usage

python main.py --help

Python API

from module import MainClass

# Initialize the tool
tool = MainClass()

# Use the tool
result = tool.process("input")
print(result)

Configuration

  • .env - Environment variables (API keys, settings)
  • config.yaml - Configuration file (if applicable)

Examples

See the examples/ directory for detailed usage examples.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

See LICENSE file for details.