Loading...
Loading...
ABC Medical Cloud API Document Query Tool. Reads and queries the OpenAPI specification documents of ABC API (5000+ interfaces), supports searching by module, path, and method, and automatically resolves $ref references. Adopts a module-split cache structure for fast query speed. Usage scenarios: (1) Query API interface definitions (2) Search for specific function interfaces (3) Query Schema definitions (4) View interface statistics
npx skill4agent add abcfed/claude-marketplace abc-apifox# 设置 Apifox Access Token(必需)
export APIFOX_ACCESS_TOKEN="你的 Apifox Access Token"
# 设置项目 ID(可选,默认为 4105462)
export APIFOX_PROJECT_ID="4105462"# 安装 Python 依赖
pip3 install requests./scripts/apifox <command> [参数]| Command | Description |
|---|---|
| Get interface details (automatically infers module) |
| Get Schema definitions |
| Search interfaces (keyword matching) |
| List all modules |
| Get all interfaces of a module |
| Command | Description |
|---|---|
| Refresh OpenAPI documents |
| View cache status |
| Clear local cache (requires |
# 获取接口详情(自动推断模块)
./scripts/apifox get_path \
--path "/api/v3/goods/stocks/check/orders" \
--method POST
# 获取接口并解析 $ref 引用
./scripts/apifox get_path \
--path "/api/v3/goods/stocks/check/orders" \
--method POST \
--include_refs true# 获取 Schema 定义
./scripts/apifox get_schema --name CreateGoodsStockCheckOrderReq# 搜索盘点相关接口
./scripts/apifox search_paths --keyword "盘点"
# 搜索特定模块的接口
./scripts/apifox search_paths --keyword "库存" --module api.stocks
# 按方法过滤
./scripts/apifox search_paths --keyword "order" --method POST --limit 10# 列出所有模块
./scripts/apifox list_modules
# 获取特定模块的所有接口
./scripts/apifox get_module --module api.stocks# 查看缓存状态
./scripts/apifox status
# 刷新文档(从 Apifox 获取最新数据)
./scripts/apifox refresh_oas
# 清除缓存
./scripts/apifox clear_cache --force{
"success": true,
"data": "返回的数据"
}{
"success": false,
"error": "错误信息"
}User: "View the definition of the inventory check interface"
Claude:
1. ./scripts/apifox search_paths --keyword "盘点"
2. Find the relevant interface path from the results
3. ./scripts/apifox get_path --path "/api/v3/goods/stocks/check/orders" --method POST
4. Analyze the returned request body CreateGoodsStockCheckOrderReq
5. If Schema viewing is needed: ./scripts/apifox get_schema --name CreateGoodsStockCheckOrderReqcache/
├── meta.json # 元数据 + 全局索引
├── modules/ # 按模块拆分的接口数据
│ ├── api.stocks.json # 库存相关接口
│ ├── rpc.advice.json # 医嘱相关接口
│ └── ...
└── schemas/ # Schema 定义缓存(按首字母分组)
├── a.json # A 开头的 Schema
├── b.json
├── ...
└── _.json # 非字母开头的 Schema(中文、数字等)| Path Format | Module Name | Example |
|---|---|---|
| | Inventory Module |
| | Medical Advice Module |
| | Authentication Module |
scripts/
├── apifox # 命令行工具入口
├── apifox.py # Python CLI 实现
├── apifox_client.py # 客户端
├── cache_manager.py # 缓存管理器
├── requirements.txt # Python 依赖
├── check_env.py # 环境检查脚本
└── test_apifox.py # 功能测试脚本# 配置环境变量后首次运行
./scripts/apifox status
# 自动从 Apifox 获取文档并建立缓存
# 正在从 Apifox 获取项目 4105462 的 OpenAPI 文档...
# 正在清空旧缓存...
# 正在按模块拆分接口...
# 正在保存 Schema(分组格式)...
# 导入完成!check_env.pypython3 scripts/check_env.pytest_apifox.pypython3 scripts/test_apifox.pyrequirements.txt# 安装依赖
pip3 install -r scripts/requirements.txt# 1. 修改代码
vim scripts/cache_manager.py
# 2. 运行测试(必须)
python3 scripts/test_apifox.py
# 3. 测试通过后提交
git add scripts/cache_manager.py
git commit -m "fix: ..."check_env.py