# Install swift-protobuf with Homebrew, Nix

Plugin and runtime library for using protobuf with Swift. Version 1.38.1 via Homebrew; verified 2026-06-23.

## Install

```sh
sudo av install brew:swift-protobuf
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install swift-protobuf
```

  Evidence: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#protoc-gen-swift
```

  Evidence: nixpkgs package indexes: pkgs/by-name/pr/protoc-gen-swift/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:swift-protobuf
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/swift-protobuf>
- **Version:** 1.38.1
- **Source summary:** Plugin and runtime library for using protobuf with Swift
- **Homepage:** <https://github.com/apple/swift-protobuf>
- **Repository:** <https://github.com/apple/swift-protobuf>
- **Upstream docs:** <https://github.com/apple/swift-protobuf#readme>
- **License:** Apache-2.0
- **Source archive:** <https://github.com/apple/swift-protobuf.git>
- **Last updated:** 2026-06-23T19:48:06Z
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- protoc-gen-swift (cli)
- protoc-gen-swift (alias)

## Dependencies

- protobuf

## 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.38.1
- Package-manager updated: 2026-06-23
- Local data: ok
- Upstream repository: https://github.com/apple/swift-protobuf
- info: No cached GitHub release or tag data was available.
## Project history and usage

Swift Protobuf is Apple's Swift implementation for Protocol Buffers, combining a `protoc` code-generation plugin with the SwiftProtobuf runtime library used by generated Swift code.

### Project history

The public repository was created in 2016, after Swift had become open source. The project joined Google's schema-first Protocol Buffers ecosystem by adding a Swift generator, `protoc-gen-swift`, and an idiomatic Swift runtime for generated types.

### Adoption history

The README documents multiple ways to consume the project: building the plugin with SwiftPM, installing the command-line generator through Homebrew, adding the runtime as a SwiftPM dependency, or consuming it through Xcode or CocoaPods. That mix reflects its dual role as both a CLI tool and a library dependency.

### How it is used

Developers install or build `protoc-gen-swift`, run `protoc --swift_out=...` on `.proto` files, and add the SwiftProtobuf runtime to their Swift package, Xcode project, or CocoaPods project. The official documentation covers plugin behavior, generated-code APIs, internals, and contribution style.

### Why package nerds care

Swift Protobuf matters to package-manager users because it bridges a language-specific package ecosystem with a cross-language serialization format. It gives Swift packages a generated-code workflow that stays compatible with Protocol Buffers used by Java, C++, Python, Objective-C, and other stacks.

### Timeline

- 2016: Public GitHub repository created.
- Current docs: Provides both `protoc-gen-swift` and the SwiftProtobuf runtime library.
- Current docs: Homebrew installs the protobuf compiler and Swift code-generator plugin.

### Related projects

- The README ties Swift Protobuf to Apple's Swift language, Google's Protocol Buffers and `protoc`, Swift Package Manager, Xcode package dependencies, and CocoaPods.

### Sources

- <https://api.github.com/repos/apple/swift-protobuf>
- <https://formulae.brew.sh/api/formula/swift-protobuf.json>
- <https://github.com/apple/swift-protobuf#readme>
- <https://github.com/apple/swift-protobuf/tree/main/Documentation>


## Security Notes

No matching local secret-handling manifest was found for swift-protobuf. Nucleus package metadata is still published here so future coverage has a stable package URL.


## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** swift-protobuf
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Requirements:** xcode
- **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

- Nix - protoc-gen-swift: installed executable or alias match | nixpkgs package indexes: pkgs/by-name/pr/protoc-gen-swift/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## 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.
- [protobuf](https://www.automicvault.com/pkg/brew/protobuf/) - Runtime dependency declared by Homebrew.
- [protoc-gen-grpc-swift](https://www.automicvault.com/pkg/brew/protoc-gen-grpc-swift/) - Popular package that depends on this formula.
- [configen](https://www.automicvault.com/pkg/brew/configen/) - Shares av.db curated category or tags: cli, code-generation, developer-tools, swift.
- [create-api](https://www.automicvault.com/pkg/brew/create-api/) - Shares av.db curated category or tags: cli, code-generation, developer-tools, swift.
- [flatbuffers](https://www.automicvault.com/pkg/brew/flatbuffers/) - Shares av.db curated category or tags: cli, code-generation, developer-tools, serialization.
- [gotests](https://www.automicvault.com/pkg/brew/gotests/) - Shares av.db curated category or tags: cli, code-generation, code-generator, developer-tools.
- [hz](https://www.automicvault.com/pkg/brew/hz/) - Shares av.db curated category or tags: cli, code-generation, developer-tools, protobuf.
- [jsonschema2pojo](https://www.automicvault.com/pkg/brew/jsonschema2pojo/) - Shares av.db curated category or tags: cli, code-generation, code-generator, developer-tools.
- [kaitai-struct-compiler](https://www.automicvault.com/pkg/brew/kaitai-struct-compiler/) - Shares av.db curated category or tags: cli, code-generation, developer-tools, serialization.
- [mockolo](https://www.automicvault.com/pkg/brew/mockolo/) - Shares av.db curated category or tags: cli, code-generation, developer-tools, swift.
- [protoc-gen-doc](https://www.automicvault.com/pkg/brew/protoc-gen-doc/) - Local package facts share a topical domain. Shared terms: cli, code, code-generation, developer, developer-tools.
- [protobuf-c](https://www.automicvault.com/pkg/brew/protobuf-c/) - Local package facts share a topical domain. Shared terms: cli, code, code-generation, developer, developer-tools.

## Combined YAML source

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


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- 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
