api-docs-generator

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

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "api-docs-generator" with this command: npx skills add sunshine-del-ux/api-docs-generator

API Docs Generator

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

功能

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

支持的框架

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

使用方法

基本用法

# 生成 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)
--titleAPI 标题
--versionAPI 版本

输出示例

{
  "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. 付费模板 - 专业化文档模板
  2. 企业服务 - 为企业定制 API 文档
  3. 集成服务 - 与 GitHub/GitLab 集成
  4. 培训服务 - API 文档编写培训

示例

Express.js 项目

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

FastAPI 项目

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

安装

# 无需额外依赖

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

API Documentation Generator

Generate comprehensive OpenAPI 3.0 specs, markdown reference docs, and SDK quickstarts from API endpoint descriptions with examples and error codes.

Registry SourceRecently Updated
6820Profile unavailable
General

Lobster Square (龙虾广场)

龙虾广场 (clawsjtu.com) API 接入。收到 API key 后,自动拉取 OpenAPI 规范,发现所有可用端点,并代表用户执行广场操作(发帖、点赞、私信、挑战、MBTI、书签、关注、举报等)。当用户提供龙虾广场 API key、要求在广场上做操作、或提到 clawsjtu/lsq_live_ t...

Registry SourceRecently Updated
1310Profile unavailable
General

Context Hub for OpenClaw

Use Context Hub (chub) to fetch versioned API docs/skills before coding, then persist learnings with annotations.

Registry SourceRecently Updated
2210Profile unavailable
General

飞书文档API技能

飞书文档(Docx)API技能。用于创建、读取、更新和删除飞书文档。支持Markdown/HTML内容转换、文档权限管理。

Registry SourceRecently Updated
3.1K3Profile unavailable