← 返回 Skills 市场
schonhoffer

clawgrep

作者 Andrew Schonhoffer · GitHub ↗ · v0.1.4 · MIT-0
cross-platform ✓ 安全检测通过
156
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install clawgrep
功能描述
Grep-like CLI with hybrid semantic and keyword search. Combines semantic embedding search with keyword matching for high-quality code and document retrieval....
使用说明 (SKILL.md)

\r \r

clawgrep\r

\r Semantic + keyword file search. Output is grep-compatible. Runs fully locally. On first run, automatically downloads a small ONNX embedding model (~30 MB) from Hugging Face and caches it in the local cache directory. After that, all searches are offline.\r \r

Check availability\r

\r

clawgrep --version\r
```\r
\r
If not found, install from the [open-source repository](https://github.com/Schonhoffer/clawgrep) using any of these methods (only one needed):\r
\r
```bash\r
cargo install clawgrep        # Rust (recommended)\r
npm install -g clawgrep        # Node.js\r
pip install clawgrep           # Python\r
```\r
\r
## Basic usage\r
\r
```bash\r
clawgrep --no-color "query" \x3Cpath>\r
```\r
\r
Always pass `--no-color` when parsing output programmatically.\r
\r
### Search a workspace\r
\r
```bash\r
clawgrep --no-color "previous discussion about auth flow" ./memory\r
```\r
\r
### Output format\r
\r
Grep-compatible, one result per line, ranked by relevance (best first):\r
\r
```\r
$ clawgrep --no-color "previous discussion about auth flow" ./memory\r
memory/2025-06-12-auth-design.md:8:Decided to use OAuth2 with PKCE for all client auth.\r
memory/2025-06-12-auth-design.md:14:Token refresh should be transparent to the user.\r
memory/2025-06-10-planning.md:3:Auth flow is the top priority for the sprint.\r
memory/archive/2025-05-session-notes.md:42:Discussed moving auth to a separate service.\r
memory/archive/2025-05-session-notes.md:87:Need to revisit token expiry policy.\r
```\r
\r
Each line is `file:line:text`. Context lines (from `-C`) use `-` as the\r
separator instead: `file-line-text`.\r
\r
### Exit codes\r
\r
| Code | Meaning |\r
|------|---------|\r
| `0`  | Match found |\r
| `1`  | No match |\r
| `2`  | Error |\r
\r
Same as grep. Use `-q` for existence checks without output.\r
\r
## Choosing search mode\r
\r
Default weights: 70% semantic, 30% keyword.\r
\r
**Concept search** (don't know exact wording):\r
\r
```bash\r
clawgrep --no-color "decision about migration strategy" ./memory\r
```\r
\r
**Exact identifier search** (note IDs, tags, serial numbers):\r
\r
```bash\r
clawgrep --no-color --keyword-weight 0.8 --semantic-weight 0.2 "PROJ-1042" ./memory\r
```\r
\r
## Key flags\r
\r
| Flag | Purpose |\r
|------|---------|\r
| `-k N` | Number of results (default: 5) |\r
| `-C N` | Context lines before and after |\r
| `-l` | Print only matching filenames |\r
| `-q` | Quiet; just set exit code |\r
| `--show-score` | Append relevance score |\r
| `--path-boost N` | Boost filename matches (>1.0 = higher) |\r
| `--min-score N` | Filter low-relevance results (0.0–1.0) |\r
\r
See [CLI reference](references/cli-reference.md) for all flags.\r
\r
## Best practices\r
\r
1. Use `--no-color` always when parsing output.\r
2. Keep `-k` small (3–5) to reduce output. Increase only when needed.\r
3. Check exit codes instead of parsing stdout when possible.\r
4. Let the cache persist — don't use `--no-cache` unless searching throwaway\r
   content. First run indexes; subsequent runs are fast.\r
5. Search the narrowest relevant directory, not the whole filesystem.\r
\r
## References (advanced, usually not needed)\r
\r
The information above should be sufficient for normal use. Only load these if\r
you run into problems or need flags not listed above:\r
\r
- [CLI reference](references/cli-reference.md) — all flags, config file format, grep compatibility\r
- [Examples](references/examples.md) — more input/output examples for edge cases\r
安全使用建议
This skill is a documentation/instruction wrapper for the external clawgrep CLI rather than executable code. Before installing/using clawgrep: (1) install the clawgrep binary from the repository linked in the SKILL.md or build it locally (cargo/npm/pip as appropriate) and verify that source is trustworthy; (2) be aware that the first run will download a ~30 MB ONNX model from Hugging Face (network activity) and cache it locally in ~/.cache/clawgrep or the platform-specific cache — if you need offline-only behavior, pre-download or audit that step; (3) the skill itself does not request credentials or perform exfiltration, but the binary will read whatever paths you ask it to search, so avoid running it over the entire filesystem if you are concerned about sensitive data; (4) if you need higher assurance, inspect the upstream GitHub project and/or build the binary from source before use.
功能分析
Type: OpenClaw Skill Name: clawgrep Version: 0.1.4 The clawgrep skill provides a semantic and keyword search utility for AI agents, functioning as an enhanced version of the standard grep command. The documentation (SKILL.md and references/) describes legitimate behavior, including a one-time download of an embedding model from Hugging Face and local caching of search indexes. There is no evidence of data exfiltration, malicious execution, or prompt injection; the instructions actually encourage safe practices such as limiting search scope to specific directories.
能力评估
Purpose & Capability
Name/description match the instructions: the SKILL.md documents how to use a local clawgrep CLI and how it behaves. All required functionality (embedding model download, local cache, grep-compatible output) is consistent with a semantic+keyword search tool.
Instruction Scope
The instructions only tell the agent/user to run the clawgrep binary, install it via cargo/npm/pip if missing, and to search user-specified paths. They do not instruct reading unrelated system files, exfiltrating data, or accessing unrelated credentials. The SKILL.md explicitly recommends not searching the whole filesystem.
Install Mechanism
There is no install spec in the registry (instruction-only). SKILL.md states the clawgrep binary will — on first run — download a ~30 MB ONNX model from Hugging Face and cache it locally. That network activity is expected for embedding-based tools but is the primary vector to be aware of (initial download only).
Credentials
The registry lists no required environment variables or credentials. SKILL.md documents optional env vars (CLAWGREP_CACHE_DIR, CLAWGREP_CONFIG, CLAWGREP_VERBOSE, NO_COLOR, RUST_LOG) that are reasonable for a CLI and are not required secrets.
Persistence & Privilege
The skill is not always-enabled and does not request any persistent platform privileges. It does reference a local cache directory (standard for this use case) but does not modify other skills or system-wide settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install clawgrep
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /clawgrep 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.4
- Added details on first-run model download (~30 MB ONNX from Hugging Face), and clarified that subsequent runs are fully offline. - Updated compatibility notes, explicitly stating no API keys are needed and clarifying installation options. - Added author, repository, and homepage metadata. - Linked to the open-source repository for installation instructions. - Clarified and streamlined the description of model caching behavior.
v0.1.3
- Initial release of clawgrep: a CLI tool combining semantic embedding search and keyword matching for code and document retrieval. - Search large collections of files with both semantic and keyword relevance; grep-compatible output for easy parsing. - Runs entirely locally after model download, with no API keys or network access required. - Available via cargo, npm, or pip on Linux, macOS, and Windows. - Supports core grep-like flags, with additional hybrid search tuning and context output features. - MIT OR Apache-2.0 licensed.
元数据
Slug clawgrep
版本 0.1.4
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

clawgrep 是什么?

Grep-like CLI with hybrid semantic and keyword search. Combines semantic embedding search with keyword matching for high-quality code and document retrieval.... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 156 次。

如何安装 clawgrep?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install clawgrep」即可一键安装,无需额外配置。

clawgrep 是免费的吗?

是的,clawgrep 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

clawgrep 支持哪些平台?

clawgrep 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 clawgrep?

由 Andrew Schonhoffer(@schonhoffer)开发并维护,当前版本 v0.1.4。

💬 留言讨论