# Install swag with Homebrew, zypper

Automatically generate RESTful API documentation with Swagger 2.0 for Go. Version 1.16.6 via Homebrew; verified from local package data.

## Install

```sh
sudo av install brew:swag
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install swag
```

  Evidence: local Homebrew formula metadata

### Linux

- zypper (92%):

```sh
sudo zypper install swag
```

  Evidence: openSUSE Tumbleweed package metadata: swag from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst

## Package facts

- **Package key:** brew:swag
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/swag>
- **Version:** 1.16.6
- **Source summary:** Automatically generate RESTful API documentation with Swagger 2.0 for Go
- **Homepage:** <https://github.com/swaggo/swag>
- **Repository:** <https://github.com/swaggo/swag>
- **Upstream docs:** <https://github.com/swaggo/swag#readme>
- **License:** MIT
- **Source archive:** <https://github.com/swaggo/swag/archive/refs/tags/v1.16.6.tar.gz>
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- swag (cli)
- swag (alias)

## Build dependencies

- go

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 1.16.6
- Local data: ok
- Upstream repository: https://github.com/swaggo/swag
- Upstream latest detected: v1.16.6 (current)
- info: No package-manager update timestamp was available.
## Project history and usage

swag is the Swaggo command-line generator for producing Swagger 2.0 documentation from Go source-code annotations. It became a common Go ecosystem tool because it lets web services generate API docs without leaving the Go build and source layout.

### Project history

The swaggo/swag repository was created on GitHub in June 2017. Its README says Swag converts Go annotations to Swagger Documentation 2.0 and provides plugins for popular Go web frameworks so generated output can be served through Swagger UI.

### Adoption history

The project reached a v1.0.0 release in November 2017 and continued through the v1.x line while publishing binaries, a Docker image, and `go install` instructions. The README lists integrations for Gin, Echo, Buffalo, net/http, gorilla/mux, chi, Fiber, Hertz, and other Go web stacks.

### How it is used

The standard workflow is to add declarative comments to Go handlers, install the `swag` command, and run `swag init` at the project root. The CLI then writes a docs package plus swagger.json and swagger.yaml outputs, with flags for alternate entry files, output directories, parse depth, dependency parsing, and global overrides via `.swaggo`.

### Why package nerds care

swag is package-nerd relevant because it turns API documentation generation into a reproducible build step for Go projects. Distributions and developer package managers care about it as a standalone CLI, while Go users care that the same tool can be installed as a binary, Docker image, or module-aware `go install` target.

### Timeline

- 2017: GitHub repository created.
- 2017: v1.0.0 tag published.
- 2025: v1.16.6 released in the continuing v1 line.
- 2026: v2.0.0 release candidates listed in GitHub releases during research.

### Related projects

- The README points to companion Swagger UI middleware packages such as swaggo/gin-swagger, swaggo/echo-swagger, swaggo/files, and swaggo/http-swagger.

### Sources

- <https://api.github.com/repos/swaggo/swag>
- <https://api.github.com/repos/swaggo/swag/releases>
- <https://github.com/swaggo/swag#readme>
- source_facts.package-manager


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: .swaggo
## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** swag
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- zypper - swag - 1.16.6-1.4: normalized package name match | openSUSE Tumbleweed package metadata: swag from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Automatically generate RESTful API documentation with Swagger 2.0 for Go | https://github.com/swaggo/swag


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [go](https://www.automicvault.com/pkg/brew/go/) - Build dependency declared by Homebrew.
- [swagger2markup-cli](https://www.automicvault.com/pkg/brew/swagger2markup-cli/) - Shares av.db curated category or tags: api, cli, developer-tools, documentation, openapi.
- [redocly-cli](https://www.automicvault.com/pkg/brew/redocly-cli/) - Shares av.db curated category or tags: api, api-documentation, cli, developer-tools, openapi.
- [swagger-codegen](https://www.automicvault.com/pkg/brew/swagger-codegen/) - Shares av.db curated category or tags: api, cli, developer-tools, openapi, swagger.
- [vacuum](https://www.automicvault.com/pkg/brew/vacuum/) - Shares av.db curated category or tags: api, cli, developer-tools, openapi, swagger.
- [cheat](https://www.automicvault.com/pkg/brew/cheat/) - Shares av.db curated category or tags: cli, developer-tools, documentation, go.
- [dasht](https://www.automicvault.com/pkg/brew/dasht/) - Shares av.db curated category or tags: api-documentation, cli, developer-tools, documentation.
- [fern-api](https://www.automicvault.com/pkg/brew/fern-api/) - Shares av.db curated category or tags: api, cli, developer-tools, documentation, openapi.
- [gtree](https://www.automicvault.com/pkg/brew/gtree/) - Shares av.db curated category or tags: cli, developer-tools, documentation, go.
- [action-docs](https://www.automicvault.com/pkg/brew/action-docs/) - Local metadata places this package in an adjacent workflow. Shared terms: cli, developer, developer-tools, documentation, generate.

## Combined YAML source

View the package source record on GitHub. [combined/swag.yml](https://github.com/automic-vault/db/blob/main/combined/swag.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
