# 使用 Homebrew, MacPorts, Nix 安装 semgrep

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

## 安装

```sh
sudo av install brew:semgrep
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install semgrep
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install semgrep
```

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

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#semgrep
```

  证据: nixpkgs package indexes: semgrep from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

## 软件包事实

- **软件包键:** brew:semgrep
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/semgrep>
- **版本:** 1.172.0
- **来源摘要:** Easily detect and prevent bugs and anti-patterns in your codebase
- **主页:** <https://semgrep.dev>
- **仓库:** <https://github.com/semgrep/semgrep>
- **上游文档:** <https://semgrep.dev>
- **许可证:** LGPL-2.1-only
- **源码归档:** <https://github.com/semgrep/semgrep.git>
- **最后更新:** 2026-07-30T02:00:18Z
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- pysemgrep (cli)
- semgrep (cli)
- pysemgrep (别名)
- semgrep (别名)

## 依赖

- certifi
- cryptography
- dwarfutils
- gmp
- libev
- pcre2
- pydantic
- python@3.14
- rpds-py
- sqlite
- tree-sitter
- zstd

## 构建依赖

- ocaml
- opam
- pkgconf

## macOS 提供的库

- curl

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 1.172.0
- 管理器更新时间: 2026-07-30
- 本地数据: OK
- 上游仓库: https://github.com/semgrep/semgrep
- 信息: No cached GitHub release or tag data was available.

## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** semgrep
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

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

- Nix - semgrep: normalized package name match | nixpkgs package indexes: semgrep from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- MacPorts - semgrep: normalized package name match | MacPorts ports tree: devel/semgrep/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## 相关链接

- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://pkg.so/zh-hans/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://pkg.so/zh-hans/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [Networking and protocol packages](https://pkg.so/zh-hans/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [sqlite](https://pkg.so/zh-hans/brew/sqlite/) - Runtime dependency declared by Homebrew.
- [zstd](https://pkg.so/zh-hans/brew/zstd/) - Runtime dependency declared by Homebrew.
- [python@3.14](https://pkg.so/zh-hans/brew/python-3-14/) - Runtime dependency declared by Homebrew.
- [pcre2](https://pkg.so/zh-hans/brew/pcre2/) - Runtime dependency declared by Homebrew.
- [tree-sitter](https://pkg.so/zh-hans/brew/tree-sitter/) - Runtime dependency declared by Homebrew.
- [pkgconf](https://pkg.so/zh-hans/brew/pkgconf/) - Build dependency declared by Homebrew.
- [opam](https://pkg.so/zh-hans/brew/opam/) - Build dependency declared by Homebrew.
- [ocaml](https://pkg.so/zh-hans/brew/ocaml/) - Build dependency declared by Homebrew.
- [kube-score](https://pkg.so/zh-hans/brew/kube-score/) - Shares pkgdb curated category or tags: cli, developer-tools, security, static-analysis.
- [datadog-static-analyzer](https://pkg.so/zh-hans/brew/datadog-static-analyzer/) - Shares pkgdb curated category or tags: cli, developer-tools, security, static-analysis.
- [splint](https://pkg.so/zh-hans/brew/splint/) - Shares pkgdb curated category or tags: cli, developer-tools, security, static-analysis.
- [shellcheck](https://pkg.so/zh-hans/brew/shellcheck/) - Shares pkgdb curated category or tags: cli, developer-tools, static-analysis.
- [periphery](https://pkg.so/zh-hans/brew/periphery/) - Shares pkgdb curated category or tags: cli, developer-tools, static-analysis.
- [cppcheck](https://pkg.so/zh-hans/brew/cppcheck/) - Shares pkgdb curated category or tags: cli, developer-tools, static-analysis.
- [pyright](https://pkg.so/zh-hans/brew/pyright/) - Shares pkgdb curated category or tags: cli, developer-tools, static-analysis.
- [eslint](https://pkg.so/zh-hans/brew/eslint/) - Shares pkgdb curated category or tags: cli, developer-tools, static-analysis.
- [sarif-tools](https://pkg.so/zh-hans/brew/sarif-tools/) - Both packages touch the same language runtime or ecosystem. Shared terms: analysis, cli, code, developer, developer-tools.
- [esbmc](https://pkg.so/zh-hans/brew/esbmc/) - Both packages touch the same language runtime or ecosystem. Shared terms: analysis, cli, developer, developer-tools, gmp.
- [globstar](https://pkg.so/zh-hans/brew/globstar/) - Local package facts share a topical domain. Shared terms: analysis, cli, code, developer, developer-tools.

## Combined YAML source

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


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
