# 使用 Homebrew, apk, MacPorts, Nix, pacman, apt 安装 yaegi

查看 yaegi 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:yaegi
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install yaegi
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install yaegi
```

  证据: MacPorts ports tree: devel/yaegi/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add yaegi
```

  证据: Alpine Linux edge package indexes: yaegi from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz

- Nix (92%):

```sh
nix profile install nixpkgs#yaegi
```

  证据: nixpkgs package indexes: pkgs/by-name/ya/yaegi/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S yaegi
```

  证据: Arch Linux sync databases: yaegi from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- Ubuntu apt (92%):

```sh
sudo apt install yaegi
```

  证据: Ubuntu 24.04 LTS package indexes: yaegi from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz

## 软件包事实

- **软件包键:** brew:yaegi
- **软件包管理器:** Homebrew
- **版本:** 0.16.1
- **来源摘要:** Yet another elegant Go interpreter
- **主页:** <https://github.com/traefik/yaegi>
- **仓库:** <https://github.com/traefik/yaegi>
- **最后更新:** 2026-07-25T21:32:48+02:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- yaegi (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 0.16.1
## 项目历史与用法

Yaegi is Traefik Labs' pure-Go interpreter for Go programs. It provides a command-line REPL and script runner, but its deeper package significance is embeddability: Go applications can evaluate Go code at runtime for plugins, scripting, and prototyping without switching to Lua, Python, JavaScript, or a separate DSL.

### 项目历史

Yaegi was announced in July 2019 by Marc Vertes and the Containous/Traefik team as "Yet Another Go Interpreter", with the E jokingly standing for Elegant, Embedded, Easy, or whatever the reader preferred. The announcement framed it as a way to bring executable Go scripts, embedded plugins, interactive shells, and instant prototyping on top of the Go runtime.

The project's motivation was specific to Go's unusual position: a static, strongly typed compiled language whose parser, type machinery, and reflection facilities are available to Go programs. Yaegi turned that into an interpreter API built around New, Eval, and Use.

The README emphasizes pure Go implementation, standard-library-only design, complete Go specification support, and a safety posture where unsafe and syscall are not exported by default. That made it attractive for embedding in Go applications that need extension points without handing scripts unrestricted process access.

### 采用历史

Yaegi adoption followed two tracks. The visible developer-tool track is the yaegi command, which gives Go users a REPL, executable scripts, and a go-run-like workflow. The infrastructure track is embedding, especially for plugin systems and dynamic extension in Go applications.

Traefik's own ecosystem gave Yaegi a practical showcase: a Go interpreter made by the team behind a cloud-native edge router is naturally suited to runtime extension and plugin workflows. Talks and docs around Yaegi repeatedly mention Traefik Enterprise/plugin motivation alongside the broader goal of filling a missing piece in the Go ecosystem.

Package-manager adoption is modest but broad enough to matter: Yaegi appears in Homebrew, MacPorts, Alpine, Arch, Nix, Ubuntu, and Go package documentation, which makes a Go REPL/installable interpreter available without every user building from source.

### 使用方式

CLI users run yaegi with no arguments for a REPL, run Go files as interpreted scripts, or use shebang-style executable Go scripts. The README even suggests rlwrap for line editing/history when using the command interactively.

Go developers embed Yaegi by importing the interp package, creating an interpreter, loading stdlib symbols with Use, and evaluating code with Eval. Common scenarios include user-provided automation, policy or routing extensions, prototyping, tests, dynamic plugins, and applications that want Go as their extension language.

### 为什么软件包爱好者会关心

Yaegi is package-nerd interesting because it makes Go behave like a scripting language while staying inside the Go toolchain and module ecosystem. Installing yaegi gives a REPL and script runner; depending on the module gives applications a runtime extension engine.

It also occupies a rare niche: most language interpreters package a language runtime, but Yaegi packages an interpreter for a language famous for avoiding runtime dynamism. That tension is exactly why it shows up in package indexes despite being smaller than mainstream language runtimes.

### 时间线

- 2019-07-27: Traefik/Containous announces Yaegi as an open-source Go interpreter for scripts, embedded plugins, REPL use, and prototyping.
- 2019: Conference talks present Yaegi as a production-oriented Go interpreter and plugin engine for Traefik-related use cases.
- 2020-09-16: Yaegi v0.9.0 release assets appear on GitHub, showing the project moving into packaged binary distribution.
- 2020s: The README documents the stable public API shape around interp.New, Eval, and Use, and the yaegi command becomes packaged across multiple Unix package managers.

### Related projects

- Go is the compiled language and standard library that Yaegi interprets and reuses.
- Traefik and Traefik Enterprise are related through the team and plugin/extension motivation behind Yaegi.
- Lua, Python, JavaScript, Starlark, Tengo, and Go plugins are neighboring choices for embedding scriptability or runtime extension in Go applications.
- rlwrap is commonly paired with the yaegi command for interactive history and line editing.

### 来源

- <https://github.com/traefik/yaegi>
- <https://github.com/traefik/yaegi/releases/tag/v0.9.0>
- <https://golab.io/talks/yaegi-yet-another-elegant-go-interpreter>
- <https://pkg.go.dev/github.com/traefik/yaegi/cmd/yaegi>
- <https://traefik.io/blog/announcing-yaegi-263a1e2d070a>


## 安全说明

generalized runtime or code generation signal.

- **Geiger 风险:** yellow / 中
- generalized runtime or code generation signal

## 其他软件包管理器记录

- Nix - yaegi: normalized package name match | nixpkgs package indexes: pkgs/by-name/ya/yaegi/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - yaegi - 0.15.1-2: normalized package name match | Ubuntu 24.04 LTS package indexes: yaegi from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Another Elegant Go Interpreter | https://github.com/traefik/yaegi
- apk - yaegi - 0.16.1-r19: normalized package name match | Alpine Linux edge package indexes: yaegi from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Elegant Go interpreter | https://github.com/traefik/yaegi
- pacman - yaegi - 0.16.1-2: normalized package name match | Arch Linux sync databases: yaegi from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Yet another Elegant Go Interpreter | https://github.com/containous/yaegi
- MacPorts - yaegi: normalized package name match | MacPorts ports tree: devel/yaegi/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

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


## 来源

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