dir2txt is a fast CLI tool designed to streamline the process of exporting directory structures and file contents into cleanly formatted .txt or .json files. It simplifies AI workflows by preparing project dumps that are perfect for feeding into language models and enhancing the organization of codebases.
dir2txt is a powerful command-line interface (CLI) tool designed to export a directory's structure and contents into neatly formatted .txt or .json files. This utility is optimized for speed and precision, transforming entire project directories into readable outputs effortlessly.
.gitignore, .dockerignore, and other custom ignore files to manage file selections effectively.dir2txt serves as a critical first step in various AI workflows, including those utilizing GPT-based agents and Retrieval-Augmented Generation (RAG). It prepares codebases for context ingestion, allowing for smoother interactions with language models.
Use Cases Include:
The following pipeline illustrates how dir2txt fits into a broader AI processing workflow:
[ Source Code Directory ]
│
▼
📂 dir2txt
(Tree + Content Dump)
│
▼
🔗 Chunking + Embedding
(e.g., LangChain, llama-index)
│
▼
🗂️ Vector DB / Index
(ChromaDB, Weaviate, FAISS)
│
▼
🤖 LLM / AI Agent
(e.g., GPT, Claude, Mistral, LLaMA)
To use dir2txt, execute the following command for optimal results:
dir2txt ./my-project \
--ignore node_modules,build \
--strip-comments \
--include-dotfiles \
--json
dir2txt offers a seamless solution for transforming messy source directories into structured inputs suitable for AI processing, enhancing the efficiency and clarity of information retrieval in modern programming environments.
No comments yet.
Sign in to be the first to comment.