Files
gh-gorvey-gorvey-claude-plu…/commands/gen-api-code.md
2025-11-29 18:28:43 +08:00

23 lines
919 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
description: 根据接口文档使用mcp生成代码
argument-hint: [yapi-url] [api-path] [type-path]
---
# 参数说明
$ARGUMENTS 中的url参数为yapi的接口文档地址
还需要代码生成后存放的位置,如果用户没有提供,需要提示用户传入
也就是必须要传入接口文件的位置 和 yapi的url
## 注意事项
1. 如果本项目是ts类型的项目则用户需要传入2个位置一个是接口文件的位置一个是接口的ts类型文件的位置
2. 如果本项目是js类型的项目则用户需要传入1接口文件的位置
3. 如果yapi-get-interface-mcp mcp工具调用失败终止流程提示用户检查工具可用性
## 执行步骤
1. 调用 yapi-get-interface-mcp mcp根据接口文档获取接口信息随后获取api的规范 `src\api\CLAUDE.md`
2. 根据接口信息和规范生成代码
3. 将代码存储到用户指定位置