Contents

tannerdsilva/swiftslash

Dependency-free, high-performance concurrent shell framework for Swift 6.0+

πŸ“š Documentation

Full DocC documentation is available at swiftslash.com/documentation.

πŸ”Œ Bring Your Own Data Channels

Don't want SwiftSlash's built-in stdio pipeline for a given process? Hand it a file descriptor you already own β€” SwiftNIO, sockets, PTYs, or anything else β€” and SwiftSlash binds it to the child and stays out of the data path entirely. Reaping and cancellation remain fully intact.

import Foundation
import SwiftSlash

let pipe = Pipe()
let child = ChildProcess(
    try Command("/bin/cat"),
    dataChannels: [
        STDIN_FILENO: .read(.byo(fd: .init(rawValue: pipe.fileHandleForReading.fileDescriptor))),
        STDOUT_FILENO: .write(.byo(fd: .init(rawValue: pipe.fileHandleForWriting.fileDescriptor))),
        STDERR_FILENO: .write(.byo(fd: .init(rawValue: pipe.fileHandleForWriting.fileDescriptor)))
    ]
)
async let exit = child.run()
// ... drive `pipe` with SwiftNIO (or anything else) β€” SwiftSlash never touches it.

See the BYO Data Channels article for the full ownership contract.

🀝 Contributing

We welcome bug reports, feature requests, and pull requests.

πŸ“„ License

SwiftSlash is released under the MIT License. See LICENSE for details.

πŸ“¬ Contact

Stay up to date or ask questions on Twitter: @tannerdsilva

Package Metadata

Repository: tannerdsilva/swiftslash

Default branch: master

README: README.md