├── LICENSE └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 John Sundell 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ⚠️ **NO LONGER MAINTAINED** This list is no longer kept up to date, so some of its information may no longer be relevant. 2 | 3 | # Swift scripting resources 4 | 5 | This is a list of tools, frameworks & examples that you might find useful when scripting in Swift 🚀 6 | 7 | ## Index 8 | 9 | - [Tools](#tools) 10 | - [Frameworks](#frameworks) 11 | - [Examples](#examples) 12 | - [Contributing](#contributing) 13 | 14 | ## Tools 15 | 16 | ### [Marathon](https://github.com/johnsundell/marathon) 17 | 18 | Marathon makes it easy to write, run and manage your Swift scripts. Quickly create, edit, run, install & share your scripts, and easily add dependencies to them. 19 | 20 | ### [PackageBuilder](https://github.com/pixyzehn/PackageBuilder) 21 | 22 | PackageBuilder builds a simple command-line structure using SPM. The structure follows the approach described in [Building a command line tool using the Swift Package Manager](https://www.swiftbysundell.com/posts/building-a-command-line-tool-using-the-swift-package-manager) separating your code between a framework and the executable. 23 | 24 | ### [Swift Package Manager](https://github.com/apple/swift-package-manager) 25 | 26 | The Package Manager for the Swift Programming Language. Using it you can manage your dependencies + compile & run your scripts. Also enables you to generate Xcode projects for your scripts. 27 | 28 | ## Frameworks 29 | 30 | *While most Swift frameworks can be used in scripts, the ones in this list are particularily useful in tasks that are common when doing Swift scripting.* 31 | 32 | ### [Commandant](https://github.com/Carthage/Commandant) 33 | 34 | Commandant is a Swift framework for parsing command-line arguments, inspired by Argo (which is, in turn, inspired by the Haskell library Aeson). 35 | 36 | ### [Commander](https://github.com/kylef/Commander) 37 | 38 | Commander is a small Swift framework allowing you to craft beautiful command line interfaces in a composable way. Accept input in a type safe way with great error handling and provide descriptions for your arguments. 39 | 40 | ### [CommandLineKit](https://github.com/jatoben/CommandLine) 41 | 42 | A pure Swift library for creating command-line interfaces. Using it, you can easily accept parameters & flags in your scripts, and print help messages & usage instructions for them. 43 | 44 | ### [Files](https://github.com/johnsundell/files) 45 | 46 | A nicer way to handle files & folders in Swift. Files gives you an object-oriented API around the file system, making it easy to create, move, rename and handle files & folders in a script. 47 | 48 | ### [Guaka](https://github.com/oarrabi/Guaka) 49 | 50 | Guaka helps you create modern and familiar CLI apps in the vein of widely used projects such as: Docker, Kubernetes, OpenShift, Hugo and more. 51 | 52 | ### [Guitar](https://github.com/artsabintsev/guitar) 53 | 54 | A Cross-Platform String and Regular Expression Library Written in Swift. Makes it easier to handle strings (such as input) in your scripts, evaluate regular expressions on them, transform them, and more. 55 | 56 | ### [Rainbow](https://github.com/onevcat/Rainbow) 57 | 58 | Delightful console output for Swift developers. Rainbow makes it easy to color the text your script outputs on the command line. 59 | 60 | ### [Releases](https://github.com/johnsundell/releases) 61 | 62 | A Swift package for resolving released versions from a Git repository. Enables you to easily build tooling around Git versions. Resolve, sort & filter versions for both remote & local repositories. 63 | 64 | ### [ShellOut](https://github.com/johnsundell/shellout) 65 | 66 | Easily run shell commands from a Swift script or command line tool. Gives you a simple function that enables you to "shell out" and run tasks on the command line from your scripts. 67 | 68 | ### [Swiftline](https://github.com/oarrabi/Swiftline) 69 | 70 | Swiftline is a set of tools to help you create command line applications. 71 | 72 | ### [SwiftShell](https://github.com/kareman/SwiftShell) 73 | 74 | A library for creating command-line applications and running shell commands in Swift. It provides features such as running asynchronous tasks, handling contexts & errors and managing input & output. 75 | 76 | ### [Xgen](https://github.com/johnsundell/xgen) 77 | 78 | A Swift package for generating Xcode workspaces & playgrounds. Using it, you can build developer tools & scripts that generates workspaces for your projects, or playgrounds for quick prototyping. 79 | 80 | ## Examples 81 | 82 | ### [Carting](https://github.com/artemnovichkov/Carting) 83 | 84 | Carting is a simple tool for updating Carthage Build Phase. 85 | 86 | ### [Marathon Examples](https://github.com/johnsundell/marathon-examples) 87 | 88 | A collection of example Swift scripts that can easily be run using Marathon. 89 | 90 | ### [Playground](https://github.com/JohnSundell/Playground) 91 | 92 | Instantly create Swift playgrounds from the command line. 93 | 94 | ### [Selenops](https://github.com/zntfdr/Selenops) 95 | 96 | A stupid simple Swift Web Crawler. 97 | 98 | ### [TestDrive](https://github.com/johnsundell/testdrive) 99 | 100 | Quickly try out any Swift pod or framework in a playground. 101 | 102 | ## Contributing 103 | 104 | This list is still in its early days, so a lot of awesome stuff is sure to be missing. If you know of a tool, framework or example that should be on this list - [**add it and open a PR**](https://github.com/JohnSundell/SwiftScripting/edit/master/README.md)! 👍 Before you do though, here are some quick guidelines: 105 | 106 | - You can totally add your own creations. 107 | - Only add things that are open source, and that are generally useful for Swift scripting. 108 | - Don't add general Swift frameworks such as JSON mappers or networking libraries (there are other lists for that). 109 | - Keep the list in alphabetical order. 110 | - Follow the same style as for the other entries. 111 | - No more than 2 lines of description for each entry. 112 | 113 | Looking forward to your contributions and seeing this list grow! 🎉 114 | --------------------------------------------------------------------------------