A dead simple CLI tool to convert any project folder into a text file, useful for AI prompts, documentation, and more.
Run repo2txt without installation using these one-liners:
# Using npx (npm)
npx @jimfilippou/repo2txt /path/to/your/project
# Using pnpm dlx
pnpm dlx @jimfilippou/repo2txt /path/to/your/project
# Using yarn dlx
yarn dlx @jimfilippou/repo2txt /path/to/your/project
# Using bun
bun x @jimfilippou/repo2txt /path/to/your/project- Convert an entire repository into a single text file
- Exclude specific directories or files
- Handles binary files gracefully
- Easy to use CLI interface
You can install @jimfilippou/repo2txt globally using npm, yarn, pnpm, or bun.
npm install -g @jimfilippou/repo2txtyarn global add @jimfilippou/repo2txtpnpm add -g @jimfilippou/repo2txtbun add -g @jimfilippou/repo2txtAfter installation, you can use the repo2txt command to convert a repository to a text file.
repo2txt /path/to/your/projectThis will create a repo2txt.txt file in the specified project directory.
You can exclude specific directories using the --exclude flag:
repo2txt /path/to/your/project --exclude node_modules dist .gitThe tool automatically excludes the following directories and files:
node_modules, dist, .git, .next, .vscode, .idea, .env, Thumbs.db,
yarn.lock, npm-debug.log, pnpm-lock.yaml, package-lock.json, repo2txt.txt
The generated repo2txt.txt file will contain:
- A project structure overview
- The contents of each file (excluding binary files)
Binary files will be noted but their contents will not be included.
- Generate comprehensive project overviews for AI prompts
- Create documentation snapshots
- Easily share project structures and contents
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Dimitrios Filippou info@jimfilippou.com
If you encounter any issues or have questions, please open an issue on GitHub.