pp-openfda
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<!-- GENERATED FILE — DO NOT EDIT.
This file is a verbatim mirror of library/developer-tools/openfda/SKILL.md,
regenerated post-merge by tools/generate-skills/. Hand-edits here are
silently overwritten on the next regen. Edit the library/ source instead.
See AGENTS.md "Generated artifacts: registry.json, cli-skills/". -->
<!-- 生成文件 — 请勿编辑。
本文件是library/developer-tools/openfda/SKILL.md的精确镜像,
由tools/generate-skills/在合并后重新生成。此处手动编辑内容会在下次生成时被自动覆盖。请修改library/下的源文件。
详见AGENTS.md中的「生成产物:registry.json、cli-skills/」。 -->
Openfda — Printing Press CLI
Openfda — Printing Press CLI工具
Prerequisites: Install the CLI
前置条件:安装CLI
This skill drives the binary. You must verify the CLI is installed before invoking any command from this skill. If it is missing, install it first:
openfda-pp-cli- Install via the Printing Press installer:
bash
npx -y @mvanhorn/printing-press-library install openfda --cli-only - Verify:
openfda-pp-cli --version - Ensure (or
$GOPATH/bin) is on$HOME/go/bin.$PATH
If the install fails (no Node, offline, etc.), fall back to a direct Go install (requires Go 1.26.3 or newer):
npxbash
go install github.com/mvanhorn/printing-press-library/library/developer-tools/openfda/cmd/openfda-pp-cli@latestIf reports "command not found" after install, the install step did not put the binary on . Do not proceed with skill commands until verification succeeds.
--version$PATH本Skill驱动二进制文件。**在调用本Skill的任何命令之前,必须确认CLI已安装。**如果未安装,请先执行以下步骤:
openfda-pp-cli- 通过Printing Press安装器安装:
bash
npx -y @mvanhorn/printing-press-library install openfda --cli-only - 验证:
openfda-pp-cli --version - 确保(或
$GOPATH/bin)已添加到$HOME/go/bin环境变量中。$PATH
如果安装失败(如无Node环境、离线等),可以改用Go直接安装(要求Go 1.26.3或更高版本):
npxbash
go install github.com/mvanhorn/printing-press-library/library/developer-tools/openfda/cmd/openfda-pp-cli@latest如果安装后执行提示「command not found」,说明安装步骤未将二进制文件添加到中。请在验证成功后再执行Skill命令。
--version$PATHWhen Not to Use This CLI
何时不应使用本CLI
Do not activate this CLI for requests that require creating, updating, deleting, publishing, commenting, upvoting, inviting, ordering, sending messages, booking, purchasing, or changing remote state. This printed CLI exposes read-only commands for inspection, export, sync, and analysis.
请勿在需要创建、更新、删除、发布、评论、点赞、邀请、下单、发送消息、预订、购买或修改远程状态的请求中激活本CLI。本CLI仅提供用于查看、导出、同步和分析的只读命令。
Command Reference
命令参考
animal-events — Animal drug and device adverse event reports.
- — Search animal adverse event reports
openfda-pp-cli animal-events
device-510k — Premarket notification submissions demonstrating substantial equivalence.
- — Search 510(k) clearance records
openfda-pp-cli device-510k
device-classification — Medical device product codes, specialty areas, and regulatory class.
- — Search device classifications
openfda-pp-cli device-classification
device-covid19 — COVID-19 serological testing evaluation data.
- — Search COVID-19 serology test evaluations
openfda-pp-cli device-covid19
device-events — Medical device adverse event reports (MAUDE/MDR) — injuries, deaths, malfunctions.
- — Count device events by field
openfda-pp-cli device-events count - — Search device adverse event reports
openfda-pp-cli device-events list
device-pma — Class III medical device premarket approval decisions.
- — Search premarket approval records
openfda-pp-cli device-pma
device-recall-detail — Detailed device recall actions addressing defects or health risks.
- — Search device recall action details
openfda-pp-cli device-recall-detail
device-recalls — Medical device recall enforcement reports.
- — Search device recall enforcement reports
openfda-pp-cli device-recalls
device-registration — Medical device manufacturing establishment registrations and product listings.
- — Search device registrations and listings
openfda-pp-cli device-registration
device-udi — Global Unique Device Identification Database (GUDID).
- — Search unique device identifiers
openfda-pp-cli device-udi
drug-approvals — FDA-approved drug products since 1939 — applications, submissions, and marketing status.
- — Search approved drug products
openfda-pp-cli drug-approvals
drug-events — Reports of drug side effects, medication errors, product quality problems (FAERS). 4.9M+ reports since 2003.
- — Count adverse events by field
openfda-pp-cli drug-events count - — Search drug adverse event reports
openfda-pp-cli drug-events list
drug-labels — Structured product information including prescribing info, black box warnings, indications.
- — Search drug product labels
openfda-pp-cli drug-labels
drug-ndc — National Drug Code directory — product identifiers, packaging, and classification.
- — Search NDC directory
openfda-pp-cli drug-ndc
drug-recalls — Drug product recall enforcement reports.
- — Count drug recalls by field
openfda-pp-cli drug-recalls count - — Search drug recall enforcement reports
openfda-pp-cli drug-recalls list
drug-shortages — Current and historical drug shortages from manufacturing issues, delays, and discontinuations.
- — Search drug shortages
openfda-pp-cli drug-shortages
food-events — CAERS reports — food, dietary supplement, and cosmetic adverse events.
- — Search food/supplement adverse event reports
openfda-pp-cli food-events
food-recalls — Food product recall enforcement reports.
- — Count food recalls by field
openfda-pp-cli food-recalls count - — Search food recall enforcement reports
openfda-pp-cli food-recalls list
nsde — Non-Standardized Drug Entities — drug names that don't map to standard terminology.
- — Search non-standardized drug entities
openfda-pp-cli nsde
substance — Substance data from the FDA substance registration system.
- — Search substance records
openfda-pp-cli substance
tobacco-problems — Tobacco product problem reports.
- — Search tobacco problem reports
openfda-pp-cli tobacco-problems
animal-events — 动物药品与设备不良反应事件报告。
- — 搜索动物不良反应事件报告
openfda-pp-cli animal-events
device-510k — 证明实质等效性的上市前通知提交文件。
- — 搜索510(k) clearance记录
openfda-pp-cli device-510k
device-classification — 医疗设备产品代码、专业领域和监管类别。
- — 搜索设备分类信息
openfda-pp-cli device-classification
device-covid19 — COVID-19血清学检测评估数据。
- — 搜索COVID-19血清学检测评估结果
openfda-pp-cli device-covid19
device-events — 医疗设备不良反应事件报告(MAUDE/MDR)——包括受伤、死亡、故障等情况。
- — 按字段统计设备事件数量
openfda-pp-cli device-events count - — 搜索设备不良反应事件报告
openfda-pp-cli device-events list
device-pma — III类医疗设备上市前审批决定。
- — 搜索上市前审批记录
openfda-pp-cli device-pma
device-recall-detail — 针对缺陷或健康风险的详细设备召回措施。
- — 搜索设备召回措施详情
openfda-pp-cli device-recall-detail
device-recalls — 医疗设备召回执行报告。
- — 搜索设备召回执行报告
openfda-pp-cli device-recalls
device-registration — 医疗设备制造机构注册和产品列表。
- — 搜索设备注册和产品列表信息
openfda-pp-cli device-registration
device-udi — 全球唯一设备识别数据库(GUDID)。
- — 搜索唯一设备识别码
openfda-pp-cli device-udi
drug-approvals — 1939年以来FDA批准的药品——包括申请、提交文件和上市状态。
- — 搜索已批准药品
openfda-pp-cli drug-approvals
drug-events — 药物副作用、用药错误、产品质量问题报告(FAERS)。自2003年以来已有490万+报告。
- — 按字段统计不良反应事件数量
openfda-pp-cli drug-events count - — 搜索药物不良反应事件报告
openfda-pp-cli drug-events list
drug-labels — 结构化产品信息,包括处方信息、黑框警告、适应症等。
- — 搜索药品标签信息
openfda-pp-cli drug-labels
drug-ndc — 国家药品代码目录——包括产品标识符、包装和分类。
- — 搜索NDC目录
openfda-pp-cli drug-ndc
drug-recalls — 药品召回执行报告。
- — 按字段统计药品召回数量
openfda-pp-cli drug-recalls count - — 搜索药品召回执行报告
openfda-pp-cli drug-recalls list
drug-shortages — 当前和历史药品短缺情况,源于制造问题、延迟和停产。
- — 搜索药品短缺信息
openfda-pp-cli drug-shortages
food-events — CAERS报告——食品、膳食补充剂和化妆品不良反应事件。
- — 搜索食品/补充剂不良反应事件报告
openfda-pp-cli food-events
food-recalls — 食品召回执行报告。
- — 按字段统计食品召回数量
openfda-pp-cli food-recalls count - — 搜索食品召回执行报告
openfda-pp-cli food-recalls list
nsde — 非标准化药品实体——无法映射到标准术语的药品名称。
- — 搜索非标准化药品实体
openfda-pp-cli nsde
substance — FDA物质注册系统中的物质数据。
- — 搜索物质记录
openfda-pp-cli substance
tobacco-problems — 烟草产品问题报告。
- — 搜索烟草产品问题报告
openfda-pp-cli tobacco-problems
Finding the right command
找到合适的命令
When you know what you want to do but not which command does it, ask the CLI directly:
bash
openfda-pp-cli which "<capability in your own words>"which02--help当你知道要执行的操作但不知道对应命令时,可以直接询问CLI:
bash
openfda-pp-cli which "<用你自己的话描述功能>"which02--helpAuth Setup
认证设置
Set your API key via environment variable:
bash
export FDA_API_KEY="<your-key>"Or persist it in ``.
Run to verify setup.
openfda-pp-cli doctor通过环境变量设置你的API密钥:
bash
export FDA_API_KEY="<你的密钥>"或者将其持久化到``中。
执行验证设置是否正确。
openfda-pp-cli doctorAgent Mode
Agent模式
Add to any command. Expands to: .
--agent--json --compact --no-input --no-color --yes-
Pipeable — JSON on stdout, errors on stderr
-
Filterable —keeps a subset of fields. Dotted paths descend into nested structures; arrays traverse element-wise. Critical for keeping context small on verbose APIs:
--selectbashopenfda-pp-cli animal-events --agent --select id,name,status -
Previewable —shows the request without sending
--dry-run -
Offline-friendly — sync/search commands can use the local SQLite store when available
-
Non-interactive — never prompts, every input is a flag
-
Read-only — do not use this CLI for create, update, delete, publish, comment, upvote, invite, order, send, or other mutating requests
在任何命令后添加参数。该参数等价于:。
--agent--json --compact --no-input --no-color --yes-
可管道传输 — 标准输出为JSON格式,错误信息输出到标准错误流
-
可过滤 —参数可保留指定字段子集。点路径可遍历嵌套结构;数组会逐个元素处理。在调用返回内容较多的API时,这对于缩小上下文范围至关重要:
--selectbashopenfda-pp-cli animal-events --agent --select id,name,status -
可预览 —参数会显示请求内容但不实际发送
--dry-run -
离线友好 — 同步/搜索命令可在本地SQLite存储可用时使用该存储
-
非交互式 — 永不弹出提示,所有输入均通过参数传递
-
只读 — 请勿使用本CLI执行创建、更新、删除、发布、评论、点赞、邀请、下单、发送或其他修改状态的请求
Response envelope
响应信封
Commands that read from the local store or the API wrap output in a provenance envelope:
json
{
"meta": {"source": "live" | "local", "synced_at": "...", "reason": "..."},
"results": <data>
}Parse for data and to know whether it's live or local. A human-readable summary is printed to stderr only when stdout is a terminal — piped/agent consumers get pure JSON on stdout.
.results.meta.sourceN results (live)从本地存储或API读取数据的命令会将输出包裹在溯源信封中:
json
{
"meta": {"source": "live" | "local", "synced_at": "...", "reason": "..."},
"results": <数据>
}解析字段获取数据,通过字段判断数据来自实时API还是本地存储。仅当标准输出为终端时,才会将易读的摘要输出到标准错误流;通过管道或Agent消费时,标准输出仅为纯JSON格式。
.results.meta.sourceN results (live)Agent Feedback
Agent反馈
When you (or the agent) notice something off about this CLI, record it:
openfda-pp-cli feedback "the --since flag is inclusive but docs say exclusive"
openfda-pp-cli feedback --stdin < notes.txt
openfda-pp-cli feedback list --json --limit 10Entries are stored locally at . They are never POSTed unless is set AND either is passed or . Default behavior is local-only.
~/.openfda-pp-cli/feedback.jsonlOPENFDA_FEEDBACK_ENDPOINT--sendOPENFDA_FEEDBACK_AUTO_SEND=trueWrite what surprised you, not a bug report. Short, specific, one line: that is the part that compounds.
当你(或Agent)发现本CLI存在问题时,可以记录反馈:
openfda-pp-cli feedback "--since参数是包含性的,但文档说是排他性的"
openfda-pp-cli feedback --stdin < notes.txt
openfda-pp-cli feedback list --json --limit 10反馈条目存储在本地文件中。除非设置了,并且传递了参数或设置了,否则反馈不会被POST到服务器。默认行为仅本地存储。
~/.openfda-pp-cli/feedback.jsonlOPENFDA_FEEDBACK_ENDPOINT--sendOPENFDA_FEEDBACK_AUTO_SEND=true写下让你感到意外的点,而不是提交bug报告。简短、具体、一句话即可:这样的反馈才最有价值。
Output Delivery
输出交付
Every command accepts . The output goes to the named sink in addition to (or instead of) stdout, so agents can route command results without hand-piping. Three sinks are supported:
--deliver <sink>| Sink | Effect |
|---|---|
| Default; write to stdout only |
| Atomically write output to |
| POST the output body to the URL ( |
Unknown schemes are refused with a structured error naming the supported set. Webhook failures return non-zero and log the URL + HTTP status on stderr.
每个命令都支持参数。输出会发送到指定的sink(同时或替代标准输出),因此Agent无需手动管道即可路由命令结果。支持三种sink:
--deliver <sink>| Sink类型 | 作用 |
|---|---|
| 默认值;仅输出到标准输出 |
| 原子性地将输出写入 |
| 将输出内容POST到指定URL(使用 |
不支持的协议会返回结构化错误,并列出支持的协议类型。Webhook发送失败时会返回非零退出码,并将URL和HTTP状态记录到标准错误流。
Named Profiles
命名配置文件
A profile is a saved set of flag values, reused across invocations. Use it when a scheduled agent calls the same command every run with the same configuration - HeyGen's "Beacon" pattern.
openfda-pp-cli profile save briefing --json
openfda-pp-cli --profile briefing animal-events
openfda-pp-cli profile list --json
openfda-pp-cli profile show briefing
openfda-pp-cli profile delete briefing --yesExplicit flags always win over profile values; profile values win over defaults. lists all available profiles under so introspecting agents discover them at runtime.
agent-contextavailable_profiles配置文件是一组保存的参数值,可在多次调用中复用。当定时Agent每次运行都使用相同配置调用同一命令时,可以使用配置文件——即HeyGen的「Beacon」模式。
openfda-pp-cli profile save briefing --json
openfda-pp-cli --profile briefing animal-events
openfda-pp-cli profile list --json
openfda-pp-cli profile show briefing
openfda-pp-cli profile delete briefing --yes显式传递的参数优先级高于配置文件中的值;配置文件中的值优先级高于默认值。命令会在下列出所有可用配置文件,以便自省Agent在运行时发现它们。
agent-contextavailable_profilesExit Codes
退出码
| Code | Meaning |
|---|---|
| 0 | Success |
| 2 | Usage error (wrong arguments) |
| 3 | Resource not found |
| 4 | Authentication required |
| 5 | API error (upstream issue) |
| 7 | Rate limited (wait and retry) |
| 10 | Config error |
| 退出码 | 含义 |
|---|---|
| 0 | 成功 |
| 2 | 使用错误(参数错误) |
| 3 | 资源未找到 |
| 4 | 需要认证 |
| 5 | API错误(上游问题) |
| 7 | 速率限制(等待后重试) |
| 10 | 配置错误 |
Argument Parsing
参数解析
Parse :
$ARGUMENTS- Empty, , or
help→ show--helpoutputopenfda-pp-cli --help - Starts with → ends with
install→ MCP installation; otherwise → see Prerequisites abovemcp - Anything else → Direct Use (execute as CLI command with )
--agent
解析的规则:
$ARGUMENTS- 为空、或
help→ 显示--help的输出内容openfda-pp-cli --help - 以开头 → 如果以
install结尾 → 执行MCP安装;否则 → 参考上方的前置条件部分mcp - 其他情况 → 直接使用(以参数执行CLI命令)
--agent
MCP Server Installation
MCP服务器安装
Install the MCP binary from this CLI's published public-library entry or pre-built release, then register it:
bash
claude mcp add openfda-pp-mcp -- openfda-pp-mcpVerify:
claude mcp list从本CLI的公开库条目或预构建版本安装MCP二进制文件,然后注册:
bash
claude mcp add openfda-pp-mcp -- openfda-pp-mcp验证:
claude mcp listDirect Use
直接使用
- Check if installed: If not found, offer to install (see Prerequisites at the top of this skill).
which openfda-pp-cli - Match the user query to the best command from the Unique Capabilities and Command Reference above.
- Execute with the flag:
--agentbashopenfda-pp-cli <command> [subcommand] [args] --agent - If ambiguous, drill into subcommand help: .
openfda-pp-cli <command> --help
- 检查是否已安装:如果未找到,则提示安装(参考本Skill顶部的前置条件部分)。
which openfda-pp-cli - 将用户查询与上方「独特功能」和「命令参考」中最匹配的命令对应起来。
- 添加参数执行命令:
--agentbashopenfda-pp-cli <command> [subcommand] [args] --agent - 如果存在歧义,查看子命令帮助:。",
openfda-pp-cli <command> --help