Crate prompthive

Crate prompthive 

Source
Expand description

PromptHive - A powerful CLI tool for managing and organizing prompt libraries

PromptHive provides a comprehensive solution for storing, organizing, and retrieving prompts for AI models. It supports features like fuzzy matching, template processing, version control integration, and team collaboration.

§Quick Start

use prompthive::{Storage, Matcher};

// Initialize storage
let storage = Storage::new()?;
storage.init()?;

// Create a prompt matcher
let prompts = storage.list_prompts()?;
let matcher = Matcher::new(vec![]); // Load actual prompts as needed

§Features

  • Storage: Persistent prompt storage with metadata
  • Matching: Fuzzy search and exact matching for prompts
  • Templates: Template processing with variable substitution
  • Compose: Chain prompts together for complex workflows
  • Registry: Share prompts via remote registries
  • TUI: Terminal user interface for interactive browsing

§Modules

  • storage: Core storage functionality for prompts and metadata
  • matching: Fuzzy matching and search capabilities
  • template: Template processing and variable substitution
  • compose: Prompt composition and chaining (feature-gated)
  • registry: Remote prompt registry integration (feature-gated)
  • tui: Terminal user interface components (feature-gated)

Re-exports§

pub use cache::DirectoryCache;
pub use cache::PromptCache;
pub use cli::Cli;
pub use cli::Commands;
pub use cli::VarsCommands;
pub use clipboard::Clipboard;
pub use commands::configuration::get_editor_command_for_file;
pub use commands::configuration::load_editor_config;
pub use commands::configuration::EditorConfig;
pub use health::ComponentHealth;
pub use health::HealthMonitor;
pub use health::HealthReport;
pub use health::HealthStatus;
pub use health::SystemMetrics;
pub use history::HistoryEntry;
pub use history::HistoryTracker;
pub use io_options::IoOptions;
pub use io_options::CommandCategory;
pub use logging::init_logging;
pub use logging::log_command_execution;
pub use logging::log_security_event;
pub use logging::log_storage_operation;
pub use logging::LogConfig;
pub use matching::MatchResult;
pub use matching::Matcher;
pub use matching::Prompt;
pub use perf_verify::PerformanceReport;
pub use perf_verify::PerformanceVerifier;
pub use signals::is_shutdown_requested;
pub use signals::request_shutdown;
pub use signals::ShutdownAware;
pub use signals::ShutdownConfig;
pub use signals::ShutdownHandler;
pub use storage::PromptMetadata;
pub use storage::Storage;
pub use security::SecurityAuditReport;
pub use security::SecurityConfig;
pub use security::SecurityIssue;
pub use security::SecurityIssueType;
pub use security::SecurityScanResult;
pub use security::SecurityScanner;
pub use security::SecuritySeverity;
pub use security::SecurityStatus;
pub use sync_manager::SyncManager;
pub use sync_manager::SyncMetadata;
pub use sync_manager::SyncRegistry;
pub use sync_manager::SyncStatus;
pub use sync_manager::SyncStatusType;
pub use telemetry::format_time_saved;
pub use telemetry::generate_contribution_graph_html;
pub use telemetry::init_telemetry;
pub use telemetry::record_command_metric;
pub use telemetry::record_performance_metric;
pub use telemetry::TelemetryCollector;
pub use template::TemplateProcessor;
pub use compose::parse_prompt_list;
pub use compose::Composer;
pub use import::ImportResult;
pub use import::Importer;
pub use registry::default_registry_url;
pub use registry::InstallResult;
pub use registry::PackagePrompt;
pub use registry::PublishRequest;
pub use registry::RegistryClient;
pub use registry::ShareResponse;
pub use registry::SuggestionResponse;
pub use registry::PublicShareRequest;
pub use registry::InviteShareRequest;

Modules§

cache
High-performance caching layer for PromptHive
clean
Text cleaning and normalization utilities
cli
Command-line interface definitions and parsing
clipboard
System clipboard integration
commands
common
compose
edit
error_help
Error helper module for user-friendly error messages
health
Health check endpoints and system monitoring for PromptHive
history
Command history tracking and management
import
io_options
logging
Structured logging configuration and utilities for PromptHive
matching
Fuzzy matching and search functionality for prompts
perf_verify
registry
registry_tui
security
Security and audit capabilities for PromptHive
signals
Signal handling and graceful shutdown for PromptHive
storage
Storage layer for prompt management
sync_manager
Bidirectional file sync manager for PromptHive
telemetry
template
Template processing and variable substitution
tui