SKILL.md
唯讀
名稱
morph-search
描述
透過 WarpGrep 快速搜尋程式碼庫(比 grep 快 20 倍)
Morph Codebase Search
使用 WarpGrep 進行快速、AI 驅動的程式碼庫搜尋。速度比傳統 grep 快 20 倍。
時機與用途
- 在程式碼庫中搜尋模式、函式名稱、變數
- 快速在大型程式碼庫中尋找程式碼
- 以程式化方式編輯檔案
使用方式
搜尋程式碼模式
uv run python -m runtime.harness scripts/mcp/morph_search.py \
--search "authentication" --path "."
使用正則表達式搜尋
uv run python -m runtime.harness scripts/mcp/morph_search.py \
--search "def.*login" --path "./src"
編輯檔案
uv run python -m runtime.harness scripts/mcp/morph_search.py \
--edit "/path/to/file.py" --content "new content"
參數
| 參數 | 說明 |
|---|---|
--search |
搜尋查詢/模式 |
--path |
要搜尋的目錄(預設為:.) |
--edit |
要編輯的檔案路徑 |
--content |
檔案的新內容(搭配 --edit 使用) |
範例
# 尋找所有 async 函式
uv run python -m runtime.harness scripts/mcp/morph_search.py \
--search "async def" --path "./src"
# 搜尋 import 匯入項目
uv run python -m runtime.harness scripts/mcp/morph_search.py \
--search "from fastapi import" --path "."
與 ast-grep 的比較
| 工具 | 最適合用途 |
|---|---|
| morph/warpgrep | 快速的文字/正則表達式搜尋(快 20 倍) |
| ast-grep | 結構化程式碼搜尋(理解語法結構) |
需要 MCP 伺服器
需要在 mcp_config.json 中設定帶有 MORPH_API_KEY 的 morph 伺服器。






