README
¶
ð AST-Digger
AI ãšãŒãžã§ã³ãã®ããã®ãã³ãã€ã³ãã»ã³ãŒãè§£æ CLI
AST-Digger ã¯ãAIãšãŒãžã§ã³ããå€§èŠæš¡ãªã³ãŒãããŒã¹ãå¹ççã«æ¢çŽ¢ããããã®æ§æè§£æã»ã³ãŒãæœåºããŒã«ã§ããæ¬ããŒã«ã¯ãªããžããªã«ãŒãçŽäžïŒcmd/, internal/çïŒã«å®è£
ãããŠããŸãã詳现ãªèšèšå€æã®çµç·¯ã¯ SPECS/design.mdã»SPECS/tech.mdã»doc/adr/ é
äžã®ADRãåç
§ããŠãã ããã
ð å š8ãµãã³ãã³ãïŒ
outline/symbol/locate/references/resolve-import/directory/feedback/agent-contextïŒãå®è£ æžã¿ã§ãCLIãšããŠäžéãæ©èœããŸãã
ð ç®æ¬¡
- æŠèŠ
- 察å¿èšèª
- ã€ã³ã¹ããŒã« / ãã«ã
- ã¯ã€ãã¯ã¹ã¿ãŒã
- ã³ãã³ããªãã¡ã¬ã³ã¹
- AIãšãŒãžã§ã³ãã®æšå¥šã¯ãŒã¯ãããŒ
- ãã£ãã·ã¥ãšå·®åã¹ãã£ã³
- ã©ã€ã»ã³ã¹
æŠèŠ
å€§èŠæš¡ã³ãŒãããŒã¹ãAIãšãŒãžã§ã³ããæ¢çŽ¢ããéããã¡ã€ã«å šäœãèªã¿èŸŒããšã³ã³ããã¹ããŠã£ã³ããŠãç¡é§ã«æ¶è²»ãããæšè«ã®ç²ŸåºŠãäœäžããŸããAST-Digger 㯠tree-sitter ã䜿ã£ãŠ ASTïŒæœè±¡æ§ææšïŒãé«éã«ããŒã¹ãããšãŒãžã§ã³ããå¿ èŠãªæ å ±ã ãããã³ãã€ã³ããã€æ§é çã«åãåºãã CLI ããŒã«ã§ããã·ã³ã°ã«ãã€ããªãšããŠåäœãããã³ãã€ã³ãæœåºã»å·®åãã£ãã·ã¥ã»äžéå¶åŸ¡ä»ãåºåãæäŸããŸãã
察å¿èšèª
| èšèª | æ¡åŒµå |
|---|---|
| Python | .py |
| TypeScript | .ts, .tsx |
| Go | .go |
| Java | .java |
| JavaScript | .js, .jsx |
| Rust | .rs |
| Markdown | .md, .markdown |
ã€ã³ã¹ããŒã« / ãã«ã
å¿ èŠç°å¢
- Go 1.22 以äž
- Cã³ã³ãã€ã©ïŒgcc/clang çïŒãå¿
é ã§ããtree-sitter ãã€ã³ãã£ã³ã°ïŒ
github.com/tree-sitter/go-tree-sitterããã³åèšèªææ³ããã±ãŒãžïŒã CGO ã«äŸåããŠãããããCGO_ENABLED=1ã§ã®ãã«ãã«ã¯ C ã³ã³ãã€ã©ãå¿ èŠã§ããCGOäŸåã«é¢ãã詳现ã¯SPECS/tech.mdããã³ ADR-0005 ãåç §ããŠãã ããã
ãã«ãæé
ãªããžããªã«ãŒããäœæ¥ãã£ã¬ã¯ããªãšããŠã以äžãå®è¡ããŸããå ±éã®ãã«ãã³ãã³ãã¯å šãã©ãããã©ãŒã ã§åäžã§ãã
go build ./cmd/ast-digger
ã«ã¬ã³ããã£ã¬ã¯ããªã« ast-diggerïŒWindowsã§ã¯ ast-digger.exeïŒãšããå®è¡ãã¡ã€ã«ãçæãããŸãããã ãããã®go buildãæåããã«ã¯ãåOSã§ä»¥äžã®ããã«Cã³ã³ãã€ã©ãçšæããŠããå¿
èŠããããŸãã
Windows
MinGW-w64 ç³»ã®GCCããŒã«ãã§ã€ã³ãå¿ èŠã§ãã以äžã®ããããã§å°å ¥ããŠãã ããã
- MSYS2 ãå°å
¥ãã
pacman -S mingw-w64-ucrt-x86_64-gccçã§gccãã€ã³ã¹ããŒã«ããïŒMSYS2ã®UCRT64/MINGW64ã·ã§ã«ã®binãã£ã¬ã¯ããªãPATHã«è¿œå ïŒã - WinLibs ãé
åžãããã«ãæžã¿MinGW-w64äžåŒãå±éãã
binãã£ã¬ã¯ããªãPATHã«è¿œå ããã - Chocolateyçã®ããã±ãŒãžãããŒãžã£çµç±ã§
mingwããã±ãŒãžãå°å ¥ããïŒchoco install mingwïŒã
gcc --version ãPowerShell/ã³ãã³ãããã³ããããå®è¡ã§ããããšã確èªããŠãããã«ãããŠãã ããã
macOS
Xcode Command Line ToolsïŒclangïŒãå°å
¥ããŸãã
xcode-select --install
Linux
ãã£ã¹ããªãã¥ãŒã·ã§ã³æšæºã®Cã³ã³ãã€ã©ããã±ãŒãžãå°å ¥ããŸãïŒDebian/Ubuntuç³»ã®äŸïŒã
sudo apt-get install build-essential
RHEL/Fedoraç³»ã§ã¯ sudo dnf groupinstall "Development Tools" çããã£ã¹ããªãã¥ãŒã·ã§ã³ã®æ
£ç¿ã«åŸã£ãŠãã ããã
ã¯ãã¹ã³ã³ãã€ã«ã¯ã¹ã³ãŒãå€ã§ã
GOOS/GOARCH ãåãæ¿ããã¯ãã¹ã³ã³ãã€ã«ïŒäŸ: Windowsäžã§ GOOS=linux go build ãå®è¡ããŠLinuxåããã€ããªãçæããïŒã¯ãæ¬ãããžã§ã¯ãã®æ¹éãšããŠè¡ããŸããã
CGOãæå¹ã«ãããšãã¿ãŒã²ãããã©ãããã©ãŒã åãã®Cã¯ãã¹ã³ã³ãã€ã©ã®æŽåïŒzig cc çïŒãå¥éå¿
èŠã«ãªããŸããæ¬ãããžã§ã¯ãã¯tree-sitterãã€ã³ãã£ã³ã°ã®å©çšïŒCGOäŸåïŒãåªå
ããã¯ãã¹ã³ã³ãã€ã«å¯Ÿå¿ã®è€éåãé¿ãããšããæ¹éæ±ºå®ãè¡ããŸããã詳现㯠SPECS/tech.md ããã³ ADR-0005 ãåç
§ããŠãã ããã
åãã©ãããã©ãŒã åãã®ãã€ããªã¯ããã®ãã©ãããã©ãŒã äžã§ã®ãã€ãã£ããã«ãã«ãã£ãŠåå¥ã«çæããéçšãšããŸãã
éçãªã³ã¯ã«ã€ããŠ
èŠä»¶I-1ïŒSPECS/requirements.mdïŒã«ãããWindows/Linuxã§ã¯çæãã€ããªã远å ã®å
±æã©ã€ãã©ãªé
眮ãªãã«åç¬ã§åäœããããšãå¿
é ãšããŸããmacOSã¯Appleã®OSå¶çŽã«ããå®å
šãªéçãªã³ã¯ãã§ããªããããã·ã¹ãã ã©ã€ãã©ãªãžã®åçãªã³ã¯ã蚱容ããå¯èœãªç¯å²ã§ã®éçãªã³ã¯ïŒãã¹ããšãã©ãŒãïŒãç®æšãšããŸãã
éçãªã³ã¯ãä¿ããã«ããã©ã°ã®äŸïŒWindowsïŒ:
CGO_ENABLED=1 go build -ldflags '-linkmode external -extldflags "-static"' -o ast-digger.exe ./cmd/ast-digger
â ïž Windowsç°å¢ã§ã¯åºåå ãã¡ã€ã«ã«
.\ast-digger.exeã®ããã«æç€ºçã«æå®ããŠå®è¡ããããšãæšå¥šããŸãã
ãã€ããªãµã€ãºã®åæžïŒã·ã³ãã«ã»ãããã°æ å ±ã®åé€ïŒ
é
åžçšãã€ããªã®ãã¡ã€ã«ãµã€ãºã軜éåãããå Žåããã»ãã¥ãªãã£ãœããã«ãã誀æ€ç¥ïŒFalse PositiveïŒãåé¿ãããå Žåã¯ã-ldflags "-s -w" ãã©ã°ãä»äžããŠãã«ãããããšãæšå¥šããŸãã
go build -ldflags "-s -w" -o ast-digger.exe ./cmd/ast-digger
-s: èšå·è¡šïŒã·ã³ãã«ããŒãã«ïŒãåé€-w: DWARF ãããã°æ å ±ãåé€
ð¡ åæžå¹æã®å®æž¬å€: éåžžãã«ãïŒçŽ 22.8 MBïŒã«å¯Ÿããæ¬ãã©ã°ãä»äžããããšã§ çŽ 12.3 MBïŒçŽ 46% åæžïŒ ãŸã§ãã€ããªãµã€ãºãå€§å¹ ã«è»œéåã§ããŸãã
å®è¡
ãã«ãããã«çŽæ¥å®è¡ããå Žå:
go run ./cmd/ast-digger --version
ãã«ãæžã¿ãã€ããªãå®è¡ããå Žå:
./ast-digger --version
ã¯ã€ãã¯ã¹ã¿ãŒã
以äžã¯ãå®éã«ãã«ããããã€ããªãå®è¡ããŠåŸãããåºåäŸã§ãïŒå¯Ÿè±¡ã¯ testdata/python/ é
äžã®ãã¹ãçšãã£ã¯ã¹ãã£ïŒã
ãã£ã¬ã¯ããªæ§é ãã·ã³ãã«ä»ãã§ç¢ºèªãã
./ast-digger directory testdata/python/importproj
importproj/
bad_caller.py
main.py
mathutils.py
def add
def subtract
def multiply
def divide
__init__.py
def init_func
caller.py
utils.py
def util_func
ãã¡ã€ã«ã®ã¹ã±ã«ãã³ïŒéªšæ Œã³ãŒãïŒãååŸãã
./ast-digger outline testdata/python/importproj/mathutils.py
def add(a, b):
"""Add two numbers."""
...
def subtract(a, b):
"""Subtract b from a."""
...
def multiply(a, b):
"""Multiply two numbers."""
...
def divide(a, b):
"""Divide a by b."""
...
ç¹å®ã®ã·ã³ãã«ãæœåºãã
./ast-digger symbol testdata/python/sample.py Greeter.shout
@staticmethod
def shout(message: str) -> str:
"""Shout a message."""
return message.upper()
ã³ãã³ããªãã¡ã¬ã³ã¹
å
±éãã©ã° --json / -j ã¯ãã¹ãŠã®ã³ãã³ãã«ä»äžãããŠãããæå®ãããšJSONåºåã«åãæ¿ãããŸãïŒagent-contextã¯åžžã«JSONåºåïŒã
directory â ãã£ã¬ã¯ããªããªãŒ + ã·ã³ãã«äžèЧ
ast-digger directory [dir_path] [--recursive] [--no-recursive] [--limit N] [--json]
| ãªãã·ã§ã³ | ããã©ã«ã | 説æ |
|---|---|---|
dir_path |
. |
ã¹ãã£ã³å¯Ÿè±¡ãã£ã¬ã¯ã㪠|
--recursive |
trueïŒbool flagïŒ |
ãµããã£ã¬ã¯ããªãååž°çã«ã¹ãã£ã³ãã |
--no-recursive |
falseïŒbool flagïŒ |
æå®ãããš--recursiveã®å€ã«é¢ããããããã¬ãã«ã®ã¿ãã¹ãã£ã³ãã |
--limit N |
50 |
衚瀺ãããã¡ã€ã«æ°ã®äžé |
.workspace_cache/symbols.dbïŒSQLiteïŒã掻çšãã倿Žããããã¡ã€ã«ã®ã¿ãå·®åã¹ãã£ã³ããããé«éã§ãã
å€èšèªæ··åšãããžã§ã¯ãã®äŸïŒtestdata/mixed/references/ãPython/TypeScript/Go/Java/JavaScriptæ··åšïŒ:
./ast-digger directory testdata/mixed/references
references/
caller.go
def useHelper
caller.java
class Caller
def callSite
caller.js
caller.py
caller.ts
target.go
def helperFn
target.java
class Target
def helperFn
target.js
def helperFn
target.py
def helperFn
target.ts
def helperFn
JSONåºåæã¯ãããã¹ãããªãŒå
šäœã {"result": "..."} ã®1æååãšããŠã©ãããããŸã:
./ast-digger directory testdata/python/importproj --json
{
"result": "importproj/\n bad_caller.py\n main.py\n mathutils.py\n def add\n def subtract\n def multiply\n def divide\n __init__.py\n def init_func\n caller.py\n utils.py\n def util_func"
}
outline â ã¹ã±ã«ãã³ã³ãŒãçæ
ast-digger outline <file_path> [--json] [--no-truncate]
颿°ãã¡ãœããã®å®è£
ããã£ãçç¥ããã·ã°ããã£ã»docstring/doc commentã»åæ
å ±ã ããæ®ããã¢ãŠãã©ã€ã³ã³ãŒããçæããŸããããã¹ãåºåã¯300è¡ãè¶
ãããšèªåçã«åãè©°ããããŸãïŒ--no-truncateã§ç¡å¹åå¯èœã--jsonã¯åžžã«ç¡åãè©°ãïŒã
# Python
./ast-digger outline testdata/python/importproj/mathutils.py
# TypeScript
./ast-digger outline testdata/typescript/sample.ts
# Go
./ast-digger outline testdata/go/sample.go
# Java
./ast-digger outline testdata/java/sample.java
# JavaScriptïŒ.jsxãåäžææ³ã§ããŒã¹å¯èœïŒ
./ast-digger outline testdata/javascript/sample.jsx
# Rust
./ast-digger outline testdata/rust/sample.rs
# Markdown
./ast-digger outline testdata/markdown/sample.md
# JSON åºåïŒã·ã³ãã«æ§é ããŒã¿ã®é
åïŒ
./ast-digger outline testdata/python/importproj/mathutils.py --json
Go察象ãã¡ã€ã«ã®åºåäŸ:
package sample
import "fmt"
// TopLevelFunction doubles x.
func TopLevelFunction(x int) int { /* ... */ }
// Greeter is a struct responsible for greetings.
type Greeter struct {
Prefix string
}
// Greet returns a greeting string using a pointer receiver.
func (g *Greeter) Greet(name string) string { /* ... */ }
// Shout returns an uppercased message using a value receiver.
func (g Greeter) Shout(message string) string { /* ... */ }
// Animal describes something that can speak.
type Animal interface {
// Speak returns the sound the animal makes.
Speak() string
}
// ... (以äžãåãšã€ãªã¢ã¹ã»named typeã»ãããã¬ãã«é¢æ°ãç¶ã)
symbol â ãã³ãã€ã³ãã³ãŒãæœåº
ast-digger symbol <file_path> <symbol_path> [--json] [--no-truncate]
symbol_path ã¯ãããåºåãã§æå®ããŸãïŒäŸ: ClassName.method_nameãGoã®å Žå㯠ReceiverType.MethodNameïŒãæœåºã³ãŒãã300è¡ãè¶
ããå Žåã¯ããã¹ãã»JSONãããã®åºåã§ãèªåçã«åãè©°ããããŸãïŒ--no-truncateã§ç¡å¹åå¯èœïŒã
# ã¡ãœãããæœåº
./ast-digger symbol testdata/python/sample.py Greeter.shout
# ã¬ã·ãŒãã¡ãœãããæœåºïŒGoïŒ
./ast-digger symbol testdata/go/sample.go Greeter.Greet
# ã¯ã©ã¹ã¡ãœãããæœåºïŒTypeScriptïŒ
./ast-digger symbol testdata/typescript/sample.ts Greeter.shout
# ã¡ãœãããæœåºïŒJavaãã³ã³ã¹ãã©ã¯ã¿ã kind: "method" ãšããŠåæ§ã«æ±ãããïŒ
./ast-digger symbol testdata/java/sample.java SampleClass.greet
# ã¯ã©ã¹ã¡ãœãããæœåºïŒJavaScriptïŒ
./ast-digger symbol testdata/javascript/sample.js Greeter.shout
# ã¡ãœãã/颿°ãæœåºïŒRustïŒ
./ast-digger symbol testdata/rust/sample.rs Greeter.greet
# ã»ã¯ã·ã§ã³/ã³ãŒããããã¯ãæœåºïŒMarkdownïŒ
./ast-digger symbol testdata/markdown/sample.md "Section 1"
# JSON åºåïŒã¡ã¿ããŒã¿ä»ãïŒ
./ast-digger symbol testdata/python/sample.py Greeter.shout --json
JSONåºåäŸ:
{
"name": "shout",
"kind": "method",
"parent": "Greeter",
"file_path": "testdata/python/sample.py",
"start_line": 16,
"end_line": 19,
"signature": "@staticmethod\ndef shout(message: str) -> str",
"docstring": "Shout a message.",
"code": "@staticmethod\n def shout(message: str) -> str:\n \"\"\"Shout a message.\"\"\"\n return message.upper()"
}
ã·ã³ãã«ãèŠã€ãããªãå Žåã¯ãé¡äŒŒããã·ã³ãã«ååè£ãæå€§5ä»¶ãçµäºã³ãŒã4ãšãšãã«æç€ºãããŸã:
./ast-digger symbol testdata/python/sample.py Greeter.shuot
Error: symbol not found: "Greeter.shuot" in testdata/python/sample.py
Did you mean?
- Greeter.shout
- Greeter
- Greeter.__init__
locate â ã·ã³ãã«ã®è¡ç¯å²ãç¹å®
ast-digger locate <file_path> <symbol_path> [--json]
ã³ãŒããèªã¿èŸŒãŸãã«ãã·ã³ãã«ã®éå§è¡ã»çµäºè¡ã ããé«éã«è¿ããŸãã巚倧ãªã·ã³ãã«ãsymbolã§ååŸããåã«ãããããããµã€ãºã確èªããçšéã«åããŠããŸãã
./ast-digger locate testdata/python/sample.py Greeter.shout
# â testdata/python/sample.py:16-19
./ast-digger locate testdata/python/sample.py Greeter.shout --json
# â {"file": "testdata/python/sample.py", "symbol": "shout", "start_line": 16, "end_line": 19}
references â ãããžã§ã¯ã暪æã®åç
§æ¢çŽ¢
ast-digger references <symbol_name> [--project-root DIR] [--limit N] [--json]
--project-rootïŒããã©ã«ã.ïŒé
äžã®å
šå¯Ÿå¿ãã¡ã€ã«ããæå®ã·ã³ãã«ãåç
§ã»åŒã³åºãããŠããç®æãæ¢çŽ¢ããŸããã³ã¡ã³ããæååãªãã©ã«å
ã®åºçŸã¯é€å€ãããŸããä»¶æ°ã--limitïŒããã©ã«ã50ïŒãè¶
ãããšåãè©°ããããè¶
éåãçµã蟌ãããã®ãã³ããstderrã«åºåãããŸãïŒJSONåºåæã¯truncated/total_count/limit/hintããŒãšããŠè¿åŽïŒã
./ast-digger references target_func --project-root testdata/python/references
testdata/python/references/caller_a.py:2: target_func() # actual reference on this line
testdata/python/references/caller_b.py:6: value = target_func
äžéè¶ éæã®ãã³ã衚瀺ã®äŸ:
./ast-digger references bulk_symbol --project-root testdata/python/references_bulk --limit 5
testdata/python/references_bulk/callers.py:2: bulk_symbol() # call site 0
testdata/python/references_bulk/callers.py:3: bulk_symbol() # call site 1
testdata/python/references_bulk/callers.py:4: bulk_symbol() # call site 2
testdata/python/references_bulk/callers.py:5: bulk_symbol() # call site 3
testdata/python/references_bulk/callers.py:6: bulk_symbol() # call site 4
# ... (truncated: 5 of 60 results shown. Use --limit to increase or narrow down using --project-root)
泚æïŒGo/Java察象ã³ãŒãåºæã®æåïŒ: Goããã³JavaçããŒãµãŒã®
FindReferencesInFileã¯ãå®çŸ©ç®æèªäœãåç §çµæããé€å€ããŸããããã®ããã.go/.javaãã¡ã€ã«ã察象ã«referencesãå®è¡ãããšãåŒã³åºãç®æã«å ããŠå®çŸ©è¡ãå«ãŸããŸãïŒPython/TypeScript/JavaScriptã®åããŒãµãŒã¯å®çŸ©ç®æãé€å€ããŸãïŒã
resolve-import â ã€ã³ããŒãå®çŸ©å
ã®è§£æ±º
ast-digger resolve-import <file_path> <symbol_name> [--json]
察象ãã¡ã€ã«ã®ã€ã³ããŒãæãè§£æããæå®ã·ã³ãã«ã®å®çŸ©å ãã¡ã€ã«ãšè¡çªå·ã解決ããŸãã
ã€ã³ããŒãã¯ã«ã¬ã³ããã£ã¬ã¯ããªããããžã§ã¯ãã«ãŒãïŒPythonã§ããsys.path[0]çžåœïŒãšã¿ãªããŠè§£æ±ºãããããã¢ãžã¥ãŒã«åç
§ãå«ããã¡ã€ã«ã察象ã«ããå Žåã¯ããã®ãã¡ã€ã«ãå±ãããããžã§ã¯ãã«ãŒãïŒäŸãã°go.modãããã±ãŒãžã®èµ·ç¹ãã£ã¬ã¯ããªïŒãã«ã¬ã³ããã£ã¬ã¯ããªã«ããŠå®è¡ããŠãã ããã
Javaã®å Žåããããžã§ã¯ãã«ãŒãé
äžã«src/main/javaïŒMaven/Gradleã®æ
£ç¿çãªãœãŒã¹ã«ãŒãïŒãååšããã°ãã¡ããåªå
ãããªããã°ãããžã§ã¯ãã«ãŒãèªäœããœãŒã¹ã«ãŒããšããŠè§£æ±ºããŸããåäžã€ã³ããŒãïŒimport com.example.Foo;ïŒãšã¯ã€ã«ãã«ãŒãã€ã³ããŒãïŒimport com.example.*;ïŒã®äž¡æ¹ã«å¯Ÿå¿ããŸãã
cd testdata/python/importproj
../../../ast-digger resolve-import main.py add
# â mathutils.py:1
../../../ast-digger resolve-import main.py add --json
# â {"file_path": "mathutils.py", "start_line": 1}
# JavaïŒãããžã§ã¯ãã«ãŒã = testdata/java/importprojãsrc/main/java ããœãŒã¹ã«ãŒããšããŠè§£æ±ºïŒ
cd testdata/java/importproj
../../../ast-digger resolve-import src/main/java/com/example/app/Main.java MathUtils
# â .../testdata/java/importproj/src/main/java/com/example/util/MathUtils.java:3
# JavaScript
cd ../../../testdata/javascript/importproj
../../../ast-digger resolve-import main.js add
# â mathutils.js:1
# Rust
cd ../../../testdata/rust/importproj
../../../ast-digger resolve-import main.rs add
# â utils.rs:1
# MarkdownïŒãªã³ã¯/ã¢ã³ã«ãŒã®åç
§å
解決ïŒ
cd ../../../testdata/markdown/references
../../../ast-digger resolve-import ref.md "#section-2"
# â ref.md:3
feedback â ãã£ãŒãããã¯ã®èšé²
ast-digger feedback <message> [--json]
AI ãšãŒãžã§ã³ããããŒã«å©çšäžã«çºçããåé¡ãæ©æŠã .workspace_cache/feedback.jsonl ã«ã¿ã€ã ã¹ã¿ã³ãä»ãã§èšé²ããŸãã
./ast-digger feedback "outline command was helpful"
# â Feedback recorded successfully.
./ast-digger feedback "outline command was helpful" --json
{
"message": "Feedback recorded successfully."
}
agent-context â CLI ã¹ããŒãã®ååŸ
ast-digger agent-context
ç»é²æžã¿ã®å šã³ãã³ãã»åŒæ°ã»ãªãã·ã§ã³ã®ã¹ããŒãããåžžã«JSONã§åºåããŸããAI ãšãŒãžã§ã³ããããŒã«å©çšãéå§ããåã«å®è¡ããããšã§ãæ£ç¢ºãªåŒã³åºãæ¹ãèªååŠç¿ã§ããŸãã
åºåã®æç²:
"directory": {
"description": "Print directory tree structure populated with incremental cached symbol outline.",
"arguments": [
{ "name": "dir_path", "type": "string", "required": false, "default": "." }
],
"options": [
{ "name": "--limit", "type": "integer", "default": "50", "description": "Max files to display in the output to avoid token bloating." },
{ "name": "--no-recursive", "type": "boolean", "default": "false", "description": "Scan only the top level of the directory tree; overrides --recursive." },
{ "name": "--recursive", "type": "boolean", "default": "true", "description": "Scan recursively down the directory tree (pass --recursive=false or --no-recursive to scan only the top level)." },
{ "name": "--json", "type": "boolean", "default": "false", "description": "Output structure in JSON format" }
]
}
AIãšãŒãžã§ã³ãã®æšå¥šã¯ãŒã¯ãããŒ
æšå¥šãããåºæ¬çãªæ¢çŽ¢ãããŒïŒã«ãŒãã® SKILL.md ã§å®çŸ©æžã¿ïŒã¯ä»¥äžã®éãã§ãïŒ
1. directory â ãããžã§ã¯ãå
šäœã®ã·ã³ãã«æ§æã俯ç°ïŒ--jsonæšå¥šïŒ
2. outline â 察象ãã¡ã€ã«ã®ã¹ã±ã«ãã³ã§æ§é ãææ¡ïŒ--jsonæšå¥šïŒ
3. locate â ç®çã®ã·ã³ãã«ã®è¡ç¯å²ã»ãµã€ãºãäºå確èª
4. symbol â ãµã€ãºã確èªããäžã§ãã³ãã€ã³ãã«å®è£
ã³ãŒããæœåº
5. references â 倿Žã®åœ±é¿ç¯å²ããããžã§ã¯ã暪æã§ç¢ºèªïŒ--project-rootã§çµãèŸŒã¿æšå¥šïŒ
é¿ããã¹ãã¢ã³ããã¿ãŒã³
- 巚倧ã·ã³ãã«ã®ç¡èšç»ãªå
šååŸ:
symbolã³ãã³ãã--no-truncateä»ãã§ç¡èšç»ã«èªã¿èŸŒããšãLLMã®ã³ã³ããã¹ããŠã£ã³ããŠãæµªè²»ãæšè«ç²ŸåºŠã®äœäžãæããŸãããŸãlocateã§ãµã€ãºã確èªããŠãã ããã - ç¡å¶éã®åç
§æ¢çŽ¢:
referencesã³ãã³ãã¯--project-rootã§å¯Ÿè±¡ãçµã蟌ãŸãã«å·šå€§ãããžã§ã¯ãå šäœãã¹ãã£ã³ãããšæéãããããŸãã
ãã£ãã·ã¥ãšå·®åã¹ãã£ã³
directory ã³ãã³ãã¯ãããžã§ã¯ãã«ãŒãã® .workspace_cache/symbols.dbïŒSQLiteïŒã«ã·ã³ãã«ã€ã³ããã¯ã¹ããã£ãã·ã¥ããfeedback ã³ãã³ãã¯åãã .workspace_cache/feedback.jsonl ã«ãã£ãŒãããã¯ã远èšããŸãã
- ååå®è¡: å šãã¡ã€ã«ãã¹ãã£ã³ããŠãã£ãã·ã¥ãæ§ç¯
- 2åç®ä»¥é:
mtimeãšSHA-256 ããã·ã¥ã§å€æŽãæ€ç¥ãã倿Žãã¡ã€ã«ã®ã¿åã¹ãã£ã³ node_modules,.git,.venv,__pycache__ã¯èªåçã«é€å€
ã©ã€ã»ã³ã¹
Apache License 2.0
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
ast-digger
command
Command ast-digger is the Go implementation of the AST-Digger CLI.
|
Command ast-digger is the Go implementation of the AST-Digger CLI. |
|
internal
|
|
|
apperr
Package apperr defines AST-Digger's custom error types and the exit code taxonomy used to translate errors into process exit codes.
|
Package apperr defines AST-Digger's custom error types and the exit code taxonomy used to translate errors into process exit codes. |
|
db
Package db implements SQLite-backed persistence for the file/symbol cache shared between the Go and Python implementations of AST-Digger.
|
Package db implements SQLite-backed persistence for the file/symbol cache shared between the Go and Python implementations of AST-Digger. |
|
outline
Package outline implements Outliner, which orchestrates skeleton generation, cached directory-tree synthesis, symbol location, reference search, and friction-feedback logging on top of the parser.Parser implementations and db.SymbolDatabase.
|
Package outline implements Outliner, which orchestrates skeleton generation, cached directory-tree synthesis, symbol location, reference search, and friction-feedback logging on top of the parser.Parser implementations and db.SymbolDatabase. |
|
parser
Package parser defines the common data model and interface shared by all language-specific AST parsers (Python, TypeScript, Go).
|
Package parser defines the common data model and interface shared by all language-specific AST parsers (Python, TypeScript, Go). |