Ecosyste.ms: Awesome

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

https://github.com/artemnovichkov/Swift-For-Scripting

📋A hand-curated collection of useful and informative Swift Scripting materials.
https://github.com/artemnovichkov/Swift-For-Scripting

cli command-line scripting swift swift-script

Last synced: about 2 months ago
JSON representation

📋A hand-curated collection of useful and informative Swift Scripting materials.

Lists

README

        





Articles Videos

## Articles

### [Introducing swiftly, a new Swift toolchain installer and manager](https://forums.swift.org/t/introducing-swiftly-a-new-swift-toolchain-installer-and-manager/67254)
by [Patrick Freed](https://twitter.com/_patrick_freed_)

---

### [How to Use Stable Diffusion to Generate Images with Swift CLI](https://www.appcoda.com/stable-diffusion-swift-cli/)
by [AppCoda](https://twitter.com/appcodamobile)

---

### [How to make an interactive picker for a Swift command-line tool](https://www.polpiella.dev/how-to-make-an-interactive-picker-for-a-swift-command-line-tool)
by [Pol Piella](https://twitter.com/polpielladev)

---

### [swift -e runs code directly from the command line](https://blog.eidinger.info/swift-e-runs-code-directly-from-the-command-line)
by [Marco Eidinger](https://twitter.com/MarcoEidinger)

---

### [How to read passwords and sensitive data from the command-line using Swift](https://rderik.com/blog/how-to-read-passwords-and-sensitive-data-from-the-command-line-using-swift/)
by [RDerik](https://twitter.com/rderik)

---

### [Creating iOS Application Icons with SwiftUI](https://www.enekoalonso.com/articles/creating-ios-application-icons-with-swiftui)
by [Eneko Alonso](https://twitter.com/eneko)

An interesting way to use SwiftUI with CLI for icon generation.

---

### [Announcing ArgumentParser](https://swift.org/blog/argument-parser/)
by [Nate Cook](https://twitter.com/nnnnnnnn/)

Swift team have released type-safe argument parsing framework.

---
### [The Ultimate Guide To Swift Executables 🚀](https://www.fivestars.blog/code/ultimate-guide-swift-executables.html)
by [Federico Zanetello](https://twitter.com/zntfdr)

Just as described in the name of the article.

---
### [Creating a command line tool using the Swift Package Manager](https://www.avanderlee.com/swift/command-line-tool-package-manager)
by [Antoine v.d. SwiftLee](https://twitter.com/twannl)

Basic guide about SPM tools with simple one-command installation.

---
### [Command-line argument parsing using Swift Package Manager's SPMUtility module](https://rderik.com/blog/command-line-argument-parsing-using-swift-package-manager-s/)
by [Derik Ramirez](https://twitter.com/rderik)

The article contains a detailed example of generation Bash/Zsh autocomletion for SPM projects.

---
### [Using Swift for scripting](https://rderik.com/blog/using-swift-for-scripting/)
by [Derik Ramirez](https://twitter.com/rderik)

Good article to start with scripting.

---
### [A RunLoop for your Swift script](https://alejandromp.com/blog/2019/01/19/a-runloop-for-your-swift-script/)
by [Alejandro Martinez](https://twitter.com/alexito4)

Using async operations in your scripts is simpler than you think.

---
### [swift-sh](https://nshipster.com/swift-sh/)
by [Mattt](https://twitter.com/mattt)

An article about a project that adds dependencies to your scripts.

---
### [Swift Tip: Using AppKit from the Command-line](https://www.objc.io/blog/2018/10/02/using-appkit-from-the-command-line/)
by [objc.io](https://twitter.com/objcio)

Explanation of using GUI in your Swift scripts.

---
### [Apple's new Utility library will power up command-line apps](https://www.hackingwithswift.com/articles/44/apple-s-new-utility-library-will-power-up-command-line-apps)
by [Paul Hudson](https://twitter.com/twostraws)

Examples of using Utility framework. `ArgumentParser` and `TerminalController` are really useful.

---
### [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?rq=package)
by [John Sundell](https://twitter.com/johnsundell)

Personally my favorite article. In format of tutorial with recommendations based on real experience.

---
### [Scripting and Compiling Swift on the Command Line](http://jblevins.org/log/swift)
by [Jason Blevins](https://twitter.com/jrblevin)

A simple introduction to Swift Scripting with Fibonacci Sequence.

---
### [Introduction to the Swift REPL](https://developer.apple.com/swift/blog/?id=18)
by Apple

Interactive Swift sessions right in your console.

---
### [Command Line Swift](http://www.russbishop.net/command-line-swift)
by [Russ Bishop](https://twitter.com/xenadu02)

Working with different toolchains. Might be helpful for Server-side Swift projects 🤔

---
### [Command Line Programs on macOS Tutorial](https://www.raywenderlich.com/163134/command-line-programs-macos-tutorial-2)
by [Eric A. Soto](https://twitter.com/ericwastaken)

Step-by-step tutorial with output streams, command-line arguments, and interactive input.

---
### [Swift Package Manager macOS deployment target override](https://oleb.net/blog/2017/04/swift-3-1-package-manager-deployment-target/)
by [Ole Begemann](https://twitter.com/olebegemann)

As you can understand from the title, the author writes about deployment target overriding in Swift Script project.

---
### [Handling Commands with Swift Package Manager ArgumentParser](http://www.enekoalonso.com/articles/handling-commands-with-swift-package-manager)
by [Eneko Alonso](https://twitter.com/eneko)

Want to use `ArgumentParser` like a pro? You should definitely read this.

---
### [How to fuzz-test a Swift package](https://loic.land/2018/04/06/fuzzing.html)
by [Loïc Lecrenier](https://twitter.com/loiclec)

Advanced technique of SPM package testing - fuzz-testing via libFuzzer.

---
### [How to Build Swift Compiler-Based Tool? The Step-by-Step Guide](https://www.polidea.com/blog/how-to-build-swift-compiler-based-tool-the-step-by-step-guide/)
by [Krzysztof Siejkowski](https://twitter.com/_siejkowski)

Awesome guide about using Swift compiler in your CLI tools.

## Videos
### [UIKonf 2020 - Federico Zanetello - Swift Scripts: Zero to Hero](https://youtu.be/KbwmvThZUDM)
by [Federico Zanetello](https://twitter.com/zntfdr)

Every iOS/macOS developer uses (scripting) tools such as fastlane and swiftLint to automate tasks as much work as possible: in this talk we will dive into how we can build our own Swift scripts.

---
### [Scripting in Swift For a Testable Build](https://youtu.be/tohaS-UYTYg)
by [Ellen Shapiro](https://twitter.com/designatednerd)

Underlying many large iOS projects is a tangled nest of bash scripts that developers are often afraid to touch for fear of breaking something, and which is littered with print statements from generations of developers trying to figure out how on earth it works. How can we move away from this mess and to something more sustainable? Ellen will discuss moving a codebase like this to a command line tool that can be called from a Swift script, and which can be tested and breakpointed, and just might save a tiny bit of your sanity.

---
### [Swift scripting in practice](https://youtu.be/_8hQA67n04E)
by [John Sundell](https://twitter.com/johnsundell)

Awesome talk by open-source ninja. Contains real-world cases, good points, and live demo.

---
### [Swift Scripting Redux: Localization](https://news.realm.io/news/altconf-ayaka-nonaka-swift-scripting-redux-localization/)
by [Ayaka Nonaka](https://twitter.com/ayanonagon)

Mix of Swift Scripting and Localization.

---
### [Swift Scripting](https://news.realm.io/news/swift-scripting/)
by [Ayaka Nonaka](https://twitter.com/ayanonagon)

Old but good talk. Pay attention to Dependency Management section.

## Author

Artem Novichkov, https://www.artemnovichkov.com/about