Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/JohnSundell/SwiftScripting

A list of Swift scripting tools, frameworks & examples
https://github.com/JohnSundell/SwiftScripting

frameworks list scripting swift swift-script tools xcode

Last synced: about 1 month ago
JSON representation

A list of Swift scripting tools, frameworks & examples

Awesome Lists containing this project

README

        

⚠️ **NO LONGER MAINTAINED** This list is no longer kept up to date, so some of its information may no longer be relevant.

# Swift scripting resources

This is a list of tools, frameworks & examples that you might find useful when scripting in Swift 🚀

## Index

- [Tools](#tools)
- [Frameworks](#frameworks)
- [Examples](#examples)
- [Contributing](#contributing)

## Tools

### [Marathon](https://github.com/johnsundell/marathon)

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.

### [PackageBuilder](https://github.com/pixyzehn/PackageBuilder)

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.

### [Swift Package Manager](https://github.com/apple/swift-package-manager)

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.

## Frameworks

*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.*

### [Commandant](https://github.com/Carthage/Commandant)

Commandant is a Swift framework for parsing command-line arguments, inspired by Argo (which is, in turn, inspired by the Haskell library Aeson).

### [Commander](https://github.com/kylef/Commander)

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.

### [CommandLineKit](https://github.com/jatoben/CommandLine)

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.

### [Files](https://github.com/johnsundell/files)

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.

### [Guaka](https://github.com/oarrabi/Guaka)

Guaka helps you create modern and familiar CLI apps in the vein of widely used projects such as: Docker, Kubernetes, OpenShift, Hugo and more.

### [Guitar](https://github.com/artsabintsev/guitar)

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.

### [Rainbow](https://github.com/onevcat/Rainbow)

Delightful console output for Swift developers. Rainbow makes it easy to color the text your script outputs on the command line.

### [Releases](https://github.com/johnsundell/releases)

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.

### [ShellOut](https://github.com/johnsundell/shellout)

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.

### [Swiftline](https://github.com/oarrabi/Swiftline)

Swiftline is a set of tools to help you create command line applications.

### [SwiftShell](https://github.com/kareman/SwiftShell)

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.

### [Xgen](https://github.com/johnsundell/xgen)

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.

## Examples

### [Carting](https://github.com/artemnovichkov/Carting)

Carting is a simple tool for updating Carthage Build Phase.

### [Marathon Examples](https://github.com/johnsundell/marathon-examples)

A collection of example Swift scripts that can easily be run using Marathon.

### [Playground](https://github.com/JohnSundell/Playground)

Instantly create Swift playgrounds from the command line.

### [Selenops](https://github.com/zntfdr/Selenops)

A stupid simple Swift Web Crawler.

### [TestDrive](https://github.com/johnsundell/testdrive)

Quickly try out any Swift pod or framework in a playground.

## Contributing

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:

- You can totally add your own creations.
- Only add things that are open source, and that are generally useful for Swift scripting.
- Don't add general Swift frameworks such as JSON mappers or networking libraries (there are other lists for that).
- Keep the list in alphabetical order.
- Follow the same style as for the other entries.
- No more than 2 lines of description for each entry.

Looking forward to your contributions and seeing this list grow! 🎉