PrintDirTree
v1.0.1
printdirtree 는 디렉토리 트리의 구조를 인쇄하는 명령 줄 유틸리티로 제외 할 파일 및 디렉토리를 쉽게 지정할 수 있습니다.
이제 모든 파일의 내용을 인쇄 할 수도 있으며, 이는 LLM을 프롬프트하는 데 매우 유용합니다.
예:
$ printdirtree
PrintDirTree
├── MANIFEST.in
├── README.md
├── printdirtree
│ ├── __init__.py
│ └── __main__.py
└── setup.py이 도구는 Chatgpt 프롬프트를 돕는 데 매우 유용합니다.
PIP로 쉽게 printdirtree 설치하십시오.
pip install printdirtree printdirtree 사용하려면 명령을 실행 한 다음 선택적 인수를 실행하여 출력을 귀하의 요구에 맞게 조정하십시오. 기본 사용법은 현재 디렉토리 구조를 인쇄합니다.
printdirtree특정 디렉토리의 구조를 인쇄하려면 :
printdirtree --dir /path/to/directory특정 디렉토리 및/또는 파일 패턴 제외 :
printdirtree --exclude-dir node_modules --exclude-dir .git --exclude-file " *.log "향후 실행에 대한 제외를 저장하려면 :
printdirtree --exclude-dir temp --exclude-file " *.tmp " --save현재 저장된 제외가 무엇인지 확인하십시오.
printdirtree --view-exclusions제외를 제거하고 디렉토리 또는 파일을 인쇄물에 다시 포함시키기 위해 :
printdirtree --include-dir temp --include-file " *.tmp " --save디렉토리 구조와 모든 파일의 내용을 모두 표시합니다.
printdirtree --show-contents이렇게하면 디렉토리 트리와 각 파일의 내용이 상대 경로를 주석으로 출력합니다. 예를 들어:
temp
├── a.py
└── b.py
# temp/a.py
print("a.py")
# temp/b.py
print("b.py")
이는 명확하고 읽을 수있는 형식의 구조와 컨텐츠를 모두 제공하므로 LLMS와 코드를 공유 할 때 특히 유용합니다.
printdirtree 설치 한 후 프로젝트 디렉토리의 구조를 시각화하기 위해 실행할 수 있습니다. 다음은 .git 파일을 제외하는 예제입니다.
printdirtree --exclude-file " .git " PrintDirTree 프로젝트의 출력은 다음과 같습니다.
PrintDirTree
├── MANIFEST.in
├── README.md
├── printdirtree
│ ├── __init__.py
│ └── __main__.py
└── setup.py