Skip to main content

A set of CLI tools to interact with Langfuse, especially for prompt management.

Project description

langfuse-cli

A set of CLI tools to interact with Langfuse, especially for prompt management.

Installation

This project uses uv. You can install the project and its dependencies by running:

uv sync

Or you can install it using pip if you have the package:

pip install .

The CLI command is named langfuse-cli.

Configuration

The CLI uses environment variables for authentication with your Langfuse instance. You can create a .env file in the root directory or set these variables in your shell.

.env Setup

Create a .env file with the following content:

LANGFUSE_PUBLIC_KEY=pk-lf-...
LANGFUSE_SECRET_KEY=sk-lf-...
LANGFUSE_HOST=https://cloud.langfuse.com # Or your self-hosted URL

The CLI uses the standard langfuse Python SDK get_client() method, which automatically reads these environment variables.

Usage

Prompts Management

The prompt command group allows you to manage Langfuse prompts.

Promote Labels

The promote command allows you to copy a label from one version of all prompts to another. This is useful for moving prompts through different environments (e.g., from dev to uat).

Command:

langfuse-cli prompt promote <src_label> <target_label> [--apply]

Options:

  • --apply: Automatically apply the promotion without asking for confirmation.

Examples:

  1. Dry run / Confirmation mode:

    langfuse-cli prompt promote dev uat
    

    This will show a plan of which prompts will be updated (adding the uat label to all prompts that currently have the dev label) and ask for confirmation before applying.

  2. Auto-apply mode:

    langfuse-cli prompt promote dev uat --apply
    

    This will automatically update the labels for all prompts matching the source label.

Development

To run the CLI during development:

uv run langfuse-cli --help

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

bto_langfuse_cli-1.0.3.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

bto_langfuse_cli-1.0.3-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file bto_langfuse_cli-1.0.3.tar.gz.

File metadata

  • Download URL: bto_langfuse_cli-1.0.3.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for bto_langfuse_cli-1.0.3.tar.gz
Algorithm Hash digest
SHA256 06febe232b096c9f41d8336d4a9f56b5cb83f4a5f635b7ca90f3bfdffc9186b1
MD5 a1b97bbdb4d199a61b5df717a49231e2
BLAKE2b-256 400d8d6c5236d021dfe139f9e7d282f84e43649a93513a5f191bbbad6b8a0c9b

See more details on using hashes here.

File details

Details for the file bto_langfuse_cli-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: bto_langfuse_cli-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for bto_langfuse_cli-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d2f6c34bbb858ccf84119478f42d0f4043e222b3689043f6fdfb5f3f9c0ac8ba
MD5 c1c732fff1665a32e46f32efd3088942
BLAKE2b-256 9c3d7cdad5a637582627e831a93f5bf2701237a42605e6bf4d95faaad27597a9

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