OverviewHistoryStatsSecurity
npx skills add ...
Documentation
SKILL.md
npx skills add apifox.com/apifox-cli-checkup
Apifox CLI 使用检查与版本确认:命令成功但页面没看到、创建后 list/get 找不到、测试运行失败、报告缺失、agentHints/help/实际行为不一致,或怀疑本机 CLI 版本不是最新时使用。
npx skills add apifox.com/apifox-cli-checkup
前置条件:先阅读
../apifox-cli/SKILL.md。若旧总入口与本 skill 的规则冲突,以当前apifox <command> --help和本 skill 为准。根据资源类型再读取对应业务 skill。
本 skill 用于公开 CLI 使用排查,不依赖内部接口或内部代码。目标是确认命令、项目、分支、环境、资源 ID、报告位置和 CLI 版本是否一致,再回到具体业务 skill 修正资源结构。Agent 排查时优先以当前 help、schema validate、get 回读和 agentHints 组成闭环,不要只看 summary 文案。
list/get 找不到资源。agentHints、help、示例或实际命令行为互相矛盾。--api-base-url。apifox --version,确认本机 CLI 版本;参数不存在时先看是否需要更新。apifox <command> --help,以当前公开 help 为准,不凭旧文档或记忆使用参数。list/get 回读资源,确认是否写入了预期项目、分支、模块、目录或分类。--upload-report 时,不要去云端报告列表找本次结果。先看版本和命令 help:
如果测试说明里要求的新参数没有出现在 help 中,优先更新 CLI:
非交互环境或确认直接更新时:
如果自动更新提示影响排查,可以让用户在 shell 配置里设置禁用每日检查,但这不会影响手动 apifox update:
版本排查结论必须写清:当前 apifox --version、命令路径(如 which apifox)、缺失的参数名、建议更新方式。
apifox <command> --help 和实测为准。success=false 时以真实 success 字段和退出码为准,不要相信 summary 里的成功语义。优先检查:
--branch。categoryId。常用回读命令:
如果 get/list 能看到,但页面看不到,先确认页面筛选条件、分支、模块、目录、分类是否一致;不要直接重建资源。
apifox test-case category --project <projectId> 获取有效 categoryId。test-case category 不支持 --endpoint;按接口查看用例用 test-case list --endpoint <endpointId>。test-case get 能看到结构,只说明资源已保存,不代表 requestBody、断言、提取变量和脚本一定能运行。test-scenario create 只创建场景元数据;复杂步骤需要后续 import-steps、add-ref 或 update --file。test-scenario get --with-case-detail,确认步骤树和 HTTP 详情展开正常。test-case 的结构直接写成 test-scenario 步骤。--environment 时,服务端可能使用项目默认环境;为了复现,建议显式指定。--out-dir 和 --out-file。--upload-report,云端 test-report list/get/download 才能看到本次报告。| 现象 | 处理 |
|---|---|
| 新参数不识别 | apifox --version、which apifox,必要时 apifox update --yes |
| 创建成功但页面没看到 | 检查 project、branch、模块、目录、分类、页面筛选 |
| test-case 页面看不到 | 检查 categoryId、endpoint、branch;用 test-case list --endpoint 回读 |
| 场景步骤不展示 | test-scenario get --with-case-detail,确认 create 后是否真正写入 steps |
| run-config 或运行前失败 | 确认 case/scenario/endpoint/environment/branch 都存在且一致 |
| 云端报告找不到 | 确认运行时是否带 --upload-report |
| agentHints 和 help 冲突 | 以当前 help 和实测为准,记录提示问题 |
apifox endpoint list --project <projectId> --branch <branchName>
apifox test-case list --project <projectId> --endpoint <endpointId> --branch <branchName>
apifox test-scenario get <scenarioId> --project <projectId> --branch <branchName> --with-case-detail