CLI 接入
在终端、脚本或没有 MCP 的 Agent 里,一条命令查资源。
npm 包即将发布,发布后即可用 npx 直接运行。在那之前可以先用 HTTP API。
常用命令
列出分类
npx crayoncat categories看某个分类的标签
npx crayoncat tags --category ui-components筛选资源
npx crayoncat search "React 无样式组件" --category ui-components --limit 5资源详情与快速上手
npx crayoncat show shadcn-ui选项
| 选项 | 说明 |
|---|---|
--category | 分类 slug |
--tag | 标签 slug,可重复 |
--pricing | free / freemium / paid |
--limit / --cursor | 每页条数(1–20)与翻页 |
--json | 输出原始 JSON,适合 Agent 和脚本解析 |
--base | 服务地址,也可用环境变量 CRAYONCAT_BASE_URL |
给 Agent 用
在 AGENTS.md 或 CLAUDE.md 里加一句,Agent 就会在需要时调用:
需要找 AI 工具、MCP 服务、组件库等资源时,先用 `npx crayoncat search <关键词> --json` 查询蜡笔猫导航,再用 `npx crayoncat show <slug> --json` 看详情和安装方式。退出码
0 成功,1 请求失败(含 429 限流),2 参数错误,4 资源不存在。需要 Node.js 20 以上,无其他依赖。