Installing the package's executable
How do we install the command line tool we just created? Don't worry, it's simple too. All you need to do is build it with the release configuration, so that it builds a highly optimized binary and also add flags to statically link the Swift standard library. This means that the executable can work even when Swift versions change on your operating system, or if you plan on distributing it on another platform, such as Linux. The following is the command to build the executable command with the release configuration:
$ swift build -c release -Xswiftc -static-stdlib
Once you have the binary built, you need to copy it to one of the directories where binaries are stored in your user path. One such place is /usr/local/bin. To copy it, just run the following command and call your binary file whatever you want. In my case, I chose to rename my command to swiftycat:
$ cp -f .build/release/cat /usr/local/bin/swiftycat
Now, try it out in the Terminal by running the following command:
$ swiftycat Package.swift Sources/cat/main.swift