https://github.com/xnth97/assetkit
A command line tool and Swift package for generating image assets for 🍎 platforms.
https://github.com/xnth97/assetkit
asset-management cli command-line-tool icon image-asset ios macos swift swift-package
Last synced: 8 months ago
JSON representation
A command line tool and Swift package for generating image assets for 🍎 platforms.
- Host: GitHub
- URL: https://github.com/xnth97/assetkit
- Owner: xnth97
- License: mit
- Created: 2022-01-08T10:34:29.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-10-12T20:58:26.000Z (over 2 years ago)
- Last Synced: 2025-02-01T20:51:12.245Z (over 1 year ago)
- Topics: asset-management, cli, command-line-tool, icon, image-asset, ios, macos, swift, swift-package
- Language: Swift
- Homepage:
- Size: 1.3 MB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AssetKit
A command line tool and Swift package for generating image assets for Apple platforms.
# GUI
[](https://apps.apple.com/us/app/assetool/id1613455194?l=zh&mt=12)
`Assetool` is a SwiftUI app built on top of `AssetKit`. Free download from Mac App Store.

# CLI
## Installation
### Prebuilt
Please download prebuilt binaries from [Releases](https://github.com/xnth97/AssetKit/releases).
### Build
1. Clone this repo, `cd` into the base directory.
2. Run `swift build -c release`.
3. Binaries are located in `.build/release`.
## Usage
The CLI `assetool` supports subcommands for generating both `.appiconset` and `.imageset`. Default subcommand is `icon`.
### Icon
```
assetool [-o ] [-p ] [--universal]
```
`-o, --output `: Path of the output folder. If empty, will use current path of terminal.
`-p, --platforms `: Valid values are: `ios`, `mac`, `macos`, `watch`, `watchos`. You can also generate an icon set with multiple platform idioms by sending a string of multiple values separated by comma, e.g. `ios,mac,watch`.
`-u, --universal` Generates single size for iOS and watchOS, suited for newer Xcode.
### Image
```
assetool image [-o ] [--width ] [--height ]
```
`--width ` and `--height `: @1x width or height of the exported image set. If empty, will use the original width/height as @3x size.
### OSX Iconset
The `osx-iconset` subcommand generates OS X `.iconset` format. See [Icon Set Type](https://developer.apple.com/library/archive/documentation/Xcode/Reference/xcode_ref-Asset_Catalog_Format/IconSetType.html) for details.
```
assetool osx-iconset [-o ]
```
# Package
## Installation
```swift
dependencies: [
.package(url: "https://github.com/xnth97/AssetKit", from: "1.2.1"),
],
```
## Usage
### Icon
```swift
AssetKit.generateIconSet(
inputPath: input,
outputPath: output,
platforms: [.ios, .mac])
```
### Image
```swift
AssetKit.generateImageSet(
inputPath: input,
outputPath: output,
width: width,
height: height)
```
# License
The project is released under MIT license. Please see [LICENSE](LICENSE) for full terms.