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
openfda-pp-cli
binary. You must verify the CLI is installed before invoking any command from this skill. If it is missing, install it first:
  1. Install via the Printing Press installer:
    bash
    npx -y @mvanhorn/printing-press-library install openfda --cli-only
  2. Verify:
    openfda-pp-cli --version
  3. Ensure
    $GOPATH/bin
    (or
    $HOME/go/bin
    ) is on
    $PATH
    .
If the
npx
install fails (no Node, offline, etc.), fall back to a direct Go install (requires Go 1.26.3 or newer):
bash
go install github.com/mvanhorn/printing-press-library/library/developer-tools/openfda/cmd/openfda-pp-cli@latest
If
--version
reports "command not found" after install, the install step did not put the binary on
$PATH
. Do not proceed with skill commands until verification succeeds.
本Skill驱动
openfda-pp-cli
二进制文件。**在调用本Skill的任何命令之前,必须确认CLI已安装。**如果未安装,请先执行以下步骤:
  1. 通过Printing Press安装器安装:
    bash
    npx -y @mvanhorn/printing-press-library install openfda --cli-only
  2. 验证:
    openfda-pp-cli --version
  3. 确保
    $GOPATH/bin
    (或
    $HOME/go/bin
    )已添加到
    $PATH
    环境变量中。
如果
npx
安装失败(如无Node环境、离线等),可以改用Go直接安装(要求Go 1.26.3或更高版本):
bash
go install github.com/mvanhorn/printing-press-library/library/developer-tools/openfda/cmd/openfda-pp-cli@latest
如果安装后执行
--version
提示「command not found」,说明安装步骤未将二进制文件添加到
$PATH
中。请在验证成功后再执行Skill命令。

When 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.
  • openfda-pp-cli animal-events
    — Search animal adverse event reports
device-510k — Premarket notification submissions demonstrating substantial equivalence.
  • openfda-pp-cli device-510k
    — Search 510(k) clearance records
device-classification — Medical device product codes, specialty areas, and regulatory class.
  • openfda-pp-cli device-classification
    — Search device classifications
device-covid19 — COVID-19 serological testing evaluation data.
  • openfda-pp-cli device-covid19
    — Search COVID-19 serology test evaluations
device-events — Medical device adverse event reports (MAUDE/MDR) — injuries, deaths, malfunctions.
  • openfda-pp-cli device-events count
    — Count device events by field
  • openfda-pp-cli device-events list
    — Search device adverse event reports
device-pma — Class III medical device premarket approval decisions.
  • openfda-pp-cli device-pma
    — Search premarket approval records
device-recall-detail — Detailed device recall actions addressing defects or health risks.
  • openfda-pp-cli device-recall-detail
    — Search device recall action details
device-recalls — Medical device recall enforcement reports.
  • openfda-pp-cli device-recalls
    — Search device recall enforcement reports
device-registration — Medical device manufacturing establishment registrations and product listings.
  • openfda-pp-cli device-registration
    — Search device registrations and listings
device-udi — Global Unique Device Identification Database (GUDID).
  • openfda-pp-cli device-udi
    — Search unique device identifiers
drug-approvals — FDA-approved drug products since 1939 — applications, submissions, and marketing status.
  • openfda-pp-cli drug-approvals
    — Search approved drug products
drug-events — Reports of drug side effects, medication errors, product quality problems (FAERS). 4.9M+ reports since 2003.
  • openfda-pp-cli drug-events count
    — Count adverse events by field
  • openfda-pp-cli drug-events list
    — Search drug adverse event reports
drug-labels — Structured product information including prescribing info, black box warnings, indications.
  • openfda-pp-cli drug-labels
    — Search drug product labels
drug-ndc — National Drug Code directory — product identifiers, packaging, and classification.
  • openfda-pp-cli drug-ndc
    — Search NDC directory
drug-recalls — Drug product recall enforcement reports.
  • openfda-pp-cli drug-recalls count
    — Count drug recalls by field
  • openfda-pp-cli drug-recalls list
    — Search drug recall enforcement reports
drug-shortages — Current and historical drug shortages from manufacturing issues, delays, and discontinuations.
  • openfda-pp-cli drug-shortages
    — Search drug shortages
food-events — CAERS reports — food, dietary supplement, and cosmetic adverse events.
  • openfda-pp-cli food-events
    — Search food/supplement adverse event reports
food-recalls — Food product recall enforcement reports.
  • openfda-pp-cli food-recalls count
    — Count food recalls by field
  • openfda-pp-cli food-recalls list
    — Search food recall enforcement reports
nsde — Non-Standardized Drug Entities — drug names that don't map to standard terminology.
  • openfda-pp-cli nsde
    — Search non-standardized drug entities
substance — Substance data from the FDA substance registration system.
  • openfda-pp-cli substance
    — Search substance records
tobacco-problems — Tobacco product problem reports.
  • openfda-pp-cli tobacco-problems
    — Search tobacco problem reports
animal-events — 动物药品与设备不良反应事件报告。
  • openfda-pp-cli animal-events
    — 搜索动物不良反应事件报告
device-510k — 证明实质等效性的上市前通知提交文件。
  • openfda-pp-cli device-510k
    — 搜索510(k) clearance记录
device-classification — 医疗设备产品代码、专业领域和监管类别。
  • openfda-pp-cli device-classification
    — 搜索设备分类信息
device-covid19 — COVID-19血清学检测评估数据。
  • openfda-pp-cli device-covid19
    — 搜索COVID-19血清学检测评估结果
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 — 国家药品代码目录——包括产品标识符、包装和分类。
  • openfda-pp-cli drug-ndc
    — 搜索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>"
which
resolves a natural-language capability query to the best matching command from this CLI's curated feature index. Exit code
0
means at least one match; exit code
2
means no confident match — fall back to
--help
or use a narrower query.
当你知道要执行的操作但不知道对应命令时,可以直接询问CLI:
bash
openfda-pp-cli which "<用你自己的话描述功能>"
which
命令会将自然语言描述的功能查询解析为CLI精选功能索引中最匹配的命令。退出码
0
表示至少找到一个匹配项;退出码
2
表示没有找到可信匹配项——此时可以使用
--help
或更精确的查询词。

Auth Setup

认证设置

Set your API key via environment variable:
bash
export FDA_API_KEY="<your-key>"
Or persist it in ``.
Run
openfda-pp-cli doctor
to verify setup.
通过环境变量设置你的API密钥:
bash
export FDA_API_KEY="<你的密钥>"
或者将其持久化到``中。
执行
openfda-pp-cli doctor
验证设置是否正确。

Agent Mode

Agent模式

Add
--agent
to any command. Expands to:
--json --compact --no-input --no-color --yes
.
  • Pipeable — JSON on stdout, errors on stderr
  • Filterable
    --select
    keeps a subset of fields. Dotted paths descend into nested structures; arrays traverse element-wise. Critical for keeping context small on verbose APIs:
    bash
    openfda-pp-cli animal-events --agent --select id,name,status
  • Previewable
    --dry-run
    shows the request without sending
  • 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格式,错误信息输出到标准错误流
  • 可过滤
    --select
    参数可保留指定字段子集。点路径可遍历嵌套结构;数组会逐个元素处理。在调用返回内容较多的API时,这对于缩小上下文范围至关重要:
    bash
    openfda-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
.results
for data and
.meta.source
to know whether it's live or local. A human-readable
N results (live)
summary is printed to stderr only when stdout is a terminal — piped/agent consumers get pure JSON on stdout.
从本地存储或API读取数据的命令会将输出包裹在溯源信封中:
json
{
  "meta": {"source": "live" | "local", "synced_at": "...", "reason": "..."},
  "results": <数据>
}
解析
.results
字段获取数据,通过
.meta.source
字段判断数据来自实时API还是本地存储。仅当标准输出为终端时,才会将易读的
N results (live)
摘要输出到标准错误流;通过管道或Agent消费时,标准输出仅为纯JSON格式。

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 10
Entries are stored locally at
~/.openfda-pp-cli/feedback.jsonl
. They are never POSTed unless
OPENFDA_FEEDBACK_ENDPOINT
is set AND either
--send
is passed or
OPENFDA_FEEDBACK_AUTO_SEND=true
. Default behavior is local-only.
Write 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
反馈条目存储在本地
~/.openfda-pp-cli/feedback.jsonl
文件中。除非设置了
OPENFDA_FEEDBACK_ENDPOINT
,并且传递了
--send
参数或设置了
OPENFDA_FEEDBACK_AUTO_SEND=true
,否则反馈不会被POST到服务器。默认行为仅本地存储。
写下让你感到意外的点,而不是提交bug报告。简短、具体、一句话即可:这样的反馈才最有价值。

Output Delivery

输出交付

Every command accepts
--deliver <sink>
. 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:
SinkEffect
stdout
Default; write to stdout only
file:<path>
Atomically write output to
<path>
(tmp + rename)
webhook:<url>
POST the output body to the URL (
application/json
or
application/x-ndjson
when
--compact
)
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.
每个命令都支持
--deliver <sink>
参数。输出会发送到指定的sink(同时或替代标准输出),因此Agent无需手动管道即可路由命令结果。支持三种sink:
Sink类型作用
stdout
默认值;仅输出到标准输出
file:<path>
原子性地将输出写入
<path>
(先写入临时文件再重命名)
webhook:<url>
将输出内容POST到指定URL(使用
--compact
参数时为
application/json
application/x-ndjson
格式)
不支持的协议会返回结构化错误,并列出支持的协议类型。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 --yes
Explicit flags always win over profile values; profile values win over defaults.
agent-context
lists all available profiles under
available_profiles
so introspecting agents discover them at runtime.
配置文件是一组保存的参数值,可在多次调用中复用。当定时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-context
命令会在
available_profiles
下列出所有可用配置文件,以便自省Agent在运行时发现它们。

Exit Codes

退出码

CodeMeaning
0Success
2Usage error (wrong arguments)
3Resource not found
4Authentication required
5API error (upstream issue)
7Rate limited (wait and retry)
10Config error
退出码含义
0成功
2使用错误(参数错误)
3资源未找到
4需要认证
5API错误(上游问题)
7速率限制(等待后重试)
10配置错误

Argument Parsing

参数解析

Parse
$ARGUMENTS
:
  1. Empty,
    help
    , or
    --help
    → show
    openfda-pp-cli --help
    output
  2. Starts with
    install
    → ends with
    mcp
    → MCP installation; otherwise → see Prerequisites above
  3. Anything else → Direct Use (execute as CLI command with
    --agent
    )
解析
$ARGUMENTS
的规则:
  1. 为空、
    help
    --help
    → 显示
    openfda-pp-cli --help
    的输出内容
  2. install
    开头
    → 如果以
    mcp
    结尾 → 执行MCP安装;否则 → 参考上方的前置条件部分
  3. 其他情况 → 直接使用(以
    --agent
    参数执行CLI命令)

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-mcp
Verify:
claude mcp list
从本CLI的公开库条目或预构建版本安装MCP二进制文件,然后注册:
bash
claude mcp add openfda-pp-mcp -- openfda-pp-mcp
验证:
claude mcp list

Direct Use

直接使用

  1. Check if installed:
    which openfda-pp-cli
    If not found, offer to install (see Prerequisites at the top of this skill).
  2. Match the user query to the best command from the Unique Capabilities and Command Reference above.
  3. Execute with the
    --agent
    flag:
    bash
    openfda-pp-cli <command> [subcommand] [args] --agent
  4. If ambiguous, drill into subcommand help:
    openfda-pp-cli <command> --help
    .
  1. 检查是否已安装:
    which openfda-pp-cli
    如果未找到,则提示安装(参考本Skill顶部的前置条件部分)。
  2. 将用户查询与上方「独特功能」和「命令参考」中最匹配的命令对应起来。
  3. 添加
    --agent
    参数执行命令:
    bash
    openfda-pp-cli <command> [subcommand] [args] --agent
  4. 如果存在歧义,查看子命令帮助:
    openfda-pp-cli <command> --help
    。",