langfuse-cli 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. langfuse_cli-0.1.0/.github/CODEOWNERS +2 -0
  2. langfuse_cli-0.1.0/.github/ISSUE_TEMPLATE/bug-report.md +42 -0
  3. langfuse_cli-0.1.0/.github/ISSUE_TEMPLATE/config.yml +8 -0
  4. langfuse_cli-0.1.0/.github/ISSUE_TEMPLATE/feature-request.md +28 -0
  5. langfuse_cli-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +17 -0
  6. langfuse_cli-0.1.0/.github/SECURITY.md +24 -0
  7. langfuse_cli-0.1.0/.github/dependabot.yml +21 -0
  8. langfuse_cli-0.1.0/.github/release-drafter.yml +45 -0
  9. langfuse_cli-0.1.0/.github/workflows/publish.yml +30 -0
  10. langfuse_cli-0.1.0/.github/workflows/release-drafter.yml +19 -0
  11. langfuse_cli-0.1.0/.github/workflows/stale.yml +31 -0
  12. langfuse_cli-0.1.0/.github/workflows/test.yml +37 -0
  13. langfuse_cli-0.1.0/.github/workflows/update-homebrew.yml +63 -0
  14. langfuse_cli-0.1.0/.gitignore +19 -0
  15. langfuse_cli-0.1.0/CONTRIBUTING.md +79 -0
  16. langfuse_cli-0.1.0/LICENSE +21 -0
  17. langfuse_cli-0.1.0/PKG-INFO +286 -0
  18. langfuse_cli-0.1.0/README.md +258 -0
  19. langfuse_cli-0.1.0/pyproject.toml +114 -0
  20. langfuse_cli-0.1.0/src/langfuse_cli/__init__.py +3 -0
  21. langfuse_cli-0.1.0/src/langfuse_cli/_exit_codes.py +10 -0
  22. langfuse_cli-0.1.0/src/langfuse_cli/_tty.py +65 -0
  23. langfuse_cli-0.1.0/src/langfuse_cli/client.py +285 -0
  24. langfuse_cli-0.1.0/src/langfuse_cli/commands/__init__.py +0 -0
  25. langfuse_cli-0.1.0/src/langfuse_cli/commands/datasets.py +81 -0
  26. langfuse_cli-0.1.0/src/langfuse_cli/commands/experiments.py +81 -0
  27. langfuse_cli-0.1.0/src/langfuse_cli/commands/prompts.py +149 -0
  28. langfuse_cli-0.1.0/src/langfuse_cli/commands/scores.py +101 -0
  29. langfuse_cli-0.1.0/src/langfuse_cli/commands/sessions.py +70 -0
  30. langfuse_cli-0.1.0/src/langfuse_cli/commands/traces.py +107 -0
  31. langfuse_cli-0.1.0/src/langfuse_cli/config.py +156 -0
  32. langfuse_cli-0.1.0/src/langfuse_cli/formatters/__init__.py +0 -0
  33. langfuse_cli-0.1.0/src/langfuse_cli/formatters/diff.py +53 -0
  34. langfuse_cli-0.1.0/src/langfuse_cli/formatters/table.py +40 -0
  35. langfuse_cli-0.1.0/src/langfuse_cli/formatters/tree.py +77 -0
  36. langfuse_cli-0.1.0/src/langfuse_cli/main.py +79 -0
  37. langfuse_cli-0.1.0/src/langfuse_cli/output.py +176 -0
  38. langfuse_cli-0.1.0/tests/__init__.py +0 -0
  39. langfuse_cli-0.1.0/tests/conftest.py +3 -0
  40. langfuse_cli-0.1.0/tests/test_client.py +520 -0
  41. langfuse_cli-0.1.0/tests/test_config.py +620 -0
  42. langfuse_cli-0.1.0/tests/test_datasets.py +259 -0
  43. langfuse_cli-0.1.0/tests/test_experiments.py +244 -0
  44. langfuse_cli-0.1.0/tests/test_formatters.py +464 -0
  45. langfuse_cli-0.1.0/tests/test_output.py +564 -0
  46. langfuse_cli-0.1.0/tests/test_prompts.py +528 -0
  47. langfuse_cli-0.1.0/tests/test_scores.py +318 -0
  48. langfuse_cli-0.1.0/tests/test_sessions.py +217 -0
  49. langfuse_cli-0.1.0/tests/test_traces.py +426 -0
  50. langfuse_cli-0.1.0/tests/test_tty.py +303 -0
  51. langfuse_cli-0.1.0/uv.lock +1516 -0
@@ -0,0 +1,2 @@
1
+ # Default owners for all files
2
+ * @aviadshiber
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: Bug Report
3
+ about: Report a bug in langfuse-cli
4
+ title: ""
5
+ labels: bug
6
+ assignees: ""
7
+ ---
8
+
9
+ ## Describe the bug
10
+
11
+ A clear and concise description of what the bug is.
12
+
13
+ ## To reproduce
14
+
15
+ Steps to reproduce the behavior:
16
+
17
+ ```bash
18
+ lf <command> <flags>
19
+ ```
20
+
21
+ ## Expected behavior
22
+
23
+ What you expected to happen.
24
+
25
+ ## Actual behavior
26
+
27
+ What actually happened. Include the full error output if applicable:
28
+
29
+ ```
30
+ <paste output here>
31
+ ```
32
+
33
+ ## Environment
34
+
35
+ - **langfuse-cli version**: (`lf --version`)
36
+ - **Python version**: (`python --version`)
37
+ - **OS**: (e.g., macOS 14.2, Ubuntu 22.04)
38
+ - **Install method**: (uv, pip, homebrew, source)
39
+
40
+ ## Additional context
41
+
42
+ Add any other context about the problem here.
@@ -0,0 +1,8 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Security Vulnerability
4
+ url: https://github.com/aviadshiber/langfuse-cli/blob/master/.github/SECURITY.md
5
+ about: Report security vulnerabilities privately via the security policy
6
+ - name: Langfuse Platform Issues
7
+ url: https://github.com/langfuse/langfuse/issues
8
+ about: For issues with the Langfuse platform itself (not this CLI tool)
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: Feature Request
3
+ about: Suggest a new feature or improvement
4
+ title: ""
5
+ labels: enhancement
6
+ assignees: ""
7
+ ---
8
+
9
+ ## Problem
10
+
11
+ A clear description of the problem you're trying to solve. Example: "I want to be able to ..."
12
+
13
+ ## Proposed solution
14
+
15
+ Describe how you'd like this to work:
16
+
17
+ ```bash
18
+ # Example CLI usage
19
+ lf <command> <new-flags>
20
+ ```
21
+
22
+ ## Alternatives considered
23
+
24
+ Any alternative solutions or features you've considered.
25
+
26
+ ## Additional context
27
+
28
+ Add any other context, mockups, or references here.
@@ -0,0 +1,17 @@
1
+ ## What
2
+
3
+ Brief description of the change.
4
+
5
+ ## Why
6
+
7
+ Why is this change needed? Link to any related issues.
8
+
9
+ Closes #
10
+
11
+ ## Checklist
12
+
13
+ - [ ] Tests added/updated
14
+ - [ ] `uv run ruff check src/ tests/` passes
15
+ - [ ] `uv run mypy src/` passes
16
+ - [ ] `uv run pytest` passes
17
+ - [ ] Documentation updated (if applicable)
@@ -0,0 +1,24 @@
1
+ # Security Policy
2
+
3
+ ## Reporting a Vulnerability
4
+
5
+ If you discover a security vulnerability in langfuse-cli, please report it responsibly.
6
+
7
+ **Email**: [aviadshiber@gmail.com](mailto:aviadshiber@gmail.com)
8
+
9
+ Please include:
10
+ - Description of the vulnerability
11
+ - Steps to reproduce
12
+ - Potential impact
13
+
14
+ You will receive an acknowledgment within 48 hours and a detailed response within 7 days.
15
+
16
+ ## Supported Versions
17
+
18
+ | Version | Supported |
19
+ |---------|-----------|
20
+ | Latest | Yes |
21
+
22
+ ## Scope
23
+
24
+ This policy covers the `langfuse-cli` tool itself. For vulnerabilities in the Langfuse platform, please report to [Langfuse](https://langfuse.com).
@@ -0,0 +1,21 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "pip"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ commit-message:
8
+ prefix: "deps"
9
+ labels:
10
+ - "dependencies"
11
+ open-pull-requests-limit: 10
12
+
13
+ - package-ecosystem: "github-actions"
14
+ directory: "/"
15
+ schedule:
16
+ interval: "weekly"
17
+ commit-message:
18
+ prefix: "ci"
19
+ labels:
20
+ - "ci"
21
+ open-pull-requests-limit: 5
@@ -0,0 +1,45 @@
1
+ name-template: "v$RESOLVED_VERSION"
2
+ tag-template: "v$RESOLVED_VERSION"
3
+ categories:
4
+ - title: "New Features"
5
+ labels:
6
+ - "enhancement"
7
+ - "feature"
8
+ - title: "Bug Fixes"
9
+ labels:
10
+ - "bug"
11
+ - "fix"
12
+ - title: "Dependencies"
13
+ labels:
14
+ - "dependencies"
15
+ - title: "Documentation"
16
+ labels:
17
+ - "documentation"
18
+ - title: "CI/CD"
19
+ labels:
20
+ - "ci"
21
+ - title: "Other Changes"
22
+ labels:
23
+ - "*"
24
+ change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
25
+ change-title-escapes: '\<*_&'
26
+ version-resolver:
27
+ major:
28
+ labels:
29
+ - "breaking"
30
+ minor:
31
+ labels:
32
+ - "enhancement"
33
+ - "feature"
34
+ patch:
35
+ labels:
36
+ - "bug"
37
+ - "fix"
38
+ - "dependencies"
39
+ default: patch
40
+ template: |
41
+ ## Changes
42
+
43
+ $CHANGES
44
+
45
+ **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
@@ -0,0 +1,30 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ id-token: write
9
+ contents: read
10
+
11
+ jobs:
12
+ publish:
13
+ runs-on: ubuntu-latest
14
+ environment: pypi
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - name: Set up Python
19
+ uses: actions/setup-python@v5
20
+ with:
21
+ python-version: "3.12"
22
+
23
+ - name: Install build dependencies
24
+ run: pip install build
25
+
26
+ - name: Build package
27
+ run: python -m build
28
+
29
+ - name: Publish to PyPI
30
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,19 @@
1
+ name: Release Drafter
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ types: [opened, reopened, synchronize]
8
+
9
+ permissions:
10
+ contents: read
11
+ pull-requests: write
12
+
13
+ jobs:
14
+ update-release-draft:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: release-drafter/release-drafter@v6
18
+ env:
19
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,31 @@
1
+ name: Stale Issues
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "0 6 * * 1"
6
+
7
+ permissions:
8
+ issues: write
9
+ pull-requests: write
10
+
11
+ jobs:
12
+ stale:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/stale@v9
16
+ with:
17
+ stale-issue-message: >
18
+ This issue has been automatically marked as stale because it has not
19
+ had recent activity. It will be closed in 14 days if no further
20
+ activity occurs. If this issue is still relevant, please comment
21
+ to keep it open.
22
+ stale-pr-message: >
23
+ This PR has been automatically marked as stale because it has not
24
+ had recent activity. It will be closed in 14 days if no further
25
+ activity occurs.
26
+ days-before-stale: 60
27
+ days-before-close: 14
28
+ stale-issue-label: "stale"
29
+ stale-pr-label: "stale"
30
+ exempt-issue-labels: "pinned,security"
31
+ exempt-pr-labels: "pinned"
@@ -0,0 +1,37 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ branches: [master]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ matrix:
14
+ os: [ubuntu-latest, macos-latest]
15
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Install uv
25
+ uses: astral-sh/setup-uv@v4
26
+
27
+ - name: Install dependencies
28
+ run: uv sync
29
+
30
+ - name: Lint
31
+ run: uv run ruff check src/ tests/
32
+
33
+ - name: Type check
34
+ run: uv run mypy src/
35
+
36
+ - name: Test
37
+ run: uv run pytest -q
@@ -0,0 +1,63 @@
1
+ name: Update Homebrew Formula
2
+
3
+ on:
4
+ workflow_run:
5
+ workflows: ["Publish to PyPI"]
6
+ types: [completed]
7
+
8
+ jobs:
9
+ update-formula:
10
+ runs-on: ubuntu-latest
11
+ if: ${{ github.event.workflow_run.conclusion == 'success' }}
12
+ steps:
13
+ - name: Get release version
14
+ id: version
15
+ env:
16
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17
+ run: |
18
+ VERSION=$(gh api "repos/${{ github.repository }}/releases/latest" --jq .tag_name)
19
+ echo "version=${VERSION#v}" >> "$GITHUB_OUTPUT"
20
+
21
+ - name: Set up Python
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.12"
25
+
26
+ - name: Wait for PyPI availability
27
+ env:
28
+ PKG_VERSION: ${{ steps.version.outputs.version }}
29
+ run: |
30
+ for i in $(seq 1 30); do
31
+ if pip index versions langfuse-cli 2>/dev/null | grep -q "$PKG_VERSION"; then
32
+ echo "langfuse-cli==$PKG_VERSION available on PyPI"
33
+ break
34
+ fi
35
+ echo "Waiting for PyPI... attempt $i/30"
36
+ sleep 20
37
+ done
38
+
39
+ - name: Generate formula with poet
40
+ env:
41
+ PKG_VERSION: ${{ steps.version.outputs.version }}
42
+ run: |
43
+ pip install "langfuse-cli==$PKG_VERSION" homebrew-pypi-poet
44
+ poet -f langfuse-cli > langfuse-cli.rb
45
+
46
+ - name: Checkout tap repo
47
+ uses: actions/checkout@v4
48
+ with:
49
+ repository: aviadshiber/homebrew-tap
50
+ token: ${{ secrets.TAP_GITHUB_TOKEN }}
51
+ path: homebrew-tap
52
+
53
+ - name: Update formula
54
+ env:
55
+ PKG_VERSION: ${{ steps.version.outputs.version }}
56
+ run: |
57
+ cp langfuse-cli.rb homebrew-tap/Formula/langfuse-cli.rb
58
+ cd homebrew-tap
59
+ git config user.name "github-actions[bot]"
60
+ git config user.email "github-actions[bot]@users.noreply.github.com"
61
+ git add Formula/langfuse-cli.rb
62
+ git diff --cached --quiet || git commit -m "Update langfuse-cli to $PKG_VERSION"
63
+ git push
@@ -0,0 +1,19 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+ .eggs/
8
+ .venv/
9
+ .uv/
10
+ .mypy_cache/
11
+ .ruff_cache/
12
+ .pytest_cache/
13
+ htmlcov/
14
+ .coverage
15
+ *.egg
16
+ *.zip
17
+
18
+ # Claude Code
19
+ .claude/
@@ -0,0 +1,79 @@
1
+ # Contributing to langfuse-cli
2
+
3
+ Thanks for your interest in contributing! This guide will help you get started.
4
+
5
+ ## Development Setup
6
+
7
+ ### Prerequisites
8
+
9
+ - Python 3.10+
10
+ - [uv](https://docs.astral.sh/uv/) (recommended) or pip
11
+
12
+ ### Getting Started
13
+
14
+ ```bash
15
+ # Fork and clone the repository
16
+ git clone https://github.com/<your-username>/langfuse-cli.git
17
+ cd langfuse-cli
18
+
19
+ # Install dependencies
20
+ uv sync
21
+
22
+ # Run tests
23
+ uv run pytest
24
+
25
+ # Run linter
26
+ uv run ruff check src/ tests/
27
+
28
+ # Run type checker
29
+ uv run mypy src/
30
+ ```
31
+
32
+ ## Making Changes
33
+
34
+ 1. **Create a branch** from `master`:
35
+ ```bash
36
+ git checkout -b feat/my-feature
37
+ ```
38
+
39
+ 2. **Write your code** following existing patterns:
40
+ - CLI commands go in `src/langfuse_cli/commands/`
41
+ - Formatters go in `src/langfuse_cli/formatters/`
42
+ - Follow [gh-ux patterns](https://cli.github.com/manual/) for CLI design
43
+
44
+ 3. **Add tests** for any new functionality:
45
+ - Tests live in `tests/`
46
+ - Use `pytest` with `respx` for HTTP mocking
47
+ - Aim for high coverage (current: 96%+)
48
+
49
+ 4. **Ensure all checks pass**:
50
+ ```bash
51
+ uv run ruff check src/ tests/
52
+ uv run mypy src/
53
+ uv run pytest
54
+ ```
55
+
56
+ ## Pull Request Guidelines
57
+
58
+ - Keep PRs focused on a single change
59
+ - Write a clear description of what and why
60
+ - Reference any related issues
61
+ - All CI checks must pass
62
+ - A maintainer review is required before merge
63
+
64
+ ## Code Style
65
+
66
+ - Formatter and linter: [Ruff](https://docs.astral.sh/ruff/)
67
+ - Max line length: 120 characters
68
+ - Type annotations required for all public functions (`mypy --strict`)
69
+ - Use `from __future__ import annotations` in all files
70
+
71
+ ## Reporting Issues
72
+
73
+ - **Bugs**: Use the [bug report template](https://github.com/aviadshiber/langfuse-cli/issues/new?template=bug-report.md)
74
+ - **Features**: Use the [feature request template](https://github.com/aviadshiber/langfuse-cli/issues/new?template=feature-request.md)
75
+ - **Security**: See [SECURITY.md](.github/SECURITY.md)
76
+
77
+ ## License
78
+
79
+ By contributing, you agree that your contributions will be licensed under the [MIT License](LICENSE).
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Aviad S.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.