# swift-sh を Homebrew でインストール

swift-sh のインストール経路、実行ファイル、メタデータ、AI エージェント向けセキュリティノートを確認します。

## インストール

```sh
sudo av install brew:swift-sh
```

追加のインストールコマンド:

### macOS

- Homebrew (100%):

```sh
brew install swift-sh
```

  証拠: local Homebrew formula metadata

## パッケージ情報

- **パッケージキー:** brew:swift-sh
- **パッケージマネージャ:** Homebrew
- **バージョン:** 2.5.0
- **ソース概要:** Scripting with easy zero-conf dependency imports
- **ホームページ:** <https://github.com/mxcl/swift-sh>
- **リポジトリ:** <https://github.com/mxcl/swift-sh>
- **生成日時:** 2026-08-03T19:37:03+00:00

## 実行可能ファイル

- swift-sh (エイリアス)
- swift-sh-edit (エイリアス)

## インストール挙動

- Bottle: 利用不可

## バージョンと鮮度

- ページ生成日: 2026-08-03
- マネージャ版: 2.5.0
## プロジェクトの歴史と使われ方

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.

### タイムライン

- 2019: Public GitHub repository created.
- Current docs: Installed with Homebrew or built manually with `swift build`.
- Current docs: v2 requires Swift 5.1 and uses the active Swift toolchain to generate the temporary package manifest.

### Related projects

- The README lists Beak and Marathon as alternatives and builds on Swift Package Manager, Xcode, and Swift's subcommand dispatch behavior.

### ソース

- <https://api.github.com/repos/mxcl/swift-sh>
- <https://formulae.brew.sh/api/formula/swift-sh.json>
- <https://github.com/mxcl/swift-sh#readme>


## セキュリティノート

narrow executable package without higher-risk signals.

- **Geiger リスク:** グリーン / 低
- narrow executable package without higher-risk signals


## Combined YAML source

View the package source record on GitHub. [combined/swift-sh.yml](https://github.com/mxcl/pkgdb/blob/main/combined/swift-sh.yml)


## ソース

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- cross-ecosystem install command graph
