# 使用 Homebrew, apk, Nix, zypper 安装 weggli

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

## 安装

```sh
sudo av install brew:weggli
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install weggli
```

  证据: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add weggli
```

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

- Nix (92%):

```sh
nix profile install nixpkgs#weggli
```

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

- zypper (92%):

```sh
sudo zypper install weggli
```

  证据: openSUSE Tumbleweed package metadata: weggli from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## 软件包事实

- **软件包键:** brew:weggli
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/weggli>
- **版本:** 0.2.4
- **来源摘要:** Fast and robust semantic search tool for C and C++ codebases
- **主页:** <https://github.com/weggli-rs/weggli>
- **仓库:** <https://github.com/weggli-rs/weggli>
- **许可证:** Apache-2.0
- **源码归档:** <https://github.com/weggli-rs/weggli/archive/refs/tags/v0.2.4.tar.gz>
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- weggli (cli)
- weggli (别名)

## 构建依赖

- rust

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_big_sur, arm64_linux, arm64_monterey, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, big_sur, catalina, monterey, sonoma, ventura

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 0.2.4
- 本地数据: OK
- 上游仓库: https://github.com/weggli-rs/weggli
- 检测到的最新版本: v0.2.4 (当前)
- 信息: No package-manager update timestamp was available.
## 项目历史与用法

weggli is a Rust semantic-search tool for C and C++ codebases, designed for security researchers who want fast, code-shaped queries over large or incomplete source trees. Its README says it matches user-provided patterns on abstract syntax trees and uses a query language that resembles C and C++.

### 项目历史

The current GitHub repository was created in September 2021, and crates.io metadata shows package publication beginning in October 2021. The README states that weggli is inspired by Semgrep, Coccinelle, joern, and CodeQL, but intentionally makes different tradeoffs for C/C++ review.

Those tradeoffs define the project: first-class support for modern C++ constructs, minimal setup without requiring a successful build, interactive performance, and greedy matching that finds useful variants even at the cost of false positives. The implementation is built on tree-sitter C and C++ grammars, with queries translated into tree-sitter query machinery plus weggli-specific behavior.

### 采用历史

weggli's adoption is strongest in vulnerability research and manual code-review circles rather than general developer search. A 2024 HN Security article described converting C/C++ vulnerability patterns from Semgrep into weggli queries and using the tool to identify hotspots such as buffer overflows, integer issues, format strings, memory-management mistakes, and command-injection patterns.

By July 2026, the repository had about 2.5 thousand GitHub stars, which is sizable for a specialized security CLI. Its package-manager niche is clear: it gives reviewers a fast semantic grep for C and C++ without requiring a full CodeQL database, compiler build, or heavyweight SAST workflow.

### 使用方式

A typical invocation is `weggli <PATTERN> <PATH>`, where the pattern is written in a C/C++-like language with metavariables and wildcards. For example, patterns can look for a stack buffer followed by a `memcpy` call, suspicious arithmetic before allocation, or API-specific call sequences.

In practice, users run weggli interactively while reading source: write a pattern, inspect matches, refine the query, and then manually audit nearby code. It is especially useful for variant analysis after one bug is found and for quickly mapping attack-surface idioms in unfamiliar C/C++ projects.

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

weggli is package-nerd significant because it is the small, installable middle ground between `grep` and heavyweight static-analysis platforms. It makes AST-aware C/C++ searching feel like a fast CLI habit rather than an infrastructure project.

### 时间线

- 2021-09: GitHub repository created.
- 2021-10: crates.io package created and early 0.2.x releases began.
- 2022-05: v0.2.4 release published.
- 2024-01: HN Security published a practitioner pattern collection and workflow article for C/C++ vulnerability research.

### Related projects

- The README names Semgrep, Coccinelle, joern, and CodeQL as inspirations. In use, weggli is closest to a semantic grep for C/C++ reviewers, while those related tools cover broader rule management, program analysis, source transformation, or database-backed code queries.

### 来源

- <https://api.github.com/repos/weggli-rs/weggli>
- <https://api.github.com/repos/weggli-rs/weggli/releases?per_page=5>
- <https://crates.io/api/v1/crates/weggli>
- <https://github.com/weggli-rs/weggli>
- <https://hnsecurity.it/blog/a-collection-of-weggli-patterns-for-c-cpp-vulnerability-research/>


## 安全说明

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:** weggli
- **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 - weggli: normalized package name match | nixpkgs package indexes: pkgs/by-name/we/weggli/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - weggli - 0.2.4-r1: normalized package name match | Alpine Linux edge package indexes: weggli from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Semantic search tool for C and C++ codebases | https://github.com/googleprojectzero/weggli
- zypper - weggli - 0.2.4-2.13: normalized package name match | openSUSE Tumbleweed package metadata: weggli from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | A semantic search tool for C and C++ codebases | https://github.com/googleprojectzero/weggli


## 相关链接

- [Source-control packages](https://pkg.so/zh-hans/source-control-tools/) - Belongs to a source-control command family.
- [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.
- [rust](https://pkg.so/zh-hans/brew/rust/) - Build dependency declared by Homebrew.
- [zizmor](https://pkg.so/zh-hans/brew/zizmor/) - Shares pkgdb curated category or tags: cli, security, static-analysis.
- [checkov](https://pkg.so/zh-hans/brew/checkov/) - Shares pkgdb curated category or tags: cli, security, static-analysis.
- [tfsec](https://pkg.so/zh-hans/brew/tfsec/) - Shares pkgdb curated category or tags: cli, security, static-analysis.
- [betterleaks](https://pkg.so/zh-hans/brew/betterleaks/) - Shares pkgdb curated category or tags: cli, security, static-analysis.
- [gosec](https://pkg.so/zh-hans/brew/gosec/) - Shares pkgdb curated category or tags: cli, security, static-analysis.
- [slither-analyzer](https://pkg.so/zh-hans/brew/slither-analyzer/) - Shares pkgdb curated category or tags: cli, security, static-analysis.
- [terrascan](https://pkg.so/zh-hans/brew/terrascan/) - Shares pkgdb curated category or tags: cli, security, static-analysis.
- [pdfcrack](https://pkg.so/zh-hans/brew/pdfcrack/) - Shares pkgdb curated category or tags: c, cli, security.
- [apkleaks](https://pkg.so/zh-hans/brew/apkleaks/) - Security-sensitive metadata or terminology overlaps. Shared terms: analysis, cli, security, static, static-analysis.
- [bandit](https://pkg.so/zh-hans/brew/bandit/) - Security-sensitive metadata or terminology overlaps. Shared terms: analysis, cli, security, static, static-analysis.
- [caracal](https://pkg.so/zh-hans/brew/caracal/) - Security-sensitive metadata or terminology overlaps. Shared terms: analysis, cli, security, static, static-analysis.

## Combined YAML source

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


## 来源

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