https://github.com/marinofelipe/swift-package-info
Swift CLI tool that provides information about a Swift Package
https://github.com/marinofelipe/swift-package-info
binary-size command-line-tool swift swift-package-manager swiftpackage
Last synced: 7 months ago
JSON representation
Swift CLI tool that provides information about a Swift Package
- Host: GitHub
- URL: https://github.com/marinofelipe/swift-package-info
- Owner: marinofelipe
- License: mit
- Created: 2020-12-26T15:36:08.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-10-16T23:36:29.000Z (8 months ago)
- Last Synced: 2025-10-21T09:57:13.670Z (7 months ago)
- Topics: binary-size, command-line-tool, swift, swift-package-manager, swiftpackage
- Language: Swift
- Homepage:
- Size: 2.49 MB
- Stars: 82
- Watchers: 3
- Forks: 8
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README


[](https://github.com/marinofelipe/swift-package-info#installation)
[](https://swift.org/package-manager/)
[](https://twitter.com/_marinofelipe)
# Swift Package Info
CLI tool, built on top of [Swift Argument Parser](https://github.com/apple/swift-argument-parser), that provides information about a *given Swift Package product*, such as a *measurement of its binary size impact*.
Binary size calculation is also available _as a library_ via the _`SwiftPackageInfo` package product_.
## Usage
### Examples
- Run a complete analysis
```sh
swift-package-info --for https://github.com/ReactiveX/RxSwift -v 6.0.0 --product RxSwift
```
- Check supported platforms (sub command)
```sh
swift-package-info platforms --for https://github.com/krzyzanowskim/CryptoSwift -v 1.3.8 --product CryptoSwift
```
- See the binary size of a local package (e.g., under development framework)
```sh
swift-package-info binary-size --path ../project/my-framework
```
### Report
```sh
swift-package-info --for https://github.com/ReactiveX/RxSwift -v 6.0.0 --product RxSwift
```
```
+------------------------------------------------+
| Swift Package Info |
| |
| RxSwift, 6.0.0 |
+--------------+---------------------------------+
| Provider | Results |
+--------------+---------------------------------+
| Binary Size | Binary size increases by 963 KB |
| Platforms | System default |
| Dependencies | No third-party dependencies :) |
+--------------+---------------------------------+
> Total of 3 providers used.
```
A custom report strategy can be passed via the `report` argument _(check `--help` for supported values)_
```sh
swift-package-info --for https://github.com/ReactiveX/RxSwift -v 6.0.0 --product RxSwift --report jsonDump
```
```JSON
{
"binarySize" : {
"amount" : 962560,
"formatted" : "963 KB"
},
"dependencies" : [
],
"platforms" : {
}
}
```
## Requirements
- Swift >= 6.1
- Xcode >= 16.4
## Installation
* Install [mint](https://github.com/yonaskolb/Mint)
* _Optionally_ [add mint to your $PATH](https://github.com/yonaskolb/Mint?tab=readme-ov-file#linking)
* Run: `mint install marinofelipe/swift-package-info` to install the latest version
## Running
* `mint run swift-package-info`
* or simply, `swift-package-info` in case it was symlinked
## Binary size report
Its methodology is inspired by [cocoapods-size](https://github.com/google/cocoapods-size), and thus works by comparing archives with no bitcode and ARM64 arch.
Such a strategy has proven consistent with the size of iOS apps downloaded and installed via TestFlight.
## Thanks
Special thanks to [@unnamedd](https://github.com/unnamedd) for sharing his experience with [swift-tools-support-core](https://github.com/apple/swift-tools-support-core) and on how to build a pretty 👌 report.
## Contributing
Check the [CONTRIBUTING.md](./CONTRIBUTING.md) file.