Skip to main content

Git-like version control for LLM prompts

Project description

Lineage

Git-like version control for LLM prompts.

Lineage tracks every version of your LLM prompts — commit, diff, test, and roll back from the terminal. Built for developers who treat prompts like code.

The problem

Prompts are code, but most teams treat them like scratch notes — no history, no diffs, no rollback. Lineage gives you git-style version control purpose-built for .prompt files so you can track what changed, when, and why.

Install

pip install prompt-lineage

Or install from source:

git clone https://github.com/Shr1tan/lineage.git
cd lineage
pip install -e .

Commands

promptctl init

Creates a .promptctl/ directory with a SQLite store and a prompts/ folder.

$ promptctl init
╭── promptctl init ──╮
│ Initialized promptctl in .promptctl/ │
│ Prompt files go in prompts/          │
╰────────────────────╯

promptctl commit <name> -m "message"

Reads prompts/<name>.prompt, snapshots its content, and auto-increments the version.

$ promptctl commit email-subject-line -m "initial version"
╭── promptctl commit ──╮
│ Committed email-subject-line@v1 │
│ Message: initial version        │
╰──────────────────────╯

promptctl log <name>

Shows version history as a table, most recent first.

$ promptctl log email-subject-line
┏━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┓
┃ Version ┃ Message                 ┃ Author ┃ Date                ┃
┡━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━┩
│   v2    │ added recipient context │ you    │ 2026-03-18 18:26:32 │
│   v1    │ initial version         │ you    │ 2026-03-18 18:26:20 │
└─────────┴─────────────────────────┴────────┴─────────────────────┘

promptctl diff <name>@v1 <name>@v2

Colored unified diff between any two versions.

$ promptctl diff email-subject-line@v1 email-subject-line@v2
-variables: [recipient_name, company, role]
+variables: [recipient_name, company, role, tone]

-You are a sales email assistant. Write a subject line
+You are a sales email assistant. Write a compelling subject line

promptctl checkout <name>@v<n>

Restores a specific version back to prompts/<name>.prompt.

$ promptctl checkout email-subject-line@v1
╭── promptctl checkout ──╮
│ Checked out email-subject-line@v1 → prompts/email-subject-line.prompt │
╰────────────────────────╯

promptctl status

Shows which prompts are clean, modified, or untracked.

$ promptctl status
┌─────────────────────┬─────────┬──────────────────────┬───────────┬───────────┐
│ Prompt              │ Version │ Last message         │ Committed │ Status    │
├─────────────────────┼─────────┼──────────────────────┼───────────┼───────────┤
│ email-subject-line  │ v3      │ added urgency framing│ 2h ago    │ clean     │
│ code-review         │ v1      │ initial version      │ 3d ago    │ modified  │
│ onboarding-email    │ —       │ —                    │ —         │ untracked │
└─────────────────────┴─────────┴──────────────────────┴───────────┴───────────┘

promptctl test <name>

Runs a prompt against an LLM with test cases from a .prompttest file.

$ promptctl test email-subject-line
Testing email-subject-line@v2

─── Case: basic-cold-outreach ───
Output: "Quick follow-up on API reliability at Stripe"

─── Case: enterprise-outreach ───
Output: "Exploring OpenAI API impact on your roadmap"

2 cases run.

Prompt file format

---
name: email-subject-line
description: Generates subject lines for cold outreach
variables: [recipient_name, company, role]
---

You are a sales email assistant. Write a subject line
for the following cold outreach email.

Recipient: {{recipient_name}}, {{role}} at {{company}}
Email body: {{email_body}}

Subject line only. No explanation.

YAML frontmatter defines metadata. The body below --- is the prompt template. Use {{variable}} for interpolation.

Roadmap

  • Web UI — browser-based dashboard for browsing prompt history, comparing versions, and running evals
  • Assertions — add pass/fail criteria to .prompttest files for automated scoring
  • GitHub Actions integration — CI pipeline to eval prompts on every PR and block merges on regression

Project details


Download files

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

Source Distribution

prompt_lineage-0.1.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

prompt_lineage-0.1.0-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file prompt_lineage-0.1.0.tar.gz.

File metadata

  • Download URL: prompt_lineage-0.1.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for prompt_lineage-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1b18b854f2a6d99e0ce396eb998b2df3b072fb5a10bb063f208be9876a181a28
MD5 a87e0cc463ae97b70bcf62e32e5b38f6
BLAKE2b-256 01a080e213756fd382aca9c645e0dcc9af8e0ff37de98911b0a8bbbe010ecb91

See more details on using hashes here.

File details

Details for the file prompt_lineage-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: prompt_lineage-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for prompt_lineage-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb8bc36e54801ece957d8f326a836ed7ce513f5fde6f7e938fc80d751533366a
MD5 ae4e92dbb0c7fe311087aee88b86bda8
BLAKE2b-256 e762c196417fe91a5fe65667c97353b3bad2c72f89a1dcf53aab61569a211bf2

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