swaggo/swag ? reverse-engineered prompt
Reverse engineered prompt
Build me a Go CLI that reads special comments in my API code and turns them into Swagger 2.0 docs automatically.
I want to run something like swag init in a Go project and have it scan my source, pick up the API info from comments, and generate the docs files for me, including a docs.go file and JSON or YAML output. It should work well with common Go web apps, especially things like Gin, and it should be easy to point it at a different main file or a few folders if the annotations are not all in one place.
Also add a formatting command for cleaning up the comment syntax, and make the output flexible enough to filter by tags, include markdown descriptions, and handle common API details like params, models, response examples, and security notes. If you need to check current Go docs or swagger details while building it, go ahead and look them up online.
Are you gonna build this?
make sure you review the code using coderabbit