bfiles 2025-04-30
Major rewrite of CLI, core bundling engine, exclusion system, and output modules
18 files · 2,767+ · 445-

CLI overhaul

1 file changed
  • cli.py Fully-featured Click command with --version, --log-level, --no-gitignore, --max-files, --exclusion-report; structured error handling with exit codes; BfilesConfig integration
  • Replaced simple flat CLI with a fully-featured Click command including --version, --log-level, --no-gitignore, --max-files, and --exclusion-report options baseline behavioral
    1 file
    • cli.py
  • Added structured error handling with specific exit codes (0 for success, 1 for general errors, 2 for missing dependencies) remediate internal
    1 file
    • cli.py
  • CLI now creates a BfilesConfig instance and passes it to bundle_files() decouple behavioral
    1 file
    • cli.py
  • Added dynamic version detection via importlib.metadata baseline internal
    1 file
    • cli.py

Core bundling engine rewrite

1 file changed
  • core.py Complete rewrite from ~90 to ~460 lines; multi-phase architecture with bundle header/footer, timestamp, statistics tracking, and ExclusionManager return
  • Complete rewrite from ~90 lines to ~460 lines with a multi-phase architecture: decouple architectural
    1 file
    • core.py
  • Added bundle header/footer writing with timestamp and config metadata baseline internal
    1 file
    • core.py
  • Returns ExclusionManager instance for post-processing report generation decouple internal
    1 file
    • core.py
  • Tracks detailed statistics: processed files, included files, duplicates, empty files, IO errors, encoding errors decouple internal
    1 file
    • core.py

Exclusion system expansion

1 file changed
  • exclusions.py Massively expanded from ~63 to ~505 lines; gitignore integration via pathspec; ExclusionReason enum; exclusion report generation; pattern validation
  • Massively expanded from ~63 lines to ~505 lines decouple internal
    1 file
    • exclusions.py
  • Added .gitignore integration via pathspec library with hierarchical gitignore loading instantiate internal
    1 file
    • exclusions.py
  • Introduced ExclusionReason enum for typed exclusion tracking decouple internal
    1 file
    • exclusions.py
  • Added exclusion report generation to file instantiate internal
    1 file
    • exclusions.py
  • Pattern validation and logging for invalid regex patterns remediate behavioral
    1 file
    • exclusions.py

Configuration modernization

1 file changed
  • config.py Expanded BfilesConfig with use_gitignore, hash_algorithm, log_verbosity; ExcludePattern type alias; DEFAULT_OUTPUT_FILENAME constant
  • Expanded BfilesConfig with use_gitignore, hash_algorithm, and log_verbosity settings baseline internal
    1 file
    • config.py
  • Added ExcludePattern type alias and _get_default_exclude_patterns() factory function instantiate internal
    1 file
    • config.py
  • Default output filename now configurable via DEFAULT_OUTPUT_FILENAME constant decouple behavioral
    1 file
    • config.py

Output and display

1 file changed
  • output.py Expanded from simple table helper to full summary table display, text summary generation, and rich terminal file operation status indicators
  • Expanded from simple table helper to full summary table display and text summary generation decouple behavioral
    1 file
    • output.py
  • Rich terminal output with file operation status indicators decouple behavioral
    1 file
    • output.py

Package init

1 file changed
  • __init__.py Proper __all__ exports for BfilesConfig, bundle_files, and logger
  • Added proper __all__ exports for BfilesConfig, bundle_files, and logger instantiate internal
    1 file
    • __init__.py

Metadata improvements

2 files changed
  • metadata.py FileMetadata enhanced with operation field tracking file state (included, excluded, skipped, error)
  • metadata_writer.py MetadataWriter now accepts BfilesConfig for template-driven output
  • FileMetadata enhanced with operation field for tracking file state (included, excluded, skipped, error) decouple internal
    1 file
    • metadata.py
  • MetadataWriter now accepts BfilesConfig for template-driven output decouple behavioral
    1 file
    • metadata_writer.py

Infrastructure

4 files changed
  • .gitignore Replaced with comprehensive generated version covering Python, macOS, editors, Terraform, and more
  • env.sh Environment setup script added
  • pyproject.toml Updated with new dependencies
  • test_cli.py Removed old basic CLI tests (17 lines)
  • Replaced comprehensive .gitignore with a thorough generated version covering Python, macOS, editors, Terraform, and more baseline internal
    1 file
    • .gitignore
  • Added env.sh environment setup script baseline internal
    1 file
    • env.sh
  • Updated pyproject.toml with new dependencies baseline internal
    1 file
    • pyproject.toml
  • Removed old tests/test_cli.py (17 lines of basic tests removed) qualify internal
    1 file
    • test_cli.py