runprompt  by chr15m

Executable prompt files for GenAI workflows

Created 10 months ago
445 stars

Top 68.0% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This project provides a minimal, single-file Python script for executing .prompt files, which bundle GenAI prompt templates with metadata. It targets developers and power users seeking a dependency-free tool to streamline prompt engineering workflows, enabling quick iteration and execution of complex prompts across various LLM providers.

How It Works

The core of the project is a lightweight Python script that parses .prompt files. These files utilize Handlebars syntax for templating and include frontmatter for specifying the GenAI model, configuration, and output format. The script supports piping standard input ({{STDIN}}) and extracting structured JSON output based on Picoschema definitions, offering a straightforward way to manage and run prompts.

Quick Start & Requirements

  • Install: Download the script using curl -O https://raw.githubusercontent.com/chr15m/runprompt/main/runprompt and make it executable with chmod +x runprompt.
  • Prerequisites: API keys for supported providers (Anthropic, OpenAI, Google AI, OpenRouter) are required and should be set as environment variables (e.g., OPENAI_API_KEY).
  • Links: API key setup links are provided for OpenAI, Anthropic, Google AI, and OpenRouter.

Highlighted Details

  • Single-file, dependency-free Python implementation.
  • Dotprompt format: combines prompt template and metadata in one .prompt file.
  • Supports Handlebars templating syntax.
  • Handles {{STDIN}} for piped input and structured JSON output via Picoschema.
  • .prompt files can be made directly executable using a shebang.
  • Supports multiple GenAI providers and custom endpoints (e.g., Ollama) via environment variables or CLI flags.

Maintenance & Community

A TODO.md file is referenced for the project roadmap. No specific community channels or contributor details are mentioned in the provided README.

Licensing & Compatibility

The license type is not explicitly stated in the provided README excerpt.

Limitations & Caveats

The current implementation does not support multi-message prompts, conditional logic within templates ({{#if}}), custom helpers, model configuration parameters (like temperature), partials, or nested Picoschema structures.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
0 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.