### Install PromptLedger Core Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Installs the PromptLedger CLI, Python API, and local read-only dashboard. Use this for basic functionality. ```bash pip install promptledger ``` -------------------------------- ### Install PromptLedger with UI Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Installs PromptLedger along with legacy Streamlit support for the UI. Use this if you need the UI features. ```bash pip install "promptledger[ui]" ``` -------------------------------- ### Start PromptLedger Dashboard Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Starts the local web-based dashboard for reviewing prompt history. The port can be specified. ```bash promptledger dashboard ``` ```bash promptledger dashboard --port 8765 ``` -------------------------------- ### Markdown Export Example Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md An example of a prompt review exported in Markdown format, showing the compared references and review summary. ```markdown # Prompt Review: `onboarding` ## Compared refs - From: `prod` -> `v7` - To: `staging` -> `v9` ``` -------------------------------- ### Set, Get, and List Labels Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Commands to manage labels for prompt versions. Use labels to track active releases like 'prod' or 'staging'. ```bash promptledger label set --id onboarding --version 7 --name prod promptledger label set --id onboarding --version 9 --name staging promptledger label get --id onboarding --name prod promptledger label list --id onboarding promptledger label history --id onboarding promptledger status --id onboarding ``` -------------------------------- ### Concise Review Output Example Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md This is a sample of the concise output generated by the promptledger review command, highlighting semantic summaries and metadata changes. ```text Prompt Review: onboarding From: prod -> v7 To: staging -> v9 Semantic summary - Constraints tightened. - Output format changed from bullets to json. Metadata changes - `env`: prod -> staging ``` -------------------------------- ### Prompt Review CLI Commands Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Use these commands to initiate a prompt review, compare specific versions, or export review results. Ensure the 'promptledger' tool is installed and configured. ```bash promptledger review --id onboarding --from prod --to staging ``` ```bash promptledger diff --id onboarding --from 7 --to 9 --mode summary ``` ```bash promptledger export review --id onboarding --from prod --to staging --format md --out onboarding_review.md ``` -------------------------------- ### Run Pytest Tests Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Execute the test suite using pytest. Ensure you have Python version 3.10 or higher installed. ```bash pytest ``` -------------------------------- ### Search Prompts by Role Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Search for prompts that have a specific role assigned. This helps in finding prompts used for evaluation or as modelfiles, for example. ```bash promptledger search --role modelfile ``` -------------------------------- ### Initialize PromptLedger CLI Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Initializes the PromptLedger environment. This is typically the first command to run. ```bash promptledger init ``` -------------------------------- ### Manage Prompt Markers CLI Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Sets markers (like 'stable') for prompt versions and lists existing markers. ```bash promptledger marker set --id onboarding --version 2 --name stable ``` ```bash promptledger marker list --id onboarding ``` -------------------------------- ### Manage Prompt Status CLI Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Applies 'stable' or 'milestone' markers to prompt versions, or lists them. ```bash promptledger stable --id onboarding ``` ```bash promptledger milestone --id onboarding --version 1 ``` -------------------------------- ### Review Prompt Versions CLI Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Generates a review for a prompt, comparing specified versions. ```bash promptledger review --id onboarding --from prod --to staging ``` -------------------------------- ### Initialize and Add Prompts with Python API Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Initializes the PromptLedger and adds new prompts with associated metadata using the Python API. ```python from promptledger import PromptLedger ledger = PromptLedger() ledger.init() ledger.add( "summary", "Summarize the document in 3 bullets.", tags=["draft"], env="dev", collection="chunking-lab", role="template", metrics={"accuracy": 0.92}, ) ledger.add( "summary", "Summarize the document in 5 bullets.", tags=["draft"], env="dev", collection="chunking-lab", role="eval", metrics={"accuracy": 0.94}, ) ``` -------------------------------- ### Add Prompt with Quick Iteration Flags Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Use the --quick flag to reuse metadata from the latest version of an existing prompt. This avoids retyping common metadata fields on every version update. ```bash promptledger add --id onboarding --file ./prompts/onboarding.txt --quick promptledger add --id onboarding --file ./prompts/onboarding.txt --quick --env staging promptledger add --id onboarding --file ./prompts/onboarding.txt --quick --role eval ``` -------------------------------- ### Show Stable and Milestone Versions Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Commands to directly query for stable or milestone versions of a prompt. ```bash promptledger stable --id onboarding promptledger milestone --id onboarding --version 7 ``` -------------------------------- ### Annotate Prompt Versions with Markers Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Use these commands to annotate important prompt versions with markers. Replace `` and `` with the relevant identifiers. Use markers for history annotation, not release routing. ```bash promptledger stable --id --version ``` ```bash promptledger milestone --id --version ``` -------------------------------- ### Manage Prompt Labels CLI Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Sets labels for specific prompt versions and retrieves label history. ```bash promptledger label set --id onboarding --version 2 --name prod ``` ```bash promptledger label history --id onboarding ``` -------------------------------- ### Inspect Stable and Milestone Prompt Versions Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Use this command to inspect stable and milestone versions of a specific prompt. Replace `` with the actual prompt ID. ```bash promptledger marker list --id ``` -------------------------------- ### Verify Prompt Metadata Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Use this command to verify the metadata of a specific prompt version. Replace `` and `` with the relevant identifiers. ```bash promptledger show --id --version ``` -------------------------------- ### Diff Prompt Versions CLI Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Compares two versions of a prompt. Supports different diff modes like context, ndiff, metadata, and summary. ```bash promptledger diff --id onboarding --from 1 --to 2 ``` ```bash promptledger diff --id onboarding --from prod --to staging ``` ```bash promptledger diff --id onboarding --from 1 --to 2 --mode context ``` ```bash promptledger diff --id onboarding --from 1 --to 2 --mode ndiff ``` ```bash promptledger diff --id onboarding --from 1 --to 2 --mode metadata ``` ```bash promptledger diff --id onboarding --from 1 --to 2 --mode summary ``` -------------------------------- ### Review and Export Review with Python API Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Generates a review for a prompt and exports it in Markdown format using the Python API. ```python review = ledger.review("summary", 1, 2) print(review.semantic_summary) print(ledger.export_review_markdown("summary", 1, 2)) ``` -------------------------------- ### Show Specific Prompt Version CLI Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Displays a specific version of a prompt by its ID. ```bash promptledger show --id onboarding --version 2 ``` -------------------------------- ### Set, Show, List, and Remove Markers Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Commands to manage semantic markers attached to specific prompt versions. Markers like 'stable' or 'milestone' provide version-attached meaning. ```bash promptledger marker set --id onboarding --version 7 --name stable promptledger marker set --id onboarding --version 7 --name milestone promptledger marker show --id onboarding --version 7 promptledger marker list --id onboarding promptledger marker remove --id onboarding --version 7 --name milestone ``` -------------------------------- ### Search Prompts CLI Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Searches prompts based on content, ID, tags, environment, collection, and role. ```bash promptledger search --contains "friendly" --id onboarding --tag draft --env dev ``` ```bash promptledger search --collection support-bot --role system ``` -------------------------------- ### List Prompts by Collection and Role Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md List prompts that belong to a specific collection and have a particular role. This allows for more granular filtering. ```bash promptledger list --collection chunking-lab --role eval ``` -------------------------------- ### List Prompts in PromptLedger CLI Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Lists prompt versions. Can list all versions, versions for a specific ID, or filter by collection and role. ```bash promptledger list ``` ```bash promptledger list --id onboarding ``` ```bash promptledger list --collection support-bot ``` ```bash promptledger list --collection support-bot --role system ``` -------------------------------- ### PromptLedger Status and Dashboard CLI Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Checks the status of PromptLedger and launches the local dashboard. The dashboard can be configured with a specific port. ```bash promptledger status ``` ```bash promptledger dashboard ``` ```bash promptledger dashboard --port 8765 ``` -------------------------------- ### Add Prompt with Collection and Role Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Add a prompt with specific collection and role metadata. This helps in organizing and categorizing prompts for better management. ```bash promptledger add --id chunk-clunker --text "..." --collection chunking-lab --role system ``` -------------------------------- ### List Prompts by Collection Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md List all prompts within a specific collection. This is useful for viewing related prompts together. ```bash promptledger list --collection chunking-lab ``` -------------------------------- ### Search Prompts by Collection and Role Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Search for prompts that match both a specific collection and role. This provides a highly targeted way to find prompts. ```bash promptledger search --collection chunking-lab --role system ``` -------------------------------- ### Set Prompt Label Source: https://github.com/ertugrulmutlu/promptledger/blob/main/README.md Use this command to set a label for a specific prompt version. Replace ``, ``, and `