Skip to content

Latest commit

 

History

History
77 lines (54 loc) · 1.51 KB

README.md

File metadata and controls

77 lines (54 loc) · 1.51 KB

file-enumerator

Copy code in a folder for use with LLMs.

Aims to honor .gitignore and .dockerignore files and ignore all dev and non-text files.

Perfect for use with pbcopy or outputting to a text file.

Requirements

  • libmagic

    macOS

    $ brew install libmagic

    Linux (Debian/Ubuntu)

    $ sudo apt-get install libmagic1

    Windows

    On Windows, you can install the python-magic-bin package which includes the necessary binaries.

    $ pip install python-magic-bin

Usage

Create a virtual environment, unless installing on host.

macOS/Linux

$ python3 -m venv venv && source venv/bin/activate

Windows

$ python -m venv venv && .\venv\Scripts\activate

Install requirements

$ pip install -r requirements.txt

Run. On macOS this works great in combination with pbcopy

# macOS/Linux
$ python file_enumerator.py ~/workspace/path/to/copy

# Windows
$ python file_enumerator.py C:\path\to\copy

If you do not provide a path to copy, the current directory will be used.

Installation

  1. Install the necessary requirements and python libraries as noted above.
  2. Alias the script. This can be added to your ~/.bashrc or ~/.zshrc file on macOS/Linux, or set up as a function in PowerShell on Windows.

macOS/Linux

$ alias file_enum='python /path/to/file_enumerator.py'

Windows (PowerShell)

function file_enum {
    python C:\path\to\file_enumerator.py $args
}