swift-cli

Example of building command-line tools in Swift

Step 1: Create CLI with XCode

swift-ui

Step 2: Use swift-argument-parser package

add-packages

More information on package dependencies: https://developer.apple.com/documentation/swift_packages/adding_package_dependencies_to_your_app

Step 3: Edit scheme and target terminal and add argument

version

Step 4: Test out executable

swift-cli

References

GitHub

View Github