get-api-docs

分类: 开发与编程 | 上传者: andrewyngandrewyng | 下载: 0 | 版本: v1.0(最新)

Use this skill when you need documentation for a third-party library, SDK, or API before writing code that uses it — for example, "use the OpenAI API", "call the Stripe API", "use the Anthropic SDK", "query Pinecone", or any 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 training knowledge. --- # 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 — Find the right doc ID ```bash chub search "<library name>" --json ``` Pick the best-matching `id` from the results (e.g. `openai/chat`, `anthropic/sdk`, `stripe/api`). If nothing matches, try a broader term. ## Step 2 — Fetch the docs ```bash chub get <id> --lang py # or --lang js, --lang ts ``` Omit `--lang` if the doc has only one language variant — it will be auto-selected. ## Step 3 — Use the docs 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. ## Quick reference | Goal | Command | |------|---------| | List everything | `chub search` | | Find a doc | `chub search "stripe"` | | Exact id detail | `chub search stripe/api` | | Fetch Python docs | `chub get stripe/api --lang py` | | Fetch JS docs | `chub get openai/chat --lang js` | | Save to file | `chub get anthropic/sdk --lang py -o docs.md` | | Fetch multiple | `chub get openai/chat stripe/api --lang py` | ## Notes - `chub get` auto-detects whether an ID is a doc or skill — no subcommand needed - `chub search` with no query lists everything available - IDs are `<author>/<name>` — confirm the ID from search before fetching - If multiple languages exist and you don't pass `--lang`, chub will tell you which are available

更新日志: Source: GitHub https://github.com/andrewyng/context-hub

目录结构

当前层级: cli/skills/get-api-docs/

SKILL.md

登录后下载/点赞/收藏 ❤ 10 | ★ 0
评论 0

请先登录后评论。

还没有评论,快来第一个发言吧。