# swift-sh mit Homebrew installieren

Prüfe Installationswege, Executables, Metadaten und Sicherheitshinweise für swift-sh in AI-Agent-Workflows.

## Installation

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

Weitere Installationsbefehle:

### macOS

- Homebrew (100%):

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

  Evidenz: local Homebrew formula metadata

## Paketfakten

- **Paketschlüssel:** brew:swift-sh
- **Paketmanager:** Homebrew
- **Version:** 2.5.0
- **Quellzusammenfassung:** Scripting with easy zero-conf dependency imports
- **Homepage:** <https://github.com/mxcl/swift-sh>
- **Repository:** <https://github.com/mxcl/swift-sh>
- **Generiert:** 2026-08-03T19:37:03+00:00

## Executables

- swift-sh (Alias)
- swift-sh-edit (Alias)

## Installationsverhalten

- Bottle: nicht verfügbar

## Version und Aktualität

- Seite generiert: 2026-08-03
- Manager-Version: 2.5.0
## Projektgeschichte und Nutzung

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.

### Projektgeschichte

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.

### Adoptionsgeschichte

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.

### Wie es verwendet wird

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.

### Warum Paket-Nerds sich dafür interessieren

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.

### Zeitleiste

- 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.

### Quellen

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


## Sicherheitshinweise

narrow executable package without higher-risk signals.

- **Geiger-Risiko:** grün / niedrig
- 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)


## Quellen

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