macOS
brew install swift-shlocal Homebrew formula metadata
安装
brew install swift-shlocal Homebrew formula metadata
概览
Scripting with easy zero-conf dependency imports
历史
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.
安全态势
narrow executable package without higher-risk signals.
绿色 风险 · 低 置信度 · appliance
在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。
可执行文件
| 命令 | 类型 | 暴露范围 | 备注 |
|---|---|---|---|
swift-sh | 可执行文件 | 已索引可执行文件 | 从本地可执行文件索引发现。 |
swift-sh-edit | 可执行文件 | 已索引可执行文件 | 从本地可执行文件索引发现。 |
新鲜度
这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。
安装元数据
| 软件包键 | brew:swift-sh |
|---|---|
| 版本 | 2.5.0 |
| 软件包管理器 | Homebrew |
| 主页 | https://github.com/mxcl/swift-sh |
| 仓库 | https://github.com/mxcl/swift-sh |
| Bottle | 未记录 |
| 服务 | 未声明 |
来源线索
此页面由 av-web 从 scripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。
View the package source record on GitHub.