macOS
brew install swift-shlocal Homebrew formula metadata
brew
Scripting with easy zero-conf dependency imports. Version 2.5.0 via Homebrew; verified from local package data.
install
brew install swift-shlocal Homebrew formula metadata
overview
Scripting with easy zero-conf dependency imports
history
swift-sh is a Swift scripting tool that lets single-file Swift scripts declare third-party SwiftPM dependencies inline on import statements, then builds and runs those scripts through Swift Package Manager.
The public repository was created in 2019. The README frames the project as a response to the friction of turning a quick Swift script into a full Swift package just to use dependencies, offering a shebang-based workflow instead.
The README documents Homebrew installation and explains that the installed `swift-sh` executable is discoverable through Swift's subcommand mechanism as `swift sh`. Homebrew lists bottles for macOS and Linux, matching the README's stated support for Linux and Mac.
A script starts with `#!/usr/bin/swift sh` and declares dependencies in comments after import lines. swift-sh reads those comments, creates a cached SwiftPM package, builds it, and runs it with `swift run`; it also documents `swift sh edit` for Xcode editing and `swift sh eject` for converting a script into a package.
swift-sh matters in package-manager culture because it narrows the gap between scripting and package-based dependency resolution. It makes SwiftPM usable for disposable or operational scripts without asking users to keep a full package directory around from the start.
security posture
narrow executable package without higher-risk signals.
green risk · low confidence · appliance
Before unattended agent use, check whether the tool reads plaintext credentials, writes remote state, publishes artifacts, or shells out to plugins.
executables
| Command | Kind | Exposure | Note |
|---|---|---|---|
swift-sh | cli | global executable | |
swift-sh-edit | cli | global executable |
freshness
These signals separate page generation age, package-manager activity, and upstream release comparison. Version lag is warned only when an evidence URL and comparable versions are present.
https://github.com/mxcl/swift-sh
install metadata
| Package key | brew:swift-sh |
|---|---|
| Version | 2.5.0 |
| Package manager | Homebrew |
| Package manager page | https://formulae.brew.sh/formula/swift-sh |
| Homepage | https://github.com/mxcl/swift-sh |
| Repository | https://github.com/mxcl/swift-sh |
| Upstream docs | https://github.com/mxcl/swift-sh#readme |
| License | Unlicense |
| Source archive | https://github.com/mxcl/swift-sh/archive/refs/tags/2.5.0.tar.gz |
| Bottle | available (on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, sonoma, ventura, x86_64_linux) |
| Homebrew post-install | not defined |
| Service | none declared |
registry facts
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | swift-sh |
| Version Scheme | 0 |
| Revision | 1 |
| Head Version | HEAD |
| Requirements |
|
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
source trail
This page is generated by av-web from the private package SQLite artifact built by scripts/generate-pkg-sqlite.py.
View the package source record on GitHub.