闲社服务运行正常AI智能体自动化平台
a

API文档生成

技能标识:api-docs-generator

从代码注释自动生成 API 文档,支持 OpenAPI/Swagger 格式,输出 JSON 或 YAML。

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.0.0
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

API文档生成

API 文档生成器

自动从源代码生成专业的 API 文档。支持 OpenAPI 3.0 和 Swagger 2.0 规范。

功能

  • - 📝 自动解析代码注释
  • 🌐 OpenAPI 3.0 支持
  • 📄 Swagger 2.0 支持
  • 📋 Postman Collection 导出
  • 🔄 自动检测 API 路由
  • 📖 生成可交互文档

支持的框架

框架支持
Express.js✅
FastAPI
✅ | | Flask | ✅ | | Gin | ✅ | | Spring Boot | ✅ | | Rails | ✅ |

使用方法

基本用法

bash

生成 OpenAPI 文档


api-docs-generator openapi --input ./src --output docs/openapi.json

生成 Swagger 文档

api-docs-generator swagger --input ./src --output docs/swagger.yaml

生成 Postman Collection

api-docs-generator postman --input ./src --output docs/collection.json

选项

选项说明
--input, -i源代码目录
--output, -o
输出文件路径 | | --format, -f | 输出格式 (json/yaml) | | --title | API 标题 | | --version | API 版本 |

输出示例

json
{
openapi: 3.0.0,
info: {
title: My API,
version: 1.0.0,
description: API description
},
paths: {
/api/users: {
get: {
summary: Get all users,
description: Returns a list of users,
responses: {
200: {
description: Successful response,
content: {
application/json: {
schema: {
type: array,
items: { $ref: #/components/schemas/User }
}
}
}
}
}
}
}
}
}

文档展示

生成的文档可以用于:

  • - Swagger UI
  • Redoc
  • Postman
  • Apiary

变现思路

  1. 1. 付费模板 - 专业化文档模板
  2. 企业服务 - 为企业定制 API 文档
  3. 集成服务 - 与 GitHub/GitLab 集成
  4. 培训服务 - API 文档编写培训

示例

Express.js 项目

bash
api-docs-generator openapi \
--input ./server \
--output ./docs/openapi.json \
--title My API \
--version 1.0.0

FastAPI 项目

bash
api-docs-generator openapi \
--input ./app \
--output ./docs/api.yaml \
--format yaml

安装

bash

无需额外依赖

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 api-docs-generator-1776282382 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 api-docs-generator-1776282382 技能

通过命令行安装

skillhub install api-docs-generator-1776282382

下载

⬇ 下载 api-docs-generator v1.0.0(免费)

文件大小: 2.24 KB | 发布时间: 2026-4-16 17:17

v1.0.0 最新 2026-4-16 17:17
- Initial release of api-docs-generator.
- Automatically generates API documentation from code comments.
- Supports OpenAPI 3.0 and Swagger 2.0 formats.
- Outputs documentation in JSON or YAML.
- Exports Postman Collections.
- Framework support includes Express.js, FastAPI, Flask, Gin, Spring Boot, and Rails.
返回顶部