A text-based UI (TUI) tool for combining and transforming source code files for large language model (LLM) usage.
Code Bundler helps developers package multiple source code files into a single consolidated file for sharing with LLMs like Claude, ChatGPT, or other AI assistants. It features:
- Interactive TUI (Text User Interface) for intuitive file selection
- Support for any file type with customizable selection patterns
- Source code transformations (comment and docstring removal)
- Real-time file monitoring and automatic rebuilding
- Clipboard integration for easy sharing with LLMs
pip install codebundlerCode Bundler provides a TUI interface for selecting and bundling files:
codebundler /path/to/source/directory output.txt--ignore=PATTERNS: Comma-separated glob patterns to ignore (e.g.,__pycache__,*.meta)--select=PATTERNS: Comma-separated glob patterns to select (e.g.,*.py,*.md)--strip-comments: Remove single-line comments--remove-docstrings: Remove Python docstrings--yes: Skip confirmation and begin watching immediately-v, --verbose: Increase output verbosity (can be used multiple times)-q, --quiet: Suppress non-error output
| Key | Action |
|---|---|
| Space/Enter | Toggle selection of current node |
| a | Select all files |
| n | Deselect all files |
| r | Rebuild the bundle |
| c | Copy bundle to clipboard |
| h | Show/hide help screen |
| q | Quit the application |
- Click directories: Expand/collapse directories
- Click files: Toggle file selection
Basic Usage:
codebundler ./my-project output.txtSelect only Python and Markdown files:
codebundler ./my-project output.txt --select="*.py,*.md"Ignore specific directories and strip comments:
codebundler ./my-project output.txt --ignore="node_modules,__pycache__" --strip-comments- Interactive File Selection: Select files with keyboard or mouse
- Empty Directory Support: Select/deselect empty directories
- Multi-select: Select multiple files across the project
- Transformation: Optionally remove comments and docstrings
- Live Monitoring: Automatically rebuild when selected files change
- Clipboard Integration: Copy output directly to clipboard
- Format Awareness: Maintains correct comment prefixes based on file extensions
- In-app Help: Press 'h' to view all keyboard shortcuts
Contributions are welcome! See CONTRIBUTING.md for guidelines.
MIT License - see LICENSE file for details.