ast-grep-find by parcadei/continuous-claude-v3
npx skills add https://github.com/parcadei/continuous-claude-v3 --skill ast-grep-find理解语法的结构化代码搜索。查找函数调用、导入、类定义等模式——不仅仅是文本。
uv run python -m runtime.harness scripts/ast_grep_find.py \
--pattern "import asyncio" --language python
uv run python -m runtime.harness scripts/ast_grep_find.py \
--pattern "async def \$FUNC(\$\$\$)" --language python --path "./src"
uv run python -m runtime.harness scripts/ast_grep_find.py \
--pattern "console.log(\$MSG)" --replace "logger.info(\$MSG)" \
--language javascript
uv run python -m runtime.harness scripts/ast_grep_find.py \
--pattern "print(\$X)" --replace "logger.info(\$X)" \
--language python --dry-run
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 参数 | 描述 |
|---|---|
--pattern | 要搜索的 AST 模式(必需) |
--language | 语言:python、javascript、typescript、go 等 |
--path | 要搜索的目录(默认:.) |
--glob | 文件通配符模式(例如,**/*.py) |
--replace | 用于重构的替换模式 |
--dry-run | 预览更改而不应用 |
--context | 上下文行数(默认:2) |
| 语法 | 含义 |
|---|---|
$NAME | 匹配单个节点(变量、表达式) |
$$$ | 匹配多个节点(参数、语句) |
$_ | 匹配任何单个节点(通配符) |
# 查找所有函数定义
uv run python -m runtime.harness scripts/ast_grep_find.py \
--pattern "def \$FUNC(\$\$\$):" --language python
# 查找 console.log 调用
uv run python -m runtime.harness scripts/ast_grep_find.py \
--pattern "console.log(\$\$\$)" --language javascript
# 将 print 替换为 logging
uv run python -m runtime.harness scripts/ast_grep_find.py \
--pattern "print(\$X)" --replace "logging.info(\$X)" \
--language python --dry-run
| 工具 | 最适合 |
|---|---|
| ast-grep | 结构化模式(理解代码语法) |
| warpgrep | 快速文本/正则表达式搜索(比 grep 快 20 倍) |
需要语法感知匹配时使用 ast-grep。追求原始速度时使用 warpgrep。
需要在 mcp_config.json 中配置 ast-grep 服务器。
每周安装次数
209
代码仓库
GitHub 星标数
3.6K
首次出现
2026 年 1 月 22 日
安全审计
安装于
codex199
opencode198
gemini-cli194
cursor192
github-copilot190
amp184
Structural code search that understands syntax. Find patterns like function calls, imports, class definitions - not just text.
uv run python -m runtime.harness scripts/ast_grep_find.py \
--pattern "import asyncio" --language python
uv run python -m runtime.harness scripts/ast_grep_find.py \
--pattern "async def \$FUNC(\$\$\$)" --language python --path "./src"
uv run python -m runtime.harness scripts/ast_grep_find.py \
--pattern "console.log(\$MSG)" --replace "logger.info(\$MSG)" \
--language javascript
uv run python -m runtime.harness scripts/ast_grep_find.py \
--pattern "print(\$X)" --replace "logger.info(\$X)" \
--language python --dry-run
| Parameter | Description |
|---|---|
--pattern | AST pattern to search (required) |
--language | Language: python, javascript, typescript, go, etc. |
--path | Directory to search (default: .) |
| Syntax | Meaning |
|---|---|
$NAME | Match single node (variable, expression) |
$$$ | Match multiple nodes (arguments, statements) |
$_ | Match any single node (wildcard) |
# Find all function definitions
uv run python -m runtime.harness scripts/ast_grep_find.py \
--pattern "def \$FUNC(\$\$\$):" --language python
# Find console.log calls
uv run python -m runtime.harness scripts/ast_grep_find.py \
--pattern "console.log(\$\$\$)" --language javascript
# Replace print with logging
uv run python -m runtime.harness scripts/ast_grep_find.py \
--pattern "print(\$X)" --replace "logging.info(\$X)" \
--language python --dry-run
| Tool | Best For |
|---|---|
| ast-grep | Structural patterns (understands code syntax) |
| warpgrep | Fast text/regex search (20x faster grep) |
Use ast-grep when you need syntax-aware matching. Use warpgrep for raw speed.
Requires ast-grep server in mcp_config.json.
Weekly Installs
209
Repository
GitHub Stars
3.6K
First Seen
Jan 22, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykPass
Installed on
codex199
opencode198
gemini-cli194
cursor192
github-copilot190
amp184
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
150,000 周安装
资深C#开发者技能:精通.NET 8+、ASP.NET Core API、Entity Framework与高性能优化
1,300 周安装
代码文档生成器 - 自动生成内联文档、API规范、开发者指南的AI工具
1,300 周安装
AI实施计划验证工具:独立审计、需求追溯、YAGNI合规与假设检查
1,300 周安装
内容衰退恢复指南:诊断流量下滑页面,通过刷新、整合、重定向或淘汰策略逆转SEO损失
1,300 周安装
SEO竞争对手分析工具:识别关键词差距,制定攻击计划,提升网站排名
1,300 周安装
MCP深度探索指南:Claude MCP服务器添加、工具使用与热门服务器安装教程
1,300 周安装
--globFile glob pattern (e.g., **/*.py) |
--replace | Replacement pattern for refactoring |
--dry-run | Preview changes without applying |
--context | Lines of context (default: 2) |