Get Api Docs

andrewyng/context-hub/cli/skills/get-api-docs

作者 andrewyng67dcbeb2eb42c808549f08397920ad58be7c2206無授權條款13K 個星標收錄於 2026年10月9日更新於 2026年10月9日儲存庫4 個月前更新

Use this skill to get documentation for third-party APIs, SDKs or libraries before writing code that uses them to ensure you have the latest, most accurate documentation. This is a better way to find documentation than doing web search. This includes when a user asks for tasks like "use the OpenAI API", "call the Stripe API", "use the Anthropic SDK", "query Pinecone", or any other time the user asks you to write code against an external service and you need current API reference. Fetch the docs with chub before answering, rather than relying on your pre-trained knowledge, which may be outdated because of recent changes to these APIs. Be sure to use this skill when the user asks for the latest docs, latest API behavior, or explicitly mentions chub or Context Hub. Ensure `chub` is available, run `chub --help`, then follow the instructions there.

AI 產生的概覽

在撰寫使用第三方 API、SDK 或函式庫的程式碼前,透過 chub CLI 取得其最新文件。

功能
此技能指示代理使用 chub 命令列工具取得外部 API、SDK 與函式庫的最新文件,而不是依賴預先訓練的知識。流程涵蓋確認 chub 是否已安裝、以關鍵字搜尋合適的文件、以指定語言取得文件,並依據取得的內容撰寫正確的程式碼。它也說明如何儲存關於陷阱或版本差異的本機註解,以及如何提交文件意見回饋。
適用情境
當任務需要針對外部服務撰寫程式碼(例如 OpenAI API、Stripe API、Anthropic SDK 或 Pinecone),且需要最新 API 參考時使用。它也適用於使用者要求最新 API 行為或文件,或明確提到 chub 或 Context Hub 的情況。
執行需求
需要 chub CLI 可用;若尚未安裝,則需要 Node.js、npm、網路存取以及全域安裝所需的套件管理員權限。此技能不含指令碼,僅為說明文件。

Get API Docs via chub

When you need documentation for a library or API, fetch it with the chub CLI rather than guessing from training data. This gives you the current, correct API.

Step 1 - Ensure chub exists and get the latest instructions for using it

Run

bash
chub --help

If this results in an error showing that chub does not exist, then install it first, and run it again. If the environment has node, npm, network access, and package-manager permission, install it as follows:

bash
npm install -g @aisuite/chub

Step 2 — Find the right documents

If there is a conflict, follow the instructions from the output of chub --help since that will be the latest guidance. However, a key command for searching for the right documentation is chub search:

bash
chub search "<keywords>" --json

Pick the best-matching id from the results (e.g. openai/chat, anthropic/sdk, stripe/api). If nothing matches, try some broader terms.

Step 3 — Fetch the docs

Again, follow the latest instructions from chub --help instead of this if there is a conflict. But a key command for fetching the relevant docs is:

bash
chub get <id> --lang py    # or --lang js, --lang ts

Remember to include the --lang parameter.

Step 4 — Use the docs and leave feedback

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.

Finally, 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 chub get calls. Keep notes concise and actionable. Don't repeat what's already in the doc.

Additionally, to help all developers, give feedback on the documentation using chub feedback, following the instructions in chub --help . Do not include secrets, source code, private architecture details, or other sensitive information in feedback comments.

來源與署名

來源:andrewyng/context-hub位於cli/skills/get-api-docs提交67dcbeb

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架