首页龙虾技能列表 › Ripgrep — 技能工具

🔎 Ripgrep — 技能工具

v1.0.0

[自动翻译] Blazingly fast text search tool - recursively searches directories for regex patterns with respect to gitignore rules.

1· 2,602·10 当前·10 累计
by @arnarsson (Arnarsson)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/2/26
安全扫描
VirusTotal
无害
查看报告
OpenClaw
安全
high confidence
The skill is an instruction-only ripgrep (rg) cheat-sheet and examples; its requirements and instructions are consistent with that purpose and do not request credentials or unusual system access.
评估建议
This skill is an instruction-only reference for ripgrep and appears coherent with that purpose. Before using it: (1) Confirm whether your platform will actually install 'rg' automatically or merely show the brew/apt hints — the SKILL.md includes install suggestions but the registry entry at the top-level shows no install spec. (2) Be careful with the replacement examples that pipe to xargs sed -i; those will modify files in place — run previews first (e.g., --replace, -l, or review the matched f...
详细分析 ▾
用途与能力
The name/description match the instructions (rg usage examples). One minor inconsistency: the registry-level metadata you provided lists no install spec or required binaries, but the included SKILL.md contains metadata declaring a dependency on the 'rg' binary and provides brew/apt install entries. That discrepancy is likely benign (the SKILL.md is supplying install hints), but it is worth noting.
指令范围
SKILL.md provides command-line examples and usage tips for ripgrep only. It does not instruct the agent to read unrelated system files or exfiltrate data. The only file/config reference is ~/.ripgreprc (user ripgrep config), which is reasonable. A replacement example uses piped xargs + sed -i which is potentially destructive if run without review, but that is a normal command-line pattern rather than covert behavior.
安装机制
SKILL.md contains install metadata that suggests installation via standard package managers (brew, apt), which are low-risk sources. However, the registry entry shows 'No install spec' at the top-level while SKILL.md includes install hints — confirm which install mechanism the platform will actually execute or present to the user.
凭证需求
No environment variables, credentials, or config paths are requested beyond an optional user ripgrep config (~/.ripgreprc). Nothing disproportionate is requested for the stated purpose.
持久化与权限
Skill does not request always:true and is user-invocable only. It does not request or modify other skills' configs or persistent platform-wide privileges.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.0.02026/1/29

- Initial release of the ripgrep skill. - Provides fast, recursive searching with gitignore awareness. - Includes usage examples for searching, filtering by file type, and advanced search options. - Highlights common use cases and performance tips. - Offers installation steps for both Homebrew and apt package managers. - Compares key features and advantages over traditional grep.

● 无害

安装命令 点击复制

官方npx clawhub@latest install ripgrep
镜像加速npx clawhub@latest install ripgrep --registry https://cn.clawhub-mirror.com

技能文档

Fast, smart recursive search. Respects .gitignore by default.

Quick Start

Basic search

# Search for "TODO" in current directory
rg "TODO"

# Case-insensitive search rg -i "fixme"

# Search specific file types rg "error" -t py # Python files only rg "function" -t js # JavaScript files

Common patterns

# Whole word match
rg -w "test"

# Show only filenames rg -l "pattern"

# Show with context (3 lines before/after) rg -C 3 "function"

# Count matches rg -c "import"

Advanced Usage

File type filtering

# Multiple file types
rg "error" -t py -t js

# Exclude file types rg "TODO" -T md -T txt

# List available types rg --type-list

Search modifiers

# Regex search
rg "user_\d+"

# Fixed string (no regex) rg -F "function()"

# Multiline search rg -U "start.end"

# Only show matches, not lines rg -o "https?://[^\s]+"

Path filtering

# Search specific directory
rg "pattern" src/

# Glob patterns rg "error" -g ".log" rg "test" -g "!.min.js"

# Include hidden files rg "secret" --hidden

# Search all files (ignore .gitignore) rg "pattern" --no-ignore

Replacement Operations

# Preview replacements
rg "old_name" --replace "new_name"

# Actually replace (requires extra tool like sd) rg "old_name" -l | xargs sed -i 's/old_name/new_name/g'

Performance Tips

# Parallel search (auto by default)
rg "pattern" -j 8

# Skip large files rg "pattern" --max-filesize 10M

# Memory map files rg "pattern" --mmap

Common Use Cases

Find TODOs in code:

rg "TODO|FIXME|HACK" --type-add 'code:.{rs,go,py,js,ts}' -t code

Search in specific branches:

git show branch:file | rg "pattern"

Find files containing multiple patterns:

rg "pattern1" | rg "pattern2"

Search with context and color:

rg -C 2 --color always "error" | less -R

Comparison to grep

  • Faster: Typically 5-10x faster than grep
  • Smarter: Respects .gitignore, skips binary files
  • Better defaults: Recursive, colored output, line numbers
  • Easier: Simpler syntax for common tasks

Tips

  • rg is often faster than grep -r
  • Use -t for file type filtering instead of --include
  • Combine with other tools: rg pattern -l | xargs tool
  • Add custom types in ~/.ripgreprc
  • Use --stats to see search performance

Documentation

GitHub: https://github.com/BurntSushi/ripgrep User Guide: https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md

数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务