prompt-vcs
Git-native prompt management for Python applications. Keep prompts in code or YAML, pin production versions with a lockfile, and review every change through Git. No database or hosted service is required.
Why prompt-vcs
- Code-first workflow with
p()and@prompt. - Single-file
prompts.yamlby default, with a split-file mode for larger projects. - Explicit version pinning through
.prompt_lock.json; invalid or missing locked versions fail instead of silently falling back. - CLI support for extraction, migration, version switching, history, testing, validation, A/B experiments, and export.
- Typed Python API, Jinja sandboxing, atomic state writes, and automatic cache refresh after file changes.
Install
pip install prompt-vcs
Optional dependencies:
pip install "prompt-vcs[validation]" # JSON Schema validation
pip install "prompt-vcs[analysis]" # Welch's t-test for small A/B samples
prompt-vcs requires Python 3.10 or newer.
Quick start
Initialize a project:
pvcs init
Use a prompt directly in Python:
from prompt_vcs import p
message = p("user_greeting", "Hello {name}", name="Ada")
The string in code is the development default. To manage versions in YAML, add them to prompts.yaml:
user_greeting:
description: Greeting shown to a signed-in user
versions:
v1:
template: "Hello {{ name }}"
v2:
template: "Welcome back, {{ name }}"
Pin a version and inspect the result:
pvcs switch user_greeting v2
pvcs status
pvcs diff user_greeting v1 v2
pvcs switch records the selected version in .prompt_lock.json. Commit that file with prompts.yaml so the application and its prompt versions move through Git together.
For prompts already stored in YAML, the code can omit the default string:
message = p("user_greeting", name="Ada")
Storage modes
The default single-file layout keeps the project compact:
your-project/
|-- .prompt_lock.json
|-- prompts.yaml
`-- src/
For a larger prompt collection, use pvcs init --split to store versions under prompts/<id>/<version>.yaml.
Main workflows
| Workflow | Commands |
|---|---|
| Create and inspect | init, list, status, add, delete |
| Extract or migrate | scaffold, migrate, migrate --clean |
| Control versions | switch, unlock, diff, log |
| Test outputs | test, validate |
| Run experiments | ab create, ab record, ab status, ab analyze |
| Integrate elsewhere | export --format json, openai, or langchain |
Run pvcs --help or pvcs <command> --help for all options.
Prompt tests render templates and apply deterministic assertions. Output validation supports substring, regex, length, JSON Schema, and custom rules. A/B experiments select prompt variants and store application-provided scores. These tools do not call an LLM or judge model quality on their own.
See Validation and testing for configuration examples.
Existing codebases
Preview an automatic migration before changing source files:
pvcs migrate src/ --dry-run
Then apply changes interactively or without prompts:
pvcs migrate src/
pvcs migrate src/ --yes
Use --clean to move templates into YAML and leave only prompt IDs and variables in code. Migration is implemented with LibCST so Python syntax and formatting remain structured.
Offline example
The repository includes a customer-support example covering rendering, version switching, YAML test suites, output validation, and Python tests without an API key:
python -m pip install -e ".[dev]"
powershell -ExecutionPolicy Bypass -File .\examples\customer-support-demo\run_all.ps1
See the example walkthrough for the files, commands, and expected output.
Development
python -m pip install -e ".[dev]"
npm --prefix vscode-extension ci
python scripts/verify.py --quick
Use python scripts/verify.py for the full local suite or python scripts/verify.py --release to also build and smoke-test distribution artifacts.
License
Metadata
Release files for prompt-vcs 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| prompt_vcs-0.6.1.tar.gz | 82.5 kB | With provenance | Details for prompt_vcs-0.6.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| prompt_vcs-0.6.1-py3-none-any.whl | Python 3 | none | any | Details for prompt_vcs-0.6.1-py3-none-any.whl |
Total release size: 136.1 kB
Release files / prompt_vcs-0.6.1.tar.gz
| Download URL | prompt_vcs-0.6.1.tar.gz |
|---|---|
| Size | 82.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
504abd4ecb7453dced8207574c04381acceb0d731ba9618f1075b89c14e8c8e5
|
|
BLAKE2b-256 checksum How to use checksums |
a90b190660fc55aad9075c7a6566377e1d8d4c688b6c34da700874401ea36e6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency logRelease files / prompt_vcs-0.6.1-py3-none-any.whl
| Download URL | prompt_vcs-0.6.1-py3-none-any.whl |
|---|---|
| Size | 53.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
66004c7a3533a36e55e1075716e8177d41187c3c194868cca6bcdf310f9a4dca
|
|
BLAKE2b-256 checksum How to use checksums |
0a3629710b9a86cf65f26b0afedf8e7be841608754ed751d96fb51cc536b4e2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency logSecurity for prompt-vcs 0.6.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for prompt_vcs-0.6.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.