DEVELOPER DOCUMENTATION / v0.8.0

API & CLI reference.

Explore the Core Python interface, data models, typed plugin contracts and command-line options. Each entry includes a source link or an example. This reference describes the v0.8.0 release, not unreleased main-branch changes.

Getting started

Install the released Core, then explore the Python API, command line and optional providers.

Installation

Core 0.8.0 requires Python 3.10+ and has no mandatory third-party runtime dependencies. Run these commands in a new project directory.

For detailed walkthroughs: User guide ↗ · Dashboard guide ↗

EXAMPLE / SIGNATURE
python -m pip install promptledger==0.8.0
promptledger init
promptledger dashboard

Python quickstart

Create an isolated workspace and store two versions. Subsequent Python examples assume this ledger and prompt ID exist.

EXAMPLE / SIGNATURE
from promptledger import PromptLedger

ledger = PromptLedger(db_path="example.db")
ledger.init()
ledger.add("greeting", "Say hello.")
ledger.add("greeting", "Say hello politely.")
print(ledger.diff("greeting", 1, 2))

Core API

Python API · from promptledger import PromptLedger. Examples use the initialized ledger from Getting started; label and evaluation examples assume their prerequisite records exist.

PromptLedger.constructor

View source ↗

Construct a ledger. Pass a project root or an explicit SQLite database path; the constructor does not initialize the database.

EXAMPLE / SIGNATURE
PromptLedger(root: str | Path | None=None, db_path: str | Path | None=None) -> None
EXAMPLE / SIGNATURE
ledger = PromptLedger(db_path="example.db")

PromptLedger.db_path

View source ↗

Read-only property: path to the configured SQLite database.

EXAMPLE / SIGNATURE
PromptLedger.db_path: Path
EXAMPLE / SIGNATURE
print(ledger.db_path)

PromptLedger.init

View source ↗

Initialize the database and required directory. Default Git-aware storage may update .gitignore. Returns the database path.

EXAMPLE / SIGNATURE
PromptLedger.init() -> Path
EXAMPLE / SIGNATURE
ledger.init()

PromptLedger.add

View source ↗

Append a prompt version with metadata. Newlines are normalized and content is hashed; identical latest content is a no-op. Returns created, prompt_id, version and content_hash. expected_base_version rejects stale edits. Secret detection is a warning, not a guarantee.

EXAMPLE / SIGNATURE
PromptLedger.add(prompt_id: str, content: str, reason: str | None=None, author: str | None=None, tags: list[str] | None=None, env: str | None=None, collection: str | None=None, role: str | None=None, metrics: dict[str, Any] | None=None, warn_on_secrets: bool=True, *, expected_base_version: int | None=None) -> dict[str, Any]
EXAMPLE / SIGNATURE
ledger.add("greeting", "Say hello in one sentence.", reason="Be concise", expected_base_version=2)

PromptLedger.get

View source ↗

Retrieve a concrete version or the latest when version is omitted. Returns None if not found.

EXAMPLE / SIGNATURE
PromptLedger.get(prompt_id: str, version: int | None=None) -> PromptRecord | None
EXAMPLE / SIGNATURE
ledger.get("greeting", 1)

PromptLedger.list

View source ↗

List saved prompt versions, optionally filtering by ID, tags (any match), environment, collection and role. Returns PromptRecord objects.

EXAMPLE / SIGNATURE
PromptLedger.list(prompt_id: str | None=None, tags: Iterable[str] | None=None, env: str | None=None, collection: str | None=None, role: str | None=None) -> list[PromptRecord]
EXAMPLE / SIGNATURE
ledger.list(prompt_id="greeting")

PromptLedger.search

View source ↗

Search prompt content with optional ID, author, tag, environment, collection and role filters.

EXAMPLE / SIGNATURE
PromptLedger.search(contains: str, prompt_id: str | None=None, author: str | None=None, tag: str | None=None, env: str | None=None, collection: str | None=None, role: str | None=None) -> list[PromptRecord]
EXAMPLE / SIGNATURE
ledger.search("hello", prompt_id="greeting")

PromptLedger.status

View source ↗

Return per-prompt status information including latest version and label state.

EXAMPLE / SIGNATURE
PromptLedger.status(prompt_id: str | None=None) -> dict[str, dict[str, Any]]
EXAMPLE / SIGNATURE
ledger.status("greeting")

PromptLedger.export

View source ↗

Export prompt history as JSONL or CSV and return the output path.

EXAMPLE / SIGNATURE
PromptLedger.export(format: str, out_path: str | Path) -> Path
EXAMPLE / SIGNATURE
ledger.export("jsonl", "prompts.jsonl")

Diffs and reviews

Python API · from promptledger import PromptLedger. Examples use the initialized ledger from Getting started; label and evaluation examples assume their prerequisite records exist.

PromptLedger.resolve_ref

View source ↗

Resolve a numeric version or label to a ReviewRef with the concrete version and reference kind.

EXAMPLE / SIGNATURE
PromptLedger.resolve_ref(prompt_id: str, ref: int | str) -> ReviewRef
EXAMPLE / SIGNATURE
ledger.resolve_ref("greeting", "prod")

PromptLedger.diff

View source ↗

Compare two concrete versions. Supports unified, context, ndiff and metadata modes; include_metadata includes metadata changes.

EXAMPLE / SIGNATURE
PromptLedger.diff(prompt_id: str, from_version: int, to_version: int, mode: str='unified', include_metadata: bool=False) -> str
EXAMPLE / SIGNATURE
print(ledger.diff("greeting", 1, 2))

PromptLedger.diff_labels

View source ↗

Resolve two labels and return a diff between their versions. Both labels must exist.

EXAMPLE / SIGNATURE
PromptLedger.diff_labels(prompt_id: str, from_label: str, to_label: str, mode: str='unified', include_metadata: bool=False) -> str
EXAMPLE / SIGNATURE
ledger.diff_labels("greeting", "prod", "staging")

PromptLedger.diff_any

View source ↗

Compare two references, each a version number or label.

EXAMPLE / SIGNATURE
PromptLedger.diff_any(prompt_id: str, from_ref: int | str, to_ref: int | str, mode: str='unified', include_metadata: bool=False) -> str
EXAMPLE / SIGNATURE
ledger.diff_any("greeting", 1, "staging")

PromptLedger.review

View source ↗

Create a rule-based review of two references: text change, heuristic semantic summary, metadata, warnings and notes. No model is called.

EXAMPLE / SIGNATURE
PromptLedger.review(prompt_id: str, from_ref: int | str, to_ref: int | str) -> ReviewResult
EXAMPLE / SIGNATURE
ledger.review("greeting", 1, 2).to_dict()

PromptLedger.export_review_markdown

View source ↗

Return the review as Markdown text; does not write a file itself.

EXAMPLE / SIGNATURE
PromptLedger.export_review_markdown(prompt_id: str, from_ref: int | str, to_ref: int | str) -> str
EXAMPLE / SIGNATURE
print(ledger.export_review_markdown("greeting", 1, 2))

Labels and markers

Python API · from promptledger import PromptLedger. Examples use the initialized ledger from Getting started; label and evaluation examples assume their prerequisite records exist.

PromptLedger.set_label

View source ↗

Create or move a named release pointer and record its history. This API is explicitly unguarded; it does not deploy or enforce a gate.

EXAMPLE / SIGNATURE
PromptLedger.set_label(prompt_id: str, version: int, label: str) -> None
EXAMPLE / SIGNATURE
ledger.set_label("greeting", 1, "prod")
ledger.set_label("greeting", 2, "staging")

PromptLedger.get_label

View source ↗

Resolve a label to its version; an unknown label raises an error.

EXAMPLE / SIGNATURE
PromptLedger.get_label(prompt_id: str, label: str) -> int
EXAMPLE / SIGNATURE
ledger.get_label("greeting", "prod")

PromptLedger.list_labels

View source ↗

List current label assignments, optionally for a single prompt.

EXAMPLE / SIGNATURE
PromptLedger.list_labels(prompt_id: str | None=None) -> list[dict[str, Any]]
EXAMPLE / SIGNATURE
ledger.list_labels("greeting")

PromptLedger.list_label_events

View source ↗

List recorded label changes, optionally filtered by prompt and label. limit defaults to 200.

EXAMPLE / SIGNATURE
PromptLedger.list_label_events(prompt_id: str | None=None, label: str | None=None, limit: int=200) -> list[dict[str, Any]]
EXAMPLE / SIGNATURE
ledger.list_label_events("greeting", "prod")

PromptLedger.set_marker

View source ↗

Attach a built-in stable or milestone marker to a version; returns whether a marker was inserted.

EXAMPLE / SIGNATURE
PromptLedger.set_marker(prompt_id: str, version: int, name: str) -> bool
EXAMPLE / SIGNATURE
ledger.set_marker("greeting", 1, "stable")

PromptLedger.remove_marker

View source ↗

Remove a marker from a version; returns whether a marker was removed.

EXAMPLE / SIGNATURE
PromptLedger.remove_marker(prompt_id: str, version: int, name: str) -> bool
EXAMPLE / SIGNATURE
ledger.remove_marker("greeting", 1, "stable")

PromptLedger.list_markers

View source ↗

List marker records, optionally filtering by prompt and version.

EXAMPLE / SIGNATURE
PromptLedger.list_markers(prompt_id: str | None=None, version: int | None=None) -> list[dict[str, Any]]
EXAMPLE / SIGNATURE
ledger.list_markers("greeting")

PromptLedger.get_markers

View source ↗

Return marker names attached to a concrete version.

EXAMPLE / SIGNATURE
PromptLedger.get_markers(prompt_id: str, version: int) -> list[str]
EXAMPLE / SIGNATURE
ledger.get_markers("greeting", 1)

PromptLedger.promote_label

View source ↗

Guarded compare-and-set promotion. Requires an existing label at baseline, concrete positive versions, explicit suite/model and matching nonempty dataset hashes. Returns gate and promotion status; updates only when checks pass.

EXAMPLE / SIGNATURE
PromptLedger.promote_label(prompt_id: str, label: str, baseline: int, candidate: int, policy: dict[str, Any]) -> dict[str, Any]
EXAMPLE / SIGNATURE
ledger.promote_label("greeting", "prod", 1, 2, policy)

Evaluation and gates

Python API · from promptledger import PromptLedger. Examples use the initialized ledger from Getting started; label and evaluation examples assume their prerequisite records exist.

Regression policy example

Simulated metrics for illustration. Use real comparable measurements and a stable dataset identity for actual release decisions.

EXAMPLE / SIGNATURE
ledger.record_evaluation("greeting", 1, "demo", {"accuracy": 0.8}, model="simulated", dataset_hash="demo-v1")
ledger.record_evaluation("greeting", 2, "demo", {"accuracy": 0.9}, model="simulated", dataset_hash="demo-v1")
policy = {"suite": "demo", "model": "simulated", "metrics": {"accuracy": {"direction": "higher", "max_regression": 0.02}}}
print(ledger.evaluate_gate("greeting", 1, 2, policy).passed)

PromptLedger.record_evaluation

View source ↗

Record numeric, finite evaluation metrics against a resolved concrete version; metadata must be JSON-compatible. This records evidence, not a model call.

EXAMPLE / SIGNATURE
PromptLedger.record_evaluation(prompt_id: str, ref: int | str, suite: str, metrics: dict[str, Any], model: str | None=None, dataset_hash: str | None=None, metadata: dict[str, Any] | None=None) -> EvaluationRun
EXAMPLE / SIGNATURE
ledger.record_evaluation("greeting", 1, "demo", {"accuracy": 0.8}, model="simulated", dataset_hash="demo-v1")

PromptLedger.get_evaluation

View source ↗

Retrieve a saved EvaluationRun by run ID, or None if absent.

EXAMPLE / SIGNATURE
PromptLedger.get_evaluation(run_id: int) -> EvaluationRun | None
EXAMPLE / SIGNATURE
ledger.get_evaluation(1)

PromptLedger.list_evaluations

View source ↗

List saved evaluation runs with optional prompt, version/label, suite and model filters.

EXAMPLE / SIGNATURE
PromptLedger.list_evaluations(prompt_id: str | None=None, ref: int | str | None=None, suite: str | None=None, model: str | None=None, limit: int=200) -> list[EvaluationRun]
EXAMPLE / SIGNATURE
ledger.list_evaluations(prompt_id="greeting", suite="demo")

PromptLedger.compare_evaluations

View source ↗

Compare the latest matching baseline and candidate runs with a common suite and model. Returns metric deltas and missing metrics. Check dataset identity for meaningful comparisons.

EXAMPLE / SIGNATURE
PromptLedger.compare_evaluations(prompt_id: str, from_ref: int | str, to_ref: int | str, suite: str | None=None, model: str | None=None) -> EvaluationComparison
EXAMPLE / SIGNATURE
ledger.compare_evaluations("greeting", 1, 2, suite="demo", model="simulated")

PromptLedger.evaluate_gate

View source ↗

Apply a regression policy to compatible saved runs and return a GateResult. Does not move labels. Dynamic routing results are rejected.

EXAMPLE / SIGNATURE
PromptLedger.evaluate_gate(prompt_id: str, from_ref: int | str, to_ref: int | str, policy: dict[str, Any]) -> GateResult
EXAMPLE / SIGNATURE
ledger.evaluate_gate("greeting", 1, 2, policy).passed

PromptLedger.export_evaluations

View source ↗

Write recorded evaluation runs as JSON Lines; optionally filter by prompt. Returns the output path.

EXAMPLE / SIGNATURE
PromptLedger.export_evaluations(out_path: str | Path, prompt_id: str | None=None) -> Path
EXAMPLE / SIGNATURE
ledger.export_evaluations("evaluations.jsonl", prompt_id="greeting")

Return types and data models

Objects returned by Core. Fields are taken from the v0.8.0 source. Numeric is int | float.

PromptRecord

View source ↗

Stored prompt version and metadata.

Fields

EXAMPLE / SIGNATURE
prompt_id: str
version: int
content: str
content_hash: str
reason: str | None
author: str | None
tags: list[str] | None
env: str | None
collection: str | None
role: str | None
metrics: dict[str, Any] | None
created_at: str

EvaluationRun

View source ↗

A saved run attached to a concrete version.

Fields

EXAMPLE / SIGNATURE
id: int
prompt_id: str
version: int
suite: str
model: str | None
dataset_hash: str | None
metrics: dict[str, Numeric]
metadata: dict[str, Any] | None
created_at: str

to_dict() returns a dictionary representation.

MetricDelta

View source ↗

Baseline/candidate values and change for a common metric.

Fields

EXAMPLE / SIGNATURE
metric: str
baseline: Numeric
candidate: Numeric
delta: Numeric
delta_percent: float | None

to_dict() returns a dictionary representation.

EvaluationComparison

View source ↗

Resolved references, matching runs, common metric deltas and missing metrics.

Fields

EXAMPLE / SIGNATURE
prompt_id: str
from_ref: dict[str, Any]
to_ref: dict[str, Any]
baseline_run: EvaluationRun
candidate_run: EvaluationRun
suite: str
model: str | None
metrics: tuple[MetricDelta, ...]
missing_from: tuple[str, ...]
missing_to: tuple[str, ...]

to_dict() returns a dictionary representation.

GateRule

View source ↗

A metric direction and optional allowed regression thresholds.

Fields

EXAMPLE / SIGNATURE
metric: str
direction: str
max_regression: float | None = None
max_regression_percent: float | None = None

GateMetricResult

View source ↗

The outcome and explanation for a single metric rule.

Fields

EXAMPLE / SIGNATURE
metric: str
passed: bool
direction: str
baseline: Numeric | None
candidate: Numeric | None
regression: float | None
regression_percent: float | None
max_regression: float | None
max_regression_percent: float | None
message: str

to_dict() returns a dictionary representation.

GateResult

View source ↗

Overall gate decision, comparison and individual metric outcomes.

Fields

EXAMPLE / SIGNATURE
passed: bool
comparison: EvaluationComparison
metrics: tuple[GateMetricResult, ...]

to_dict() returns a dictionary representation.

ReviewRef

View source ↗

Original reference and its resolved version.

Fields

EXAMPLE / SIGNATURE
input_ref: str
resolved_version: int
ref_kind: str

to_dict() returns a dictionary representation.

MetadataChange

View source ↗

One changed metadata field.

Fields

EXAMPLE / SIGNATURE
field: str
old_value: Any
new_value: Any

to_dict() returns a dictionary representation.

SemanticChange

View source ↗

Heuristic change category and summary.

Fields

EXAMPLE / SIGNATURE
category: str
summary: str

to_dict() returns a dictionary representation.

ReviewWarning

View source ↗

Review warning code, severity and message.

Fields

EXAMPLE / SIGNATURE
code: str
severity: str
message: str

to_dict() returns a dictionary representation.

ReviewResult

View source ↗

Structured review of two prompt versions.

Fields

EXAMPLE / SIGNATURE
prompt_id: str
from_ref: ReviewRef
to_ref: ReviewRef
semantic_summary: list[SemanticChange]
metadata_changes: list[MetadataChange]
label_context: dict[str, Any]
warnings: list[ReviewWarning]
notes: list[str]
text_changed: bool

to_dict() returns a dictionary representation.

Plugin SDK v1

Public typed interfaces. Plugins are independently installed, trusted Python code; not sandboxed. The host resolves concrete versions and owns persistence.

Implement a provider

Create a standalone provider and declare it in the promptledger.plugins entry-point group. Structural validation does not certify safety.

EXAMPLE / SIGNATURE
[project.entry-points."promptledger.plugins"]
length = "my_package:LengthPlugin"
EXAMPLE / SIGNATURE
from promptledger.sdk import (TypedIntegration, PluginManifest, EvaluationProvider, EvaluationResult)

class LengthPlugin(TypedIntegration, EvaluationProvider):
    manifest = PluginManifest("length", "0.1.0", ("evaluate",))
    def evaluate(self, request):
        return EvaluationResult("length", {"characters": len(request.prompt.content)})

Scaffold and validate

Generate a starter project, install it in the same environment as Core and check its typed contract.

Full SDK guide and third-party disclaimer ↗

EXAMPLE / SIGNATURE
promptledger plugins scaffold my-provider --out ./my-provider
python -m pip install -e ./my-provider
promptledger plugins conformance my-provider --confirm

PromptSnapshot

View source ↗

Frozen prompt identity, concrete version, content and hash passed to typed providers.

Fields

EXAMPLE / SIGNATURE
prompt_id: str
version: int
content: str
content_hash: str
role: str | None = None

ImportRequest

View source ↗

Source locator and provider-specific options.

Fields

EXAMPLE / SIGNATURE
source: str
options: Mapping[str, Any] = field(default_factory=dict)

ImportedPrompt

View source ↗

Imported content and optional role/reason for host persistence.

Fields

EXAMPLE / SIGNATURE
content: str
role: str | None = None
reason: str | None = None

ExportRequest

View source ↗

Prompt snapshot, destination and options.

Fields

EXAMPLE / SIGNATURE
prompt: PromptSnapshot
destination: str
options: Mapping[str, Any] = field(default_factory=dict)

EvaluationRequest

View source ↗

Prompt snapshot and evaluation options.

Fields

EXAMPLE / SIGNATURE
prompt: PromptSnapshot
options: Mapping[str, Any] = field(default_factory=dict)

EvaluationResult

View source ↗

Suite, numeric metrics and optional model, dataset identity and metadata; host stores the result.

Fields

EXAMPLE / SIGNATURE
suite: str
metrics: dict[str, int | float]
model: str | None = None
dataset_hash: str | None = None
metadata: dict[str, Any] | None = None

PublishRequest

View source ↗

Snapshot, destination and options.

Fields

EXAMPLE / SIGNATURE
prompt: PromptSnapshot
destination: str
options: Mapping[str, Any] = field(default_factory=dict)

OperationResult

View source ↗

Destination and JSON-compatible operation metadata.

Fields

EXAMPLE / SIGNATURE
destination: str
metadata: dict[str, Any] = field(default_factory=dict)

PromptImporter

View source ↗

Implement import_prompt to return imported text.

EXAMPLE / SIGNATURE
PromptImporter.import_prompt(request: ImportRequest) -> ImportedPrompt

PromptExporter

View source ↗

Implement export_prompt to export a selected snapshot.

EXAMPLE / SIGNATURE
PromptExporter.export_prompt(request: ExportRequest) -> OperationResult

EvaluationProvider

View source ↗

Implement evaluate to return numeric metric results.

EXAMPLE / SIGNATURE
EvaluationProvider.evaluate(request: EvaluationRequest) -> EvaluationResult

ArtifactPublisher

View source ↗

Implement publish to publish a selected snapshot.

EXAMPLE / SIGNATURE
ArtifactPublisher.publish(request: PublishRequest) -> OperationResult

HealthcheckProvider

View source ↗

Implement healthcheck to return a JSON-compatible dictionary; it may contact a configured service.

EXAMPLE / SIGNATURE
HealthcheckProvider.healthcheck(options: Mapping[str, Any]) -> dict[str, Any]

PluginManifest

View source ↗

Declares a lowercase provider name, version, nonempty unique capabilities and compatible API version. validate() rejects invalid declarations.

EXAMPLE / SIGNATURE
name: str
version: str
capabilities: tuple[str, ...]
api_version: int = API_VERSION
EXAMPLE / SIGNATURE
PluginManifest.validate()

PluginContext

View source ↗

Legacy execution context; require_confirmation() raises without explicit confirmation. Legacy providers have restricted compatibility support.

EXAMPLE / SIGNATURE
ledger: Any
confirmed: bool = False
EXAMPLE / SIGNATURE
PluginContext.require_confirmation()

Integration

View source ↗

Legacy abstract run interface. TypedIntegration is preferred; legacy data operations are not supported by the registry.

EXAMPLE / SIGNATURE
manifest: PluginManifest
EXAMPLE / SIGNATURE
Integration.run(capability: str, context: PluginContext, options: Mapping[str, Any]) -> Any

TypedIntegration

View source ↗

Base class for typed providers. Implement the declared capability interfaces; invoke through PluginRegistry rather than run().

EXAMPLE / SIGNATURE
TypedIntegration.run(capability, context, options)

Plugin registry API

Use for programmatic plugin discovery and trusted execution. Listing uses metadata; load executes plugin code. Do not treat validation as a sandbox.

PluginRegistry.list

View source ↗

List installed entry points and available/enabled/disabled/conflict status without loading provider code.

EXAMPLE / SIGNATURE
PluginRegistry.list(*, include_state=True)

PluginRegistry.load

View source ↗

Load and instantiate a unique provider; check manifest and typed interfaces. This executes trusted code.

EXAMPLE / SIGNATURE
PluginRegistry.load(name)

PluginRegistry.run

View source ↗

Compatibility entry point using PluginContext; dispatches to invoke.

EXAMPLE / SIGNATURE
PluginRegistry.run(name, capability, context, options)

PluginRegistry.invoke

View source ↗

Execute a declared capability after confirmation and activation checks. Options are a JSON object; data operations resolve prompt identity and refs; the host persists imported prompts or evaluations.

EXAMPLE / SIGNATURE
PluginRegistry.invoke(name, capability, ledger, options, confirmed=False)

Integration API

Compatibility facade and provider-specific guides. The typed SDK is preferred for new extensions.

IntegrationSDK.hf_publish

View source ↗

Publish a selected artifact to an existing private Hugging Face dataset with confirmation.

EXAMPLE / SIGNATURE
IntegrationSDK.hf_publish(prompt_id, ref, repo_id, confirmed=False)

Command-line reference

Exact usage and options generated from the v0.8.0 argparse definition. Run promptledger COMMAND --help for the same information. Commands may require an initialized workspace; provider operations require the appropriate package and configuration.

promptledger init

View source ↗

Initialize a PromptLedger database.

EXAMPLE / SIGNATURE
usage: promptledger init [-h]

options:
  -h, --help  show this help message and exit

promptledger add

View source ↗

Add a new prompt version.

EXAMPLE / SIGNATURE
usage: promptledger add [-h] --id PROMPT_ID (--file FILE | --text TEXT)
                        [--reason REASON] [--author AUTHOR] [--tags TAGS]
                        [--env {dev,staging,prod}] [--collection COLLECTION]
                        [--role {system,user,template,modelfile,eval}]
                        [--metrics METRICS] [--quick] [--no-secret-warn]

options:
  -h, --help            show this help message and exit
  --id PROMPT_ID
  --file FILE
  --text TEXT
  --reason REASON
  --author AUTHOR
  --tags TAGS           Comma-separated tags
  --env {dev,staging,prod}
  --collection COLLECTION
  --role {system,user,template,modelfile,eval}
  --metrics METRICS     JSON metrics payload
  --quick               Reuse metadata defaults from the latest version of the
                        same prompt id.
  --no-secret-warn      Disable secret warning

promptledger list

View source ↗

List prompt versions.

EXAMPLE / SIGNATURE
usage: promptledger list [-h] [--id PROMPT_ID] [--collection COLLECTION]
                         [--role {system,user,template,modelfile,eval}]

options:
  -h, --help            show this help message and exit
  --id PROMPT_ID
  --collection COLLECTION
  --role {system,user,template,modelfile,eval}

promptledger show

View source ↗

Show a prompt version.

EXAMPLE / SIGNATURE
usage: promptledger show [-h] --id PROMPT_ID [--version VERSION]

options:
  -h, --help         show this help message and exit
  --id PROMPT_ID
  --version VERSION

promptledger diff

View source ↗

Diff two versions.

EXAMPLE / SIGNATURE
usage: promptledger diff [-h] --id PROMPT_ID --from FROM_VERSION
                         --to TO_VERSION
                         [--mode {unified,context,ndiff,metadata,summary}]

options:
  -h, --help            show this help message and exit
  --id PROMPT_ID
  --from FROM_VERSION
  --to TO_VERSION
  --mode {unified,context,ndiff,metadata,summary}

promptledger review

View source ↗

Review two prompt versions or labels.

EXAMPLE / SIGNATURE
usage: promptledger review [-h] --id PROMPT_ID --from FROM_VERSION
                           --to TO_VERSION

options:
  -h, --help           show this help message and exit
  --id PROMPT_ID
  --from FROM_VERSION
  --to TO_VERSION

promptledger status

View source ↗

Show prompt status.

EXAMPLE / SIGNATURE
usage: promptledger status [-h] [--id PROMPT_ID]

options:
  -h, --help      show this help message and exit
  --id PROMPT_ID

promptledger export

View source ↗

Export prompt history.

EXAMPLE / SIGNATURE
usage: promptledger export [-h] --format {jsonl,csv,md} --out OUT
                           [--id PROMPT_ID] [--from FROM_VERSION]
                           [--to TO_VERSION]
                           [export_command]

positional arguments:
  export_command

options:
  -h, --help            show this help message and exit
  --format {jsonl,csv,md}
  --out OUT
  --id PROMPT_ID
  --from FROM_VERSION
  --to TO_VERSION

promptledger search

View source ↗

Search prompt content.

EXAMPLE / SIGNATURE
usage: promptledger search [-h] [--contains CONTAINS] [--id PROMPT_ID]
                           [--author AUTHOR] [--tag TAG]
                           [--env {dev,staging,prod}]
                           [--collection COLLECTION]
                           [--role {system,user,template,modelfile,eval}]

options:
  -h, --help            show this help message and exit
  --contains CONTAINS
  --id PROMPT_ID
  --author AUTHOR
  --tag TAG
  --env {dev,staging,prod}
  --collection COLLECTION
  --role {system,user,template,modelfile,eval}

promptledger label

View source ↗

Manage labels.

EXAMPLE / SIGNATURE
usage: promptledger label [-h] {set,get,list,history} ...

positional arguments:
  {set,get,list,history}
    set                 Set a label to a version.
    get                 Get a label version.
    list                List labels.
    history             Show label history.

options:
  -h, --help            show this help message and exit

promptledger label set

View source ↗

Set a label to a version.

EXAMPLE / SIGNATURE
usage: promptledger label set [-h] --id PROMPT_ID --version VERSION
                              --name LABEL

options:
  -h, --help         show this help message and exit
  --id PROMPT_ID
  --version VERSION
  --name LABEL

promptledger label get

View source ↗

Get a label version.

EXAMPLE / SIGNATURE
usage: promptledger label get [-h] --id PROMPT_ID --name LABEL

options:
  -h, --help      show this help message and exit
  --id PROMPT_ID
  --name LABEL

promptledger label list

View source ↗

List labels.

EXAMPLE / SIGNATURE
usage: promptledger label list [-h] [--id PROMPT_ID]

options:
  -h, --help      show this help message and exit
  --id PROMPT_ID

promptledger label history

View source ↗

Show label history.

EXAMPLE / SIGNATURE
usage: promptledger label history [-h] [--id PROMPT_ID] [--name LABEL]
                                  [--limit LIMIT]

options:
  -h, --help      show this help message and exit
  --id PROMPT_ID
  --name LABEL
  --limit LIMIT

promptledger marker

View source ↗

Manage markers.

EXAMPLE / SIGNATURE
usage: promptledger marker [-h] {set,remove,list,show} ...

positional arguments:
  {set,remove,list,show}
    set                 Attach a marker to a version.
    remove              Remove a marker from a version.
    list                List markers for a prompt.
    show                Show markers for a prompt version.

options:
  -h, --help            show this help message and exit

promptledger marker set

View source ↗

Attach a marker to a version.

EXAMPLE / SIGNATURE
usage: promptledger marker set [-h] --id PROMPT_ID --version VERSION
                               --name {milestone,stable}

options:
  -h, --help            show this help message and exit
  --id PROMPT_ID
  --version VERSION
  --name {milestone,stable}

promptledger marker remove

View source ↗

Remove a marker from a version.

EXAMPLE / SIGNATURE
usage: promptledger marker remove [-h] --id PROMPT_ID --version VERSION
                                  --name {milestone,stable}

options:
  -h, --help            show this help message and exit
  --id PROMPT_ID
  --version VERSION
  --name {milestone,stable}

promptledger marker list

View source ↗

List markers for a prompt.

EXAMPLE / SIGNATURE
usage: promptledger marker list [-h] --id PROMPT_ID

options:
  -h, --help      show this help message and exit
  --id PROMPT_ID

promptledger marker show

View source ↗

Show markers for a prompt version.

EXAMPLE / SIGNATURE
usage: promptledger marker show [-h] --id PROMPT_ID --version VERSION

options:
  -h, --help         show this help message and exit
  --id PROMPT_ID
  --version VERSION

promptledger eval

View source ↗

Record, compare, and gate evaluations.

EXAMPLE / SIGNATURE
usage: promptledger eval [-h] {record,list,show,compare,gate,export} ...

positional arguments:
  {record,list,show,compare,gate,export}
    record              Record an external evaluation run.
    list                List evaluation runs.
    show                Show one evaluation run.
    compare             Compare latest compatible runs.
    gate                Apply a regression gate policy.
    export              Export evaluation runs as JSONL.

options:
  -h, --help            show this help message and exit

promptledger eval record

View source ↗

Record an external evaluation run.

EXAMPLE / SIGNATURE
usage: promptledger eval record [-h] --id PROMPT_ID --ref REF [--suite SUITE]
                                [--model MODEL] [--dataset-hash DATASET_HASH]
                                (--metrics METRICS | --file FILE)
                                [--metadata METADATA]

options:
  -h, --help            show this help message and exit
  --id PROMPT_ID
  --ref REF
  --suite SUITE
  --model MODEL
  --dataset-hash DATASET_HASH
  --metrics METRICS
  --file FILE
  --metadata METADATA

promptledger eval list

View source ↗

List evaluation runs.

EXAMPLE / SIGNATURE
usage: promptledger eval list [-h] [--id PROMPT_ID] [--ref REF]
                              [--suite SUITE] [--model MODEL] [--limit LIMIT]

options:
  -h, --help      show this help message and exit
  --id PROMPT_ID
  --ref REF
  --suite SUITE
  --model MODEL
  --limit LIMIT

promptledger eval show

View source ↗

Show one evaluation run.

EXAMPLE / SIGNATURE
usage: promptledger eval show [-h] --run RUN_ID

options:
  -h, --help    show this help message and exit
  --run RUN_ID

promptledger eval compare

View source ↗

Compare latest compatible runs.

EXAMPLE / SIGNATURE
usage: promptledger eval compare [-h] --id PROMPT_ID --from FROM_REF
                                 --to TO_REF [--suite SUITE] [--model MODEL]

options:
  -h, --help       show this help message and exit
  --id PROMPT_ID
  --from FROM_REF
  --to TO_REF
  --suite SUITE
  --model MODEL

promptledger eval gate

View source ↗

Apply a regression gate policy.

EXAMPLE / SIGNATURE
usage: promptledger eval gate [-h] --id PROMPT_ID --from FROM_REF --to TO_REF
                              --policy POLICY

options:
  -h, --help       show this help message and exit
  --id PROMPT_ID
  --from FROM_REF
  --to TO_REF
  --policy POLICY

promptledger eval export

View source ↗

Export evaluation runs as JSONL.

EXAMPLE / SIGNATURE
usage: promptledger eval export [-h] [--id PROMPT_ID] --format {jsonl}
                                --out OUT

options:
  -h, --help        show this help message and exit
  --id PROMPT_ID
  --format {jsonl}
  --out OUT

promptledger stable

View source ↗

Mark a version as stable.

EXAMPLE / SIGNATURE
usage: promptledger stable [-h] --id PROMPT_ID [--version VERSION]

options:
  -h, --help         show this help message and exit
  --id PROMPT_ID
  --version VERSION

promptledger milestone

View source ↗

Mark a version as milestone.

EXAMPLE / SIGNATURE
usage: promptledger milestone [-h] --id PROMPT_ID [--version VERSION]

options:
  -h, --help         show this help message and exit
  --id PROMPT_ID
  --version VERSION

promptledger dashboard

View source ↗

Launch the local review dashboard.

EXAMPLE / SIGNATURE
usage: promptledger dashboard [-h] [--host HOST] [--port PORT] [--no-open]

options:
  -h, --help   show this help message and exit
  --host HOST
  --port PORT
  --no-open    Do not open the dashboard in a browser automatically.

promptledger ui

View source ↗

Launch the legacy Streamlit UI.

EXAMPLE / SIGNATURE
usage: promptledger ui [-h]

options:
  -h, --help  show this help message and exit

promptledger integrations

View source ↗

Optional interoperability adapters

EXAMPLE / SIGNATURE
usage: promptledger integrations [-h]
                                 {ollama-import,ollama-export,ollama-test,promptfoo-import,mlflow-import,mlflow-publish,hf-publish,artifact} ...

positional arguments:
  {ollama-import,ollama-export,ollama-test,promptfoo-import,mlflow-import,mlflow-publish,hf-publish,artifact}

options:
  -h, --help            show this help message and exit

promptledger integrations ollama-export

View source ↗

Export a selected prompt as a Modelfile.

EXAMPLE / SIGNATURE
usage: promptledger integrations ollama-export [-h] --id ID --ref REF
                                               --file FILE [--overwrite]

options:
  -h, --help   show this help message and exit
  --id ID
  --ref REF
  --file FILE
  --overwrite

promptledger integrations ollama-test

View source ↗

Run a confirmed local literal substring check.

EXAMPLE / SIGNATURE
usage: promptledger integrations ollama-test [-h] --id ID --ref REF
                                             --model MODEL --expected EXPECTED
                                             [--confirm]

options:
  -h, --help           show this help message and exit
  --id ID
  --ref REF
  --model MODEL
  --expected EXPECTED
  --confirm

promptledger integrations promptfoo-import

View source ↗

Import saved report metrics for a selected version.

EXAMPLE / SIGNATURE
usage: promptledger integrations promptfoo-import [-h] --id ID --ref REF
                                                  --file FILE [--model MODEL]

options:
  -h, --help     show this help message and exit
  --id ID
  --ref REF
  --file FILE
  --model MODEL

promptledger integrations mlflow-import

View source ↗

Import a text prompt from a configured registry.

EXAMPLE / SIGNATURE
usage: promptledger integrations mlflow-import [-h] --id ID --uri URI
                                               [--confirm]

options:
  -h, --help  show this help message and exit
  --id ID
  --uri URI
  --confirm

promptledger integrations mlflow-publish

View source ↗

Publish a selected text prompt to a configured registry.

EXAMPLE / SIGNATURE
usage: promptledger integrations mlflow-publish [-h] --id ID --ref REF
                                                --name NAME [--confirm]

options:
  -h, --help   show this help message and exit
  --id ID
  --ref REF
  --name NAME
  --confirm

promptledger integrations hf-publish

View source ↗

Publish an artifact to an existing private dataset.

EXAMPLE / SIGNATURE
usage: promptledger integrations hf-publish [-h] --id ID --ref REF --repo REPO
                                            [--confirm]

options:
  -h, --help   show this help message and exit
  --id ID
  --ref REF
  --repo REPO
  --confirm

promptledger integrations artifact

View source ↗

Print a local versioned artifact without publishing.

EXAMPLE / SIGNATURE
usage: promptledger integrations artifact [-h] --id ID --ref REF

options:
  -h, --help  show this help message and exit
  --id ID
  --ref REF

promptledger plugins

View source ↗

Discover and run optional plugins

EXAMPLE / SIGNATURE
usage: promptledger plugins [-h]
                            {list,doctor,enable,disable,scaffold,info,validate,run,conformance} ...

positional arguments:
  {list,doctor,enable,disable,scaffold,info,validate,run,conformance}
    doctor              Inspect installed entry points without executing
                        plugin code
    scaffold            Create a standalone typed plugin project

options:
  -h, --help            show this help message and exit

promptledger plugins list

View source ↗

Discover installed provider entry-point metadata without loading code.

EXAMPLE / SIGNATURE
usage: promptledger plugins list [-h]

options:
  -h, --help  show this help message and exit

promptledger plugins doctor

View source ↗

Inspect installed entry points without executing plugin code

EXAMPLE / SIGNATURE
usage: promptledger plugins doctor [-h]

options:
  -h, --help  show this help message and exit

promptledger plugins enable

View source ↗

Enable a provider in the current workspace.

EXAMPLE / SIGNATURE
usage: promptledger plugins enable [-h] name

positional arguments:
  name

options:
  -h, --help  show this help message and exit

promptledger plugins disable

View source ↗

Disable a provider in the current workspace.

EXAMPLE / SIGNATURE
usage: promptledger plugins disable [-h] name

positional arguments:
  name

options:
  -h, --help  show this help message and exit

promptledger plugins scaffold

View source ↗

Create a standalone typed plugin project

EXAMPLE / SIGNATURE
usage: promptledger plugins scaffold [-h] --out OUT name

positional arguments:
  name

options:
  -h, --help  show this help message and exit
  --out OUT

promptledger plugins info

View source ↗

Load trusted provider code and display its manifest. Requires confirmation.

EXAMPLE / SIGNATURE
usage: promptledger plugins info [-h] [--confirm] name

positional arguments:
  name

options:
  -h, --help  show this help message and exit
  --confirm   Allow trusted third-party Python code to execute

promptledger plugins validate

View source ↗

Load a trusted provider and check its manifest and interfaces. Requires confirmation.

EXAMPLE / SIGNATURE
usage: promptledger plugins validate [-h] [--confirm] name

positional arguments:
  name

options:
  -h, --help  show this help message and exit
  --confirm   Allow trusted third-party Python code to execute

promptledger plugins run

View source ↗

Execute a named capability with JSON options and explicit confirmation.

EXAMPLE / SIGNATURE
usage: promptledger plugins run [-h] [--confirm] [--options OPTIONS]
                                [--options-file OPTIONS_FILE]
                                name
                                {evaluate,export,healthcheck,import,publish}

positional arguments:
  name
  {evaluate,export,healthcheck,import,publish}

options:
  -h, --help            show this help message and exit
  --confirm             Allow trusted third-party Python code to execute
  --options OPTIONS     JSON object
  --options-file OPTIONS_FILE
                        Read JSON options from a file instead

promptledger plugins conformance

View source ↗

Check the loaded provider contract; this does not verify safety or runtime correctness.

EXAMPLE / SIGNATURE
usage: promptledger plugins conformance [-h] [--confirm] name

positional arguments:
  name

options:
  -h, --help  show this help message and exit
  --confirm   Allow trusted third-party Python code to execute