litefuse
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLitefuse
Litefuse
This skill helps you use Litefuse effectively across all common workflows: instrumenting applications, migrating prompts, debugging traces, and accessing data programmatically.
本技能可帮助你在所有常见工作流中高效使用Litefuse:应用程序埋点、提示词迁移、追踪记录调试以及以编程方式访问数据。
Core Principles
核心原则
Follow these principles for ALL Litefuse work:
- Documentation First: NEVER implement based on memory. Always fetch current docs before writing code (Litefuse updates frequently) See the section below on how to access documentation.
- CLI for Data Access: Use when querying/modifying Litefuse data. See the section below on how to use the CLI.
litefuse-cli - Best Practices by Use Case: Check the relevant reference file below for use-case-specific guidelines before implementing
- Use latest Litefuse versions: Unless the user specified otherwise or there's a good reason, always use the latest version of Langfuse SDKs/APIs.
所有Litefuse相关工作请遵循以下原则:
- 文档优先:绝不要凭记忆实现功能。编写代码前务必获取最新文档(Litefuse更新频繁)。请查看下方关于文档访问的章节。
- CLI数据访问:查询或修改Litefuse数据时,请使用。请查看下方关于CLI使用的章节。
litefuse-cli - 按场景遵循最佳实践:实现前请查看下方对应场景的参考文档,获取特定场景的指导方针。
- 使用最新版Litefuse:除非用户明确指定或有合理理由,否则请始终使用最新版本的Langfuse SDK/API。
Use case specific references
场景特定参考文档
- instrumenting an existing function/application: references/instrumentation.md
- migrating prompts from a codebase into Litefuse: references/prompt-migration.md
- capturing user feedback (thumbs, ratings, implicit signals) as scores on traces: references/user-feedback.md
- further tips on using the Litefuse CLI: references/cli.md
- upgrading or migrating Langfuse SDKs to the latest version: references/sdk-upgrade.md
- submitting feedback about this skill: references/skill-feedback.md
- 为现有函数/应用程序埋点:references/instrumentation.md
- 将代码库中的提示词迁移至Litefuse:references/prompt-migration.md
- 收集用户反馈(点赞、评分、隐性信号)并作为追踪记录的评分:references/user-feedback.md
- Litefuse CLI使用进阶技巧:references/cli.md
- 将Langfuse SDK升级或迁移至最新版本:references/sdk-upgrade.md
- 提交关于本技能的反馈:references/skill-feedback.md
1. Langfuse API via CLI
1. 通过CLI调用Langfuse API
Use the to interact with the full Litefuse REST API from the command line. Run via npx (no install required):
litefuse-cliStart by discovering the schema and available arguments:
bash
undefined使用从命令行与完整的Litefuse REST API交互。通过npx运行(无需安装):
litefuse-cli首先发现API schema和可用参数:
bash
undefinedDiscover all available resources
Discover all available resources
npx litefuse-cli api __schema
npx litefuse-cli api __schema
List actions for a resource
List actions for a resource
npx litefuse-cli api <resource> --help
npx litefuse-cli api <resource> --help
Show args/options for a specific action
Show args/options for a specific action
npx litefuse-cli api <resource> <action> --help
undefinednpx litefuse-cli api <resource> <action> --help
undefinedCredentials
凭证信息
Set environment variables before making calls:
bash
export LANGFUSE_PUBLIC_KEY=pk-lf-...
export LANGFUSE_SECRET_KEY=sk-lf-...
export LANGFUSE_HOST=https://litefuse.cloud # default Litefuse cloud host. Can also be a self-hosted URL. The server must always be specified in order to access Litefuse.If not set, ask the user for their API keys (found in Litefuse UI → Settings → API Keys).
调用前设置环境变量:
bash
export LANGFUSE_PUBLIC_KEY=pk-lf-...
export LANGFUSE_SECRET_KEY=sk-lf-...
export LANGFUSE_HOST=https://litefuse.cloud # default Litefuse cloud host. Can also be a self-hosted URL. The server must always be specified in order to access Litefuse.如果未设置,请向用户索要其API密钥(可在Litefuse UI → 设置 → API密钥中找到)。
Detailed CLI Reference
CLI详细参考文档
For common workflows, tips, and full usage patterns, see references/cli.md.
有关常见工作流、技巧和完整使用模式,请查看references/cli.md。
2. Litefuse Documentation
2. Litefuse文档
Three methods to access Litefuse docs, in order of preference. Always prefer your application's native web fetch and search tools (e.g., , , , etc.) over when available. The URLs and patterns below work with any fetching method — the examples are just illustrative.
WebFetchWebSearchmcp_fetchcurlcurl三种访问Litefuse文档的方法,按优先级排序。当可用时,始终优先使用应用程序原生的网页获取和搜索工具(如、、等),而非。以下URL和模式适用于任何获取方法——示例仅作演示用。
WebFetchWebSearchmcp_fetchcurlcurl2a. Documentation Index (llms.txt)
2a. 文档索引(llms.txt)
Fetch the full index of all documentation pages:
bash
curl -s https://litefuse.ai/llms.txtReturns a structured list of every doc page with titles and URLs. Use this to discover the right page for a topic, then fetch that page directly.
Alternatively, you can start on and explore the site to find the page you need.
https://litefuse.ai/docs获取所有文档页面的完整索引:
bash
curl -s https://litefuse.ai/llms.txt返回包含所有文档页面标题和URL的结构化列表。使用此索引查找对应主题的页面,然后直接获取该页面内容。
或者,你可以从开始浏览网站,找到所需页面。
https://litefuse.ai/docs2b. Fetch Individual Pages as Markdown
2b. 获取单个页面的Markdown版本
Any page listed in llms.txt can be fetched as markdown by appending to its path or by using in the request headers. Use this when you know which page contains the information needed. Returns clean markdown with code examples and configuration details.
.mdAccept: text/markdownbash
curl -s "https://litefuse.ai/docs/observability/overview.md"
curl -s "https://litefuse.ai/docs/observability/overview" -H "Accept: text/markdown"llms.txt中列出的任何页面都可以通过在路径后添加,或在请求头中使用来获取Markdown格式内容。当你知道所需信息所在的具体页面时,使用此方法。返回的内容为整洁的Markdown格式,包含代码示例和配置细节。
.mdAccept: text/markdownbash
curl -s "https://litefuse.ai/docs/observability/overview.md"
curl -s "https://litefuse.ai/docs/observability/overview" -H "Accept: text/markdown"2c. Search Documentation
2c. 搜索文档
When you need to find information across all docs and github issues/discussions without knowing the specific page:
bash
curl -s "https://litefuse.ai/api/search-docs?query=<url-encoded-query>"Example:
bash
curl -s "https://litefuse.ai/api/search-docs?query=How+do+I+trace+LangGraph+agents"Returns a JSON response with:
- : the original query
query - : a JSON string containing an array of matching documents, each with:
answer- : link to the doc page
url - : page title
title - : array of relevant text excerpts from the page
source.content
Search is a great fallback if you cannot find the relevant pages or need more context. Especially useful when debugging issues as all GitHub Issues and Discussions are also indexed. Responses can be large — extract only the relevant portions.
当你需要在所有文档、GitHub问题/讨论中查找信息,但不知道具体页面时:
bash
curl -s "https://litefuse.ai/api/search-docs?query=<url-encoded-query>"示例:
bash
curl -s "https://litefuse.ai/api/search-docs?query=How+do+I+trace+LangGraph+agents"返回JSON响应,包含:
- : 原始查询语句
query - : 一个JSON字符串,包含匹配文档的数组,每个文档包含:
answer- : 文档页面链接
url - : 页面标题
title - : 页面中相关文本片段的数组
source.content
如果找不到相关页面或需要更多上下文,搜索是很好的备选方案。在调试问题时尤其有用,因为所有GitHub问题和讨论都已被索引。响应内容可能较大,请仅提取相关部分。
Documentation Workflow
文档使用流程
- Start with llms.txt to orient — scan for relevant page titles
- Fetch specific pages when you identify the right one
- Fall back to search when the topic is unclear and you want more context
- 从llms.txt开始定位——浏览相关页面标题
- 当确定正确页面后,获取特定页面内容
- 当主题不明确且需要更多上下文时,回退到搜索功能
Skill Feedback
技能反馈
When the user expresses that something about this skill is not working as expected, gives incorrect guidance, is missing information, or could be improved — offer to submit feedback to the Litefuse skill maintainers. This includes when:
- The skill gave wrong or outdated instructions
- A workflow didn't produce the expected result
- The user wishes the skill covered something it doesn't
- The user explicitly says something like "this should work differently" or "this is wrong"
Do NOT trigger this for issues with Litefuse itself (the product) — only for issues with this skill's instructions and behavior.
When triggered, follow the process in references/skill-feedback.md.
当用户表示本技能的某些功能未按预期工作、提供了错误指导、缺失信息或可改进时——主动提出向Litefuse技能维护者提交反馈。包括以下情况:
- 技能给出错误或过时的指令
- 工作流未产生预期结果
- 用户希望技能涵盖当前未涉及的内容
- 用户明确表示类似“这应该以不同方式工作”或“这是错误的”
请勿触发此流程处理Litefuse产品本身的问题——仅针对本技能的指令和行为问题。
触发时,请遵循references/skill-feedback.md中的流程。