Skip to main content

TUI application to combine and transform source code files for LLM usage

Project description

Code Bundler

A text-based UI (TUI) tool for combining and transforming source code files for large language model (LLM) usage.

Overview

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

Installation

pip install codebundler

Usage

Code Bundler provides a TUI interface for selecting and bundling files:

codebundler /path/to/source/directory output.txt

Command-line Options

  • --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

Keyboard Controls

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

Mouse Controls

  • Click directories: Expand/collapse directories
  • Click files: Toggle file selection

Examples

Basic Usage:

codebundler ./my-project output.txt

Select 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

Features

  • 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

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

License

MIT License - see LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codebundler-0.1.2.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codebundler-0.1.2-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

File details

Details for the file codebundler-0.1.2.tar.gz.

File metadata

  • Download URL: codebundler-0.1.2.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for codebundler-0.1.2.tar.gz
Algorithm Hash digest
SHA256 aeb6929f855e7330dd087f7481fb1dae648da2ae4e911a2cacae4f28dcdb2288
MD5 a4b8ca3fcf079161db520e1863e32c6b
BLAKE2b-256 d3500c9f8d3e4a6dbf8a5cdb37231ba32cc95125cc688484a2b1d5951dfc262e

See more details on using hashes here.

File details

Details for the file codebundler-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: codebundler-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 24.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for codebundler-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c1a8b7cd6e7fcabc0e9ca27e1e2455a607efda79ede4f331a3d4ef76c7baa117
MD5 396ff8e068d13a2c1b060c4863731cc7
BLAKE2b-256 203f9c2d68494776e85e0b1f2fd3f7ce807a4e0feaf2b4e8d7476e9eb23ccde8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page