get-api-docs
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGet API Docs via chub
通过chub获取API文档
When you need documentation for a library or API, fetch it with the CLI
rather than guessing from training data. This gives you the current, correct API.
chub当你需要某个库或API的文档时,请使用 CLI工具获取,而非依赖训练数据猜测。这样能为你提供当前最新、准确的API信息。
chubStep 1 — Find the right doc ID
步骤1 — 找到正确的文档ID
bash
chub search "<library name>" --jsonPick the best-matching from the results (e.g. , ,
). If nothing matches, try a broader term.
idopenai/chatanthropic/sdkstripe/apibash
chub search "<library name>" --json从结果中选择最匹配的(例如、、)。如果没有匹配结果,尝试使用更宽泛的关键词。
idopenai/chatanthropic/sdkstripe/apiStep 2 — Fetch the docs
步骤2 — 获取文档
bash
chub get <id> --lang py # or --lang js, --lang tsOmit if the doc has only one language variant — it will be auto-selected.
--langbash
chub get <id> --lang py # 或 --lang js、--lang ts如果文档只有一种语言版本,可以省略参数,工具会自动选择。
--langStep 3 — Use the docs
步骤3 — 使用文档
Read the fetched content and use it to write accurate code or answer the question.
Do not rely on memorized API shapes — use what the docs say.
阅读获取到的内容,并据此编写准确的代码或回答问题。不要依赖记忆中的API结构,以文档中的内容为准。
Step 4 — Annotate what you learned
步骤4 — 记录你学到的内容
After completing the task, if you discovered something not in the doc — a gotcha,
workaround, version quirk, or project-specific detail — save it so future sessions
start smarter:
bash
chub annotate <id> "Webhook verification requires raw body — do not parse before verifying"Annotations are local, persist across sessions, and appear automatically on future
calls. Keep notes concise and actionable. Don't repeat what's already in
the doc.
chub get完成任务后,如果你发现文档中没有提到的内容——比如注意事项、解决方案、版本特性或项目特定细节,请保存这些信息,以便后续会话能更高效地开展:
bash
chub annotate <id> "Webhook verification requires raw body — do not parse before verifying"注释内容仅保存在本地,会跨会话持久化,且在后续调用时自动显示。请保持注释简洁且具有可操作性,不要重复文档中已有的内容。
chub getStep 5 — Give feedback
步骤5 — 反馈评价
Rate the doc so authors can improve it. Ask the user before sending.
bash
chub feedback <id> up # doc worked well
chub feedback <id> down --label outdated # doc needs updatingAvailable labels: , , , ,
, , , , ,
.
outdatedinaccurateincompletewrong-exampleswrong-versionpoorly-structuredaccuratewell-structuredhelpfulgood-examples对文档进行评分,帮助作者优化文档。评分前请先询问用户。
bash
chub feedback <id> up # 文档使用体验良好
chub feedback <id> down --label outdated # 文档需要更新可用标签包括:、、、、、、、、、。
outdatedinaccurateincompletewrong-exampleswrong-versionpoorly-structuredaccuratewell-structuredhelpfulgood-examplesQuick reference
速查参考
| Goal | Command |
|---|---|
| List everything | |
| Find a doc | |
| Exact id detail | |
| Fetch Python docs | |
| Fetch JS docs | |
| Save to file | |
| Fetch multiple | |
| Save a note | |
| List notes | |
| Rate a doc | |
| 目标 | 命令 |
|---|---|
| 列出所有可用文档 | |
| 查找特定文档 | |
| 查看精确ID的详情 | |
| 获取Python版文档 | |
| 获取JS版文档 | |
| 保存到文件 | |
| 获取多个文档 | |
| 保存注释 | |
| 列出所有注释 | |
| 为文档评分 | |
Notes
注意事项
- with no query lists everything available
chub search - IDs are — confirm the ID from search before fetching
<author>/<name> - If multiple languages exist and you don't pass , chub will tell you which are available
--lang
- 不带查询参数的会列出所有可用文档
chub search - 文档ID格式为——请在获取前通过搜索确认ID
<作者>/<名称> - 如果文档存在多语言版本且未传入参数,chub会告知你可用的语言选项
--lang