Open source · MIT License

API docs that
write themselves

Point GoDoc Live at your Go code. Get production-quality, interactive API documentation. No annotations. No config. No code changes.

$ go install github.com/syst3mctl/godoclive/cmd/godoclive@latest

Documentation preview

GoDoc Live
Users

Get User by ID

GET /api/v1/users/{id}
Parameter Type In
id uuid path required
fields string query optional
Responses
200 User — returns user object with profile details
400 ErrorResponse — invalid ID format
404 ErrorResponse — user not found
Features

Everything your API docs need

Deep static analysis powered by Go's own compiler toolchain. No runtime, no reflection, no annotations.

Zero annotations

No comments, decorators, or struct tags required. GoDoc Live reads your actual handler code and extracts the contract automatically.

Full contract extraction

Path params, query params, headers, request bodies, response status codes, and payload types — all extracted from your handler AST.

Interactive docs UI

Beautiful, self-contained HTML documentation with search, dark mode, and a built-in Try It panel for testing endpoints live.

Auth detection

Automatically identifies JWT bearer, API key, and Basic Auth patterns from your middleware — no config needed.

OpenAPI 3.1.0 export

Generate a standards-compliant OpenAPI spec alongside your docs. JSON or YAML, ready for Postman, Insomnia, or any toolchain.

Live reload

Watch mode with Server-Sent Events. Edit your handler, save, and see updated docs instantly in the browser.

Environment switcher

Switch between local, staging, and production base URLs from a dropdown in the topbar. Curl snippets and the Try It panel update instantly.

Route filtering

Hide or show individual endpoints in the docs UI with a single click. Hidden state persists across page refreshes via localStorage.

godoclive:ignore directive

Add //godoclive:ignore above any route to permanently exclude it from docs. No config files needed — mark it right where you define it.

How it works

Three commands. Zero config.

GoDoc Live uses the Go compiler's own type-checker to understand your code the same way gopls does.

Install

One command. Single binary. No Node, no Python, no dependencies.

# install globally
go install github.com/syst3mctl/godoclive/cmd/godoclive@latest

Generate

Point it at your Go module. GoDoc Live loads, parses, type-checks, and extracts every endpoint.

# generate interactive docs
godoclive generate ./...

# or generate with OpenAPI spec
godoclive generate --openapi ./openapi.json ./...

Ship

Open the docs, share them with your team, or serve them with live reload during development.

# serve with auto-reload
godoclive watch --serve :8080 ./...

# or just open the static file
open docs/index.html
Router support

Works with your stack

Six major Go routers supported out of the box.

chi
go-chi/chi/v5
Supported
gin
gin-gonic/gin
Supported
net/http
Go 1.22+ stdlib
Supported
gorilla/mux
gorilla/mux
Supported
Echo
labstack/echo/v4
Supported
Fiber
gofiber/fiber/v2
Supported
Accuracy

Verified across 50 endpoints

Measured against 12 testdata projects. Powered by go/ast and go/types — the same tools the Go compiler uses.

100%
Route detection
100%
Path params
100%
Query params
100%
Status codes
100%
Auth detection
Programmatic API

Use it as a library

GoDoc Live isn't just a CLI. Import it into your own tools, CI pipelines, or custom doc generators.

Analyze returns structured endpoint data. Generate writes HTML. GenerateOpenAPI writes a spec. Compose them however you need.

import "github.com/syst3mctl/godoclive" // Analyze your project endpoints, err := godoclive.Analyze(".", "./...", godoclive.WithTitle("My API"), ) // Generate HTML docs err = godoclive.Generate(endpoints, godoclive.WithOutput("./api-docs"), godoclive.WithTheme("dark"), ) // Or generate an OpenAPI 3.1.0 spec spec, err := godoclive.GenerateOpenAPI(endpoints, godoclive.WithVersion("v2.1.0"), )
Compare

Why GoDoc Live?

Other tools need you to annotate your code. GoDoc Live reads it.

GoDoc Live swag go-swagger
Zero annotations needed ✓ ✗ ✗
Type-aware analysis ✓ ✗ ✓
Interactive docs UI ✓ ✓ ✗
Live reload ✓ ✗ ✗
OpenAPI 3.1.0 export ✓ 2.0 only 2.0 only
Multi-router support 6 routers gin only custom
Try It panel ✓ ✓ ✗
Auth auto-detection ✓ ✗ ✗
Environment URL switcher ✓ ✗ ✗
Route ignore directive ✓ ✗ ✗
Client-side route filtering ✓ ✗ ✗

Stop writing API docs.
Start generating them.

One install. One command. Beautiful, accurate docs from your existing Go handlers.

$ go install github.com/syst3mctl/godoclive/cmd/godoclive@latest