{"repo":"kareman/SwiftShell","free":true,"listed":false,"github":"https://github.com/kareman/SwiftShell","clone":"git clone https://github.com/kareman/SwiftShell.git","description":"A Swift framework for shell scripting.","language":"Swift","stars":1060,"topics":["swift","shell","command-line","script","swift-library"],"license":"MIT","category":"cli-tools","readme_excerpt":"Run shell commands Parse command line arguments Handle files and directories --- Swift 5.1 - 5.3 Swift 4 Swift 3 Swift 2 SwiftShell A library for creating command-line applications and running shell commands in Swift. Features - [x] run commands, and handle the output. - [x] run commands asynchronously, and be notified when output is available. - [x] access the context your application is running in, like environment variables, standard input, standard output, standard error, the current directory and the command line arguments. - [x] create new such contexts you can run commands in. - [x] handle errors. - [x] read and write files. See also - API Documentation. - A description of the project on skilled.io. Table of Contents - Example - Print line numbers - Others - Context - Main context - Example - Streams - WritableStream - ReadableStream - Data - Commands - Run - Print output - Asynchronous - Parameters - Errors - Setup - Stand-alone project - Script file using Marathon - Swift Package Manager - Carthage - CocoaPods - License Example Print line numbers Launched with e.g. cat long.txt print linenumbers.swift or print linenumbers.swift long.txt this will print the line number at the beginning of each line. Others - [Test the latest commit (using make and/or Swift).][testcommit] - Run a shell command in the middle of a method chain. - Move files to the trash. [testcommit]: https://github.com/kareman/testcommit/blob/master/Sources/main.swift Context All commands (a.k.a. [proce","default_branch":null,"files":null,"tree":[],"storefront":"/r/kareman","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/kareman/SwiftShell/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}