Langfuse CLI Reference
Documentation: https://langfuse.com/docs/api-and-data-platform/features/cli
Install
# Run directly (recommended)
npx langfuse-cli api <resource> <action>
bunx langfuse-cli api <resource> <action>
# Or install globally
npm i -g langfuse-cli
langfuse api <resource> <action>Discovery
# List all resources and auth info
langfuse api __schema
# List actions for a resource
langfuse api <resource> --help
# Show args/options for a specific action
langfuse api <resource> <action> --help
# Preview the curl command without executing
langfuse api <resource> <action> --curlCredentials
Set environment variables:
export LANGFUSE_PUBLIC_KEY=pk-lf-...
export LANGFUSE_SECRET_KEY=sk-lf-...
export LANGFUSE_HOST=https://cloud.langfuse.com Tips
- Use
--jsonfor machine-readable JSON output - Use
--curlto preview the HTTP request without executing - Pagination: use
--limitand--pageon list endpoints - All list commands support filtering — check
<resource> <action> --helpfor available options - Prefer
observations-v2soverobservations— the v2 endpoint returns richer data - Prefer
metrics-v2sovermetrics— the v2 endpoint returns richer data - Prefer
score-v2soverscores— the v1scoresresource only supports create/delete; usescore-v2sfor list and get operations