When working in restricted environments where AI coding assistants can't be installed, you're left with web-based AI chatbots. To get meaningful assistance, you need to provide context about your codebase, but manually copying and pasting files is tedious.
There are some great tools out there that solve similar problems:
- Gitingest - A feature-rich Python package for ingesting Git repositories
- Repomix - A JavaScript/Node.js package for repository packing
While these tools are excellent, they require installing packages which isn't straightforward in air-gapped work environments! So, I just wanted something more portable that doesn't require installing packages or dependencies. Just a simple shell script that works anywhere you have a terminal (bash or PowerShell).
- Zero dependencies: Just a shell script that works out of the box
- Cross-platform: Available for both Unix/Linux (bash) and Windows (PowerShell)
- Smart filtering: Automatically excludes binary files, large files, and common non-source directories
- Configurable options: Include/exclude patterns, maximum file size, debug output
- Jupyter notebook support: Converts .ipynb files to readable markdown format (jq or jupyter nbconvert are required, otherwise you will get raw ouptputs)
- Encoding handling: Properly handles files with different character encodings
- Output flexibility: Can output to file or stdout for piping to other tools
| -o, --output FILE | Output file path (default: digest.txt, use '-' for stdout) |
| -i, --include PATTERN | Include files matching pattern (can be used multiple times) |
| -e, --exclude PATTERN | Exclude files matching pattern (can be used multiple times) |
| -s, --max-size SIZE | Maximum file size (default: 1MB, can use K/M/G suffixes) |
| -d, --debug | Enable debug output |
| -h, --help | Show help message |
The script automatically excludes:
- Binary files (based on extension and content analysis)
- Large files (configurable size limit)
- Common non-source directories (.git, node_modules, pycache, etc.)
- Files with binary MIME types
It always includes common source code file types (.py, .js, .ts, .java, etc.) and configuration files.
This project is still in early development and needs more testing on diverse codebases. Since I built this in an afternoon, there's likely room for improvement! I welcome contributions in the following areas:
- Testing on different types of projects
- Improving file type detection
- Adding support for more file formats
- Enhancing the filtering logic
- Cross-platform compatibility improvements
Feel free to submit issues, feature requests, or pull requests!
MIT License - see the LICENSE file for details.
.png)

