Skip to content

GeorgeLyon/Shwift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

29f9781 · Jan 11, 2022

History

68 Commits
Dec 10, 2021
Jan 11, 2022
Dec 28, 2021
Jan 11, 2022
Dec 4, 2021
Oct 27, 2021
Dec 4, 2021
Dec 4, 2021
Dec 10, 2021
Dec 5, 2021
Dec 4, 2021

Repository files navigation

Shwift

NOTE: Shwift is under active development and functionality may change or break without notice.

Overview

Shwift is a package which provides tools for shell scripting in Swift.

For example, you can write:

try await echo("Foo", "Bar") | sed("s/Bar/Baz")

More capability is demonstrated in the ScriptExample target.

The Shwift library provides some basic building blocks for launching executables and processing their output using builtins. It is built to be non-blocking (thanks to swift-nio), which works really well with the new Swift concurrency features.

The Script library brings these capabilities together with swift-argument-parser for providing a familiar and user-friendly API for writing shell scripts in Swift. For instance, while Shwift provides the basic capability of piping the output of one command to another, Script provides the | operator to do this the way you would in a shell script.