{"id":17923151,"url":"https://github.com/rogerluan/swish","last_synced_at":"2025-10-04T09:16:17.038Z","repository":{"id":102915930,"uuid":"268416798","full_name":"rogerluan/Swish","owner":"rogerluan","description":"Swift Shell - Execute arbitrary shell scripts from your Swift scripts, including bundler and fastlane.","archived":false,"fork":false,"pushed_at":"2020-06-01T19:55:01.000Z","size":16,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T11:15:16.858Z","etag":null,"topics":["bundler","fastlane","script","spm","swift","swift-package-manager"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rogerluan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-01T03:32:36.000Z","updated_at":"2023-10-02T04:41:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"4f050bce-d197-4567-90d2-7f6208584856","html_url":"https://github.com/rogerluan/Swish","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rogerluan/Swish","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogerluan%2FSwish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogerluan%2FSwish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogerluan%2FSwish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogerluan%2FSwish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rogerluan","download_url":"https://codeload.github.com/rogerluan/Swish/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogerluan%2FSwish/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278291062,"owners_count":25962679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bundler","fastlane","script","spm","swift","swift-package-manager"],"created_at":"2024-10-28T20:42:20.297Z","updated_at":"2025-10-04T09:16:17.023Z","avatar_url":"https://github.com/rogerluan.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swish - Swift Shell\n##### Execute shell scripts from your Swift scripts.\n\nIf you've been into scripting in Swift for awhile, you noticed that you can get rid of most of the basic shell scripting commands, but sometimes you still need to access certain shell commands, or want to create wrappers around CLI such as fastlane and bundler.\n\nThis package solves the issues where your Swift script can't find the same executables as your regular shell.\n\nWith Swish, you can run bundler and fastlane from Swift scripts, as well as any arbitrary shell script, effortlessly.\n\n## Installation\n\nSwish is available via Swift Package Manager.\nYou can import it by modifying your Package.swift, adding Swish to your packade dependencies:\n\n```\n…\ndependencies: [\n    …\n    .package(url: \"https://github.com/rogerluan/Swish\", from: \"0.1.0\"),\n],\ntargets: [\n    .target(\n        …\n        dependencies: [\n            …\n            \"Swish\",\n            ]\n        ),\n    …\n]\n```\n\n## Usage\n\n#### Single Command\n\n```swift\nsh(launchPath: \"/bin/zsh\", arguments: \"echo\", \"Hello\", \"World\")\n```\n\n#### Full script\n\n###### With no arguments\n\n```swift\nexecute(shellScript:\n    \"\"\"\n    #!/bin/sh\n    echo Hello World\n    \"\"\", arguments: \"\")\n// Hello World\n```\n\n###### With arguments\n\n```swift\nexecute(shellScript:\n    \"\"\"\n    #!/bin/sh\n    echo \"$1 $2\"\n    \"\"\", arguments: \"Roger that\")\n// Roger that\n```\n\n###### Quoted arguments\n\n```swift\nexecute(shellScript:\n    \"\"\"\n    #!/bin/sh\n    echo \"$1\"\n    \"\"\", arguments: #\"\"Roger that\"\"#)\n// Roger that\n```\n\n#### Fastlane\n\nExecutes fastlane, first attempting to execute it via `bundler` and, if not possible, it looks for the fastlane binary installed globally in your system by looking up the `PATH` environment variable.\n\n```swift\nfastlane(\"[lane]\", \"key:value\", \"key2:value2\")\n```\n\n```swift\nfastlane(\"deploy\", \"submit:false\", \"build_number:24\")\n```\n\n#### Bundler\n\nExecutes `bundle exec` using the bundler executable indicated by your environment `PATH` variable.\n\n```swift\nbundleExec(\"fastlane\", \"deploy\", \"submit:false\", \"build_number:24\")\n```\n\n```swift\nbundleExec(\"jazzy\", \"--clean\", \"--output\", \"docs/swift\", \"--theme\", \"fullwidth\")\n```\n\n## Design details\n\n##### Global Scope\n\nAt first I was concerned about releasing these set of utilities in the global scope, but it might actually make sense. Still on the fence, but if you're facing issues (such as collisions or lack of clarity), you can always namespace under _Swish_ module name.\n\n##### Forwarding Stdout\n\nI decided to remove the capture/forwarding of the standard and error outputs because you shouldn't need to manipulate them. If your script needs to read the output of a bash script, you can probably perform the same task using pure Swift instead.\n\nAlso, if you execute programs that print an asynchronous stream of text, if you override stdout, you will only be able to capture the first blast of the stream (for example the first line), instead of the entire stream.\n\nIf you have issues with this design, I'm happy to discuss and adjust this as needed, maybe allowing further customization.\n\n## Contact\n\n[@rogerluan_](https://twitter.com/rogerluan_)\n\n## License\n\n_Swish_ is licensed under a standard [2-clause BSD License](LICENSE). That means you have to mention **Roger Oba** as the original author of this code and reproduce the LICENSE text inside your app.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frogerluan%2Fswish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frogerluan%2Fswish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frogerluan%2Fswish/lists"}