Skip to main content

PromptPro - A prompt versioning and management system with Python bindings

Project description

PromptPro🚀: Advanced Prompt Manage and Versioning System

Promptpro is a powerful, flexible, and developer-friendly prompt management system that transforms how you create, manage, and version AI prompts. Designed for prompt engineers, AI developers, and serious AI enthusiasts, it combines speed, security, and usability in one elegant tool.

With built-in versioning, tagging, encryption, and a sleek TUI interface, Promptpro eliminates the chaos of multi-file JSON/YAML management across projects. Reference prompts with a unique key, and every change is automatically tracked—no manual versioning required.

Under the hood, Promptpro is powered by Rust 🦀, giving you lightning-fast performance while maintaining seamless Python integration. It supports both Python and Rust out of the box, so you can use your prompts in any language, any project, anywhere.

pip install promptpro

then,

Your chaos prompt can be easily use like this (note, any project, any language):

from promptpro import PromptManager

pm = PromptManager("promptpro.vault", "")
a = pm.get_prompt("pc_operator_v2", "dev")
print(a)

That's all! You got speed and security, also fastest prompt development.

✨ Key Features

  • 🔐 Secure Vault: Optional password-encrypted vault dumps for sensitive prompt data
  • 📦 Complete Backup: Full vault export/import functionality with binary format
  • 🔄 Automatic Versioning: Every prompt change is automatically versioned
  • 🏷️ Smart Tagging: Tag versions with "dev", "stable", "release", and custom tags
  • 💻 Beautiful TUI: Intuitive terminal user interface for easy navigation
  • 📝 Rich History: Track all changes with timestamps and optional messages
  • Blazing Fast Performance: Optimized storage with efficient retrieval (powered by Rust)
  • 🛠️ Developer Friendly: Comprehensive CLI and library API

🚀 Quick Start

Installation

Python:

pip install promptpro

Rust:

cargo install promptpro

Install from source:

# Clone the repository
git clone https://github.com/lucasjinreal/promptpro
cd promptpro

./install.sh

Basic Usage

ppro is the short form of promptpro. after install.sh it will available in your path.

# Add a new prompt
echo "Write a poem about technology" | ppro add

# Add with a key
ppro add "You are a helpful AI assistant"

# Update an existing prompt
ppro update my-prompt "You are a super helpful AI assistant"

# Get the latest version
ppro get my-prompt

# Get a specific version or tag
ppro get my-prompt 2
ppro get my-prompt stable

# Tag a version
ppro tag my-prompt stable 1

# Show history
ppro history my-prompt

# Open the TUI interface
ppro tui

📦 Backup & Restore

Export Your Vault

# Export without encryption (unencrypted binary)
ppro dump prompts.vault

# Export with password encryption
ppro dump prompts.vault --password "your-secret-password"

Import Your Vault

# Import unencrypted vault
ppro resume prompts.vault

# Import encrypted vault
ppro resume prompts.vault --password "your-secret-password"

🎮 TUI Interface

Navigate your prompts with the intuitive terminal interface:

  • Arrow Keys / hjkl: Navigate between panels and items
  • ← →: Switch between the 4 columns (Keys, Versions, Content, Tags)
  • Enter / x: Apply or toggle tags on selected versions
  • e: Edit content in the current panel
  • o: Open external editor (like vim, nano)
  • q: Quit the application
  • Ctrl+S: Save when in edit mode

🔧 Advanced CLI Commands

Tag Management

# Tag a specific version
ppro tag my-prompt stable 1

# Promote a tag to the latest version
ppro promote my-prompt stable

# The 'dev' tag is automatically promoted to latest version on updates

History & Retrieval

# Show full history for a prompt
ppro history my-prompt

# Get prompt to a file
ppro get my-prompt --output my-file.txt

# Get specific version
ppro get my-prompt 3

# Get by tag
ppro get my-prompt stable

🛠️ Programmatic API Usage

ppro can be easily integrated into both Rust and Python applications.

Rust API

Add to Cargo.toml

[dependencies]
promptpro = { path = "path/to/promptpro" }  # or git source

Basic Rust API Example

High level, write a PromptManager singleton:

use anyhow::Result;
use once_cell::sync::Lazy;
use promptpro::{PromptVault, VersionSelector};
use std::sync::Arc;
use tokio::sync::RwLock;

// Our global PromptManager singleton
pub struct PromptManager {
    vault: Arc<RwLock<PromptVault>>,
}

// Static global instance
static MANAGER: Lazy<PromptManager> = Lazy::new(|| {
    let vault = PromptVault::restore_or_default("./promptpro.vault", None)
        .expect("Failed to open PromptPro default vault");
    PromptManager {
        vault: Arc::new(RwLock::new(vault)),
    }
});

impl PromptManager {
    pub fn get() -> &'static Self {
        &MANAGER
    }

    pub async fn get_prompt(&self, key: &str, selector: VersionSelector<'_>) -> Result<String> {
        let vault = self.vault.read().await;
        Ok(vault.get(key, selector)?)
    }

    pub async fn latest(&self, key: &str) -> Result<String> {
        self.get_prompt(key, VersionSelector::Latest).await
    }
}

// Use

let pm = PromptManager::get();
let prompt = pm
    .get_prompt("pc_operator_v2", VersionSelector::Tag("dev"))
    .await
    .map_err(|e| AgentBuildError::PromptError(e.to_string()))?;

Low level API:

use ppro::{PromptVault, VersionSelector};

// Open the default vault
let vault = PromptVault::open_default()?;

// Add a new prompt
vault.add("greeting", "Hello, World!")?;

// Update an existing prompt
vault.update("greeting", "Hi there!", Some("Updated greeting".to_string()))?;

// Get latest version
let content = vault.get("greeting", VersionSelector::Latest)?;

// Tag a version
vault.tag("greeting", "stable", 1)?;

// Get by tag
let stable_content = vault.get("greeting", VersionSelector::Tag("stable"))?;

// Get history
let history = vault.history("greeting")?;

Backup & Restore API (Rust)

use ppro::PromptVault;

// Dump vault to binary file (with optional encryption)
let vault = PromptVault::open_default()?;
vault.dump("backup.vault", Some("my_password"))?;

// Or without encryption
vault.dump("backup.vault", None)?;

// Restore from binary file
let restored_vault = PromptVault::restore("backup.vault", Some("my_password"))?;

Complete Rust Example Program

use ppro::{PromptVault, VersionSelector};
use anyhow::Result;

#[tokio::main]
async fn main() -> Result<()> {
    let vault = PromptVault::open_default()?;

    // Add a prompt
    vault.add("summarization", "Summarize the following text concisely...")?;
    
    // Update with improvements
    vault.update("summarization", 
        "Provide a concise summary of the following text. Focus on key points and maintain context.",
        Some("Improved summarization prompt".to_string()))?;
    
    // Tag as stable
    vault.tag("summarization", "stable", 1)?;
    
    // Get the latest version
    let latest = vault.get("summarization", VersionSelector::Latest)?;
    println!("Latest prompt: {}", latest);
    
    // Get the stable version
    let stable = vault.get("summarization", VersionSelector::Tag("stable"))?;
    println!("Stable prompt: {}", stable);
    
    // Show history
    let history = vault.history("summarization")?;
    for version in history {
        println!("Version {}: ({}) {:?}",
            version.version, 
            version.timestamp.format("%Y-%m-%d %H:%M"),
            version.tags
        );
    }

    // Backup the vault
    vault.dump("backup.vault", Some("secure_password"))?;
    println!("Vault backed up successfully!");
    
    Ok(())
}

🐍 Python Bindings

ppro also provides Python bindings built with PyO3, making it easy to integrate prompt management into Python applications.

Installation

The Python package can be built and installed using Maturin:

pip install promptpro

Or if building from source:

cd promptpro
maturin build --features python
pip install target/wheels/promptpro-*.whl

Basic Python Usage

from promptpro import PromptManager

pm = PromptManager.get_singleton("promptpro.vault", "")
a = pm.get_prompt("pc_operator_v2", "dev")
print(a)

🎯 Why Choose ppro?

For Prompt Engineers

  • Version Control: Track every iteration of your prompts
  • A/B Testing: Maintain multiple versions and compare effectiveness
  • Rollback Capability: Instantly return to previous versions
  • Tag Management: Organize prompts by stability, project, or context

For AI Developers

  • API Integration: Easy programmatic access to your prompts
  • Environment Management: Different tags for dev/staging/prod
  • Team Collaboration: Share and sync prompt collections
  • Performance: Fast retrieval and minimal overhead

For Security-Conscious Teams

  • Encryption: Optional password protection for sensitive prompts
  • Binary Format: Secure, tamper-resistant backup format
  • Local Storage: Full control over your prompt data
  • Audit Trail: Complete history with timestamps

🏷️ Tagging System

Special Tags

  • dev: Automatically points to the latest version on updates
  • stable: Manually set for production-ready versions
  • release: For major releases or milestones

Custom Tags

You can create any custom tag names to organize your prompts:

# Create custom tags
ppro tag my-prompt experimental 2
ppro tag my-prompt production-ready 3
ppro tag my-prompt "v2.0" 4

📊 Use Cases

AI Model Development

  • Track prompt evolution during model training
  • A/B test different prompt variations
  • Maintain production vs. experimental prompts

Content Generation

  • Template management for marketing campaigns
  • Document generation prompts
  • Personalized content creation

Research & Experimentation

  • Maintain experiment logs with associated prompts
  • Compare prompt effectiveness across models
  • Share prompts within research teams

🤝 Contributing

We welcome contributions! Feel free to:

  • 🐛 Report bugs and issues
  • 💡 Suggest new features
  • 🔧 Submit pull requests
  • 📖 Improve documentation

📄 License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0).

GPL-3.0 License:

  • You can freely use, study, share, and modify this software
  • You must distribute source code when sharing
  • You must license derivative works under the same terms
  • You must preserve the original copyright notice and license

For more details, see the LICENSE file.


ppro - Taking prompt management to the next level! 🚀

Made with ❤️ for the AI development community.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

promptpro-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

promptpro-0.1.1-cp312-cp312-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

promptpro-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

promptpro-0.1.1-cp311-cp311-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

promptpro-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

promptpro-0.1.1-cp310-cp310-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

promptpro-0.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

promptpro-0.1.1-cp39-cp39-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

promptpro-0.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

promptpro-0.1.1-cp38-cp38-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

Details for the file promptpro-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 429e2e8529d7c7f87e8a593de74953d6a95e47e2507a497b2c4e5a9999f767d1
MD5 3ac21e723ae35aabb02e8e97113c52d1
BLAKE2b-256 6946ca28d09a1f04cb7de4271c17f931131735a6116d6163ec1ea0e1a2c17a37

See more details on using hashes here.

File details

Details for the file promptpro-0.1.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f9f4b2e50fe380a75c35a9d732e275e882f486c0f9bce53c1c9073eab1d871d3
MD5 12dc823c8f716028c1e95050d1ddd8d2
BLAKE2b-256 920f049eb0deea70416aae5a0cd97165944a11b0470b7f5c72257205031a234d

See more details on using hashes here.

File details

Details for the file promptpro-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7f6eb600577a49752fd639fc231d01d8531088c7df6a21ce00dfbe93644252ff
MD5 7341d7cd0e9212ec7967924ba804fcb2
BLAKE2b-256 13eb72430232a19a006407955338c7b122abadfaeb8edc659c6ddaa57000790c

See more details on using hashes here.

File details

Details for the file promptpro-0.1.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 87c16d57a017d916c53e3997102e49e309a9164fc24a4cd6b9f86f2b8f3b5c39
MD5 a4369ded208566749377774d8a4a4cd4
BLAKE2b-256 a62ee0a60d1e15d4d8f70b623f83ca59dc65e2c9714a28d801590b73c1fdaf9b

See more details on using hashes here.

File details

Details for the file promptpro-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fa663ba27105e5781e4e301cae5dde46fe8b5f1874966a31931f98f7f3dfa171
MD5 7aadd4247bd3c9432c4ce6436d8d344d
BLAKE2b-256 1a36b6746fa7667b7890005b95cef5f485d726047c62553000f0abf96ffd58d9

See more details on using hashes here.

File details

Details for the file promptpro-0.1.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ec7c6a1e525aa1f415955da3a484d6bf7c617f521a57807120342a9788a422fe
MD5 869a88cd83f9279bb8924d2b72b23e12
BLAKE2b-256 ea014f11d06644b43ef299ab3aef6e2ac4177daec090c74033b8ca5212d9e5f8

See more details on using hashes here.

File details

Details for the file promptpro-0.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bd7dce4bff300261f774b02ec0a474b98994205d72533b66684f20da8e739221
MD5 b79d6de55cd51f2657b18f8afae73a4f
BLAKE2b-256 9195bc77c464419f39bfad37b814962a31d015ec11f4fc5e5a3961a42e93a069

See more details on using hashes here.

File details

Details for the file promptpro-0.1.1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5a5741cba3e8aadd74618ddfaef0aabc6cfec95949f9ddcfc257b12faef16a0c
MD5 a0081a914e0ae126b41d1ce043ebac5d
BLAKE2b-256 983f182bc7af93769fb73f69e6140b827fc3e5059b4cedce7622fdb5f295e2b8

See more details on using hashes here.

File details

Details for the file promptpro-0.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ecc2c2bf44ec134a7b0dfbba8c5592a64aa744f82becbdb77cfc8e22546c2210
MD5 9fb6095a3da0d5a9bc740b41f64e3569
BLAKE2b-256 5602a8b6266e57be17deefa95c74ac987cc0e621ae04cee409cc83431b84aa6e

See more details on using hashes here.

File details

Details for the file promptpro-0.1.1-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for promptpro-0.1.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 22cc7b7170856b45d4d81d31855fa4a9165d71ce442b1744d8ae70bb777a7d11
MD5 514f3337897419612edc14846b349e43
BLAKE2b-256 e3f8c3799d9d7c67911634bc312b3ba0d7332a853384ee8c881991f88edb2a13

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page