packages/shared/src/in-app-agent/server/skills/generated/raw/cli.md
Documentation: https://langfuse.com/docs/api-and-data-platform/features/cli
# 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>
# 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> --curl
Set environment variables:
export LANGFUSE_PUBLIC_KEY=pk-lf-...
export LANGFUSE_SECRET_KEY=sk-lf-...
export LANGFUSE_BASE_URL=https://cloud.langfuse.com
--json for machine-readable JSON output--curl to preview the HTTP request without executing<resource> <action> --help for available optionsobservations over legacy-observations-v1s — observations is the modern high-performance endpoint (cursor pagination, selective field groups); legacy-observations-v1s is the deprecated v1metrics over legacy-metrics-v1s for the same reasonscores over legacy-score-v1s for list/get operationstraces list can time out on Langfuse Cloud — use observations list (with --trace-id if you're traversing from a known trace) instead. See the Observations API docs for the v1 → v2 mapping.--limit and --page; modern endpoints (observations, metrics, scores) use cursor-based pagination — pass --limit, then thread meta.cursor from the response into the next request's --cursor