Grep

SkillSearch

Lets your agent search file contents for regex patterns and get matching lines with file paths and line numbers.

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.

Then ask your AI: use the Grep skill

About this skill

Search file contents using regex pattern across directories. Cross-platform pure Python implementation (no external tools needed). Returns matching lines with file paths and line numbers.

What this skill tells your AI

The instructions your AI receives, as published by openakita/openakita in skills/system/grep/SKILL.md and read by ahel’s review.

跨平台内容搜索工具。

Parameters

参数类型必填说明
patternstring是正则表达式搜索模式
pathstring否搜索目录(默认当前目录)
includestring否文件名 glob 过滤(如 "*.py")
context_linesinteger否匹配行前后的上下文行数(默认 0)
max_resultsinteger否最大返回匹配数(默认 50)
case_insensitiveboolean否是否忽略大小写(默认 false)

Examples

搜索函数定义:

{
  "pattern": "def test_",
  "include": "*.py"
}

搜索 TODO 标记(忽略大小写):

{
  "pattern": "TODO|FIXME",
  "case_insensitive": true,
  "max_results": 20
}

搜索并显示上下文:

{
  "pattern": "class.*Error",
  "path": "src/",
  "context_lines": 3
}

Notes

  • 自动跳过 .git、node_modules、pycache、.venv 等目录
  • 自动跳过二进制文件
  • 纯 Python 实现,无需安装 ripgrep/grep
  • 返回格式: file:line_number:content

Related Skills

  • glob: 按文件名模式查找文件
  • read-file: 读取搜索到的文件
  • edit-file: 编辑搜索到的匹配

Signals

GitHub stars
2k
Forks
280
Last commit
Sep 2026
Advanced
Item type
skill
Key
grep
Source
github.com/openakita/openakita