# 使用 Homebrew 安装 swiftgen

查看 swiftgen 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:swiftgen
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install swiftgen
```

  证据: local Homebrew formula metadata

## 软件包事实

- **软件包键:** brew:swiftgen
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/swiftgen>
- **版本:** 6.6.3
- **来源摘要:** Swift code generator for assets, storyboards, Localizable.strings, etc.
- **主页:** <https://github.com/SwiftGen/SwiftGen>
- **仓库:** <https://github.com/SwiftGen/SwiftGen>
- **许可证:** MIT
- **源码归档:** <https://github.com/SwiftGen/SwiftGen/archive/refs/tags/6.6.3.tar.gz>
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- swiftgen (cli)
- swiftgen (别名)

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_monterey, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, monterey, sonoma, ventura

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 6.6.3
- 本地数据: OK
- 上游仓库: https://github.com/SwiftGen/SwiftGen
- 检测到的最新版本: 6.6.3 (当前)
- 信息: No package-manager update timestamp was available.
## 项目历史与用法

SwiftGen is a Swift code generator for project resources such as asset catalogs, localized strings, fonts, Interface Builder files, JSON, YAML, and plists. Its package-manager role is to make resource names type-safe and repeatable in iOS and Swift build pipelines.

### 项目历史

The SwiftGen repository was created in July 2015. Its README presents the project as a generator that removes stringly typed resource lookups by producing Swift constants and APIs from project files.

The project developed around a configuration-first workflow. The documented `swiftgen.yml` file describes parsers, inputs, templates, and outputs, which made SwiftGen easy to pin in repositories and run from Xcode build phases.

### 采用历史

Official installation documentation covers ZIP releases committed into a project, CocoaPods, Homebrew, Mint, and source builds. That set reflects a common Swift tooling pattern: either pin the binary inside the project or install it system-wide through a developer package manager.

The input package facts list Homebrew availability, and GitHub release metadata shows public releases at least as far back as the 0.5.x and 0.6.x series in 2016.

### 使用方式

Common usage is `swiftgen config run` or simply `swiftgen` from a project root containing `swiftgen.yml`. Teams usually run it in an Xcode script phase so generated Swift files stay synchronized with assets and localization files.

SwiftGen is also used directly with parser subcommands when developing templates or testing one resource type, but the README recommends configuration-file usage for normal projects.

### 为什么软件包爱好者会关心

SwiftGen is important to package-oriented Swift workflows because it turns app resources into generated source and therefore has to be versioned like a compiler-adjacent build tool. A different SwiftGen version can change generated APIs, so teams care about pinning and reproducible installation.

It also sits at the intersection of package managers and IDE builds: CocoaPods can install the binary beside dependencies, Homebrew can provide a system command, and checked-in release ZIPs can lock a project to one tool version.

### 时间线

- 2015: GitHub repository created.
- 2016: GitHub release metadata includes 0.5.x and 0.6.x releases.
- 2024: GitHub release metadata lists 6.6.3.

### Related projects

- Related Swift build tools include SwiftLint, SwiftFormat, Stencil templates, CocoaPods, Mint, and Xcode script build phases.

### 来源

- <https://api.github.com/repos/SwiftGen/SwiftGen>
- <https://github.com/SwiftGen/SwiftGen#readme>
- <https://github.com/SwiftGen/SwiftGen/blob/stable/Documentation/ConfigFile.md>
- input.source_facts.package-manager


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- 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: swiftgen.yml
## 源数据库详情

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


## 相关链接

- [Source-control packages](https://pkg.so/zh-hans/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://pkg.so/zh-hans/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://pkg.so/zh-hans/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [rswift](https://pkg.so/zh-hans/brew/rswift/) - Shares pkgdb curated category or tags: cli, code-generation, developer-tools, ios, swift.
- [needle](https://pkg.so/zh-hans/brew/needle/) - Shares pkgdb curated category or tags: cli, code-generation, developer-tools, ios, swift.
- [objc-codegenutils](https://pkg.so/zh-hans/brew/objc-codegenutils/) - Shares pkgdb curated category or tags: cli, code-generation, developer-tools, ios, storyboards.
- [sourcery](https://pkg.so/zh-hans/brew/sourcery/) - Shares pkgdb curated category or tags: cli, code-generation, developer-tools, swift.
- [mockolo](https://pkg.so/zh-hans/brew/mockolo/) - Shares pkgdb curated category or tags: cli, code-generation, developer-tools, swift.
- [carthage](https://pkg.so/zh-hans/brew/carthage/) - Shares pkgdb curated category or tags: cli, developer-tools, ios, swift.
- [bartycrouch](https://pkg.so/zh-hans/brew/bartycrouch/) - Shares pkgdb curated category or tags: cli, developer-tools, localization, swift.
- [mogenerator](https://pkg.so/zh-hans/brew/mogenerator/) - Shares pkgdb curated category or tags: cli, code-generation, developer-tools, swift.

## Combined YAML source

View the package source record on GitHub. [combined/swiftgen.yml](https://github.com/mxcl/pkgdb/blob/main/combined/swiftgen.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- cross-ecosystem install command graph
