A package manager that installs and runs Swift command line tool packages.
$ mint run realm/SwiftLint@0.22.0 swiftlintThis would install and run SwiftLint version 0.22.0
Mint is designed to be used with Swift command line tools that build with the Swift Package Manager. It makes installing, running and distributing these tools much easier.
- ✅ builds are cached globally by version
- ✅ easily run a specific version of a tool
- ✅ use different versions of a tool side by side
- ✅ easily run the latest version of a tool
- ✅ distribute your own tools without recipes and formulas
Homebrew is a popular method of distributing Swift executables, but that requires creating a formula and then maintaining that formula. Running specific versions of homebrew installations can also be tricky as only one global version is installed at any one time. Mint installs your tool via SPM and lets you run multiple versions of that tool, which are globally installed and cached on demand.
If your Swift executable package builds with SPM, then it can be run with Mint! See Support for details.
Swift Packager Manager Tools -> SPMT -> Spearmint -> Mint! 🌱😄
Mint: a place where something is produced or manufactured
Make sure Xcode 9 is installed first.
$ brew tap yonaskolb/Mint https://github.com/yonaskolb/Mint.git
$ brew install mint$ git clone https://github.com/yonaskolb/Mint.git
$ cd Mint
$ make$ git clone https://github.com/yonaskolb/Mint.git
$ cd Mint
$ swift run mint install yonaskolb/mint --global$ mint install yonaskolb/mint --globalUse CLI
$ git clone https://github.com/yonaskolb/Mint.git
$ cd Mint
$ swift run mintUse as dependency
Add the following to your Package.swift file's dependencies:
.package(url: "https://github.com/yonaskolb/Mint.git", from: "0.1.0"),And then import wherever needed: import MintKit
Run mint --help to see usage instructions.
- install: Installs a package. If it is already installed this won't do anything
- run: Runs a package. This will install it first if it isn't already installed.
- update: Installs a package while enforcing an update and rebuild. Shouldn't be required unless you are pointing at a branch and want to update it.
- list: Lists all currently installed packages and versions.
- uninstall: Uninstalls a package by name.
Run, install and update commands have 1 or 2 arguments:
- package (required): This can be a shorthand for a github repo
install realm/SwiftLintor a fully qualified git pathinstall https://github.com/realm/SwiftLint.git. In the case ofrunyou can also just pass the name of the repo if it is already installedrun swiftlint. This will do a lookup of all installed packages. An optional version can be specified by appending@version, otherwise the newest tag or master will be used. Note that if you don't specify a version, the current tags must be loaded remotely each time. - command (optional): The command to install or run. This defaults to the the last path in the repo (so for
realm/swiftlintit will beswiftlint). In the case ofrunyou can also pass any arguments to the command egmint run realm/swiftlint swiftlint --path source
$ mint run yonaskolb/XcodeGen@1.2.4 xcodegen --spec spec.yml # pass some arguments
$ mint install yonaskolb/XcodeGen@1.2.4 # use version 1.2.4
$ mint install yonaskolb/XcodeGen # use newest tag
$ mint run yonaskolb/XcodeGen@1.2.4 # run 1.2.4
$ mint run XcodeGen # use newest tag and find XcodeGen in installed toolsMint can also be used to install a package so it is accessible from anywhere. This means you don't have to prepend commands with mint run.
Simply pass --global to mint install or mint update and that version will globally installed.
Note that a mint install path will be added to your $PATH, and that only one global version can be installed at a time. If you need to run a specific older version use mint run.
Note also, that after you install a global version you must launch a new shell to get access the package.
If your Swift command line tool builds with the Swift Package Manager than it will automatically install and run with mint! You can add this to the Installing section in your readme:
### [Mint](https://github.com/yonaskolb/mint)
```
$ mint run github_name/repo_name
```
If your executable name is different from your repo name then you will need to append the name to the above command
The Swift Package Manager doesn't yet have a way of specifying resources directories. If your tool requires access to resources from the repo you require a custom Package.resources file. This is a plain text file that lists the resources directories on different lines:
MyFiles
MyOtherFiles
If this file is found in you repo, then all those directories will be copied into the same path as the executable.
- mint run realm/SwiftLint
- mint run JohnSundell/Marathon
- mint run yonaskolb/XcodeGen
- mint run yonaskolb/SwagGen
- mint run Carthage/Carthage
- mint run krzysztofzablocki/Sourcery
- mint run toshi0383/cmdshelf
Feel free to add your own!

