Quick Start
Get up and running with PromptKit in minutes.
Prerequisites
Python 3.10+
PromptKit installed:
pip install promptkit-core
Create a Prompt
Create hello.yaml:
name: hello
description: A simple greeting prompt
template: |
Hello {{ name }}!
{% if context %}
I see you're interested in {{ context }}.
{% endif %}
How can I help?
input_schema:
name: str
context: "str | None"
Use in Python
from promptkit import load_prompt, run_prompt, OpenAIEngine
prompt = load_prompt("hello.yaml")
engine = OpenAIEngine(api_key="sk-...")
response = run_prompt(
prompt,
{"name": "Alice", "context": "machine learning"},
engine
)
print(response)
Use the CLI
# Run with AI
promptkit run hello.yaml --name Alice --context "machine learning"
# Render template only
promptkit render hello.yaml --name Alice
# Validate structure
promptkit lint hello.yaml
# Get info
promptkit info hello.yaml
YAML Structure
name: Unique identifierdescription: What the prompt doestemplate: Jinja2 templateinput_schema: Input types
Template Syntax
template: |
Hello {{ name }}!
{% if urgent %}
🚨 URGENT: {{ message }}
{% else %}
📝 Note: {{ message }}
{% endif %}
Input Types
input_schema:
name: str # Required string
age: int # Required integer
email: "str | None" # Optional string