Skip to content

Convert folder file contents to text to assist conversations with large language models like ChatGPT, Claude, Gemini, etc.

Notifications You must be signed in to change notification settings

katio/folder2txt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Folder2Txt

Convert folder file contents to text for use with large language models like ChatGPT, Claude, Gemini, etc.

Quick Documentation

To use Folder2Txt, simply run the following command with two parameters:

node folder2txt.js folder=<folder path> output=<output path>

Example:

node folder2txt.js folder=/c/git/folder2txt/ output=/c/public/output.txt

This will recursively process all files in the specified folder and its subfolders, writing the content to the specified output file.

Full Documentation

Language Selection

By default, Folder2Txt uses English for its output messages. To switch to Spanish, add the lang=es parameter to the command:

node folder2txt.js folder=<folder path> output=<output path> lang=es
node folder2txt.js folder=/c/git/folder2txt/ output=/c/public/out2.txt lang=es

Ignore Configuration

You can specify folders and files to ignore during processing by editing the ignore.json file. See examples in the ignore-json-examples folder.

Example ignore.json

{
  "folders": ["node_modules", ".git"],
  "files": [".DS_Store"]
}

You can also use wildcards (*), example:

"files": [
    ".DS_Store",
    "*.dll",
    "*.exe",
    "*.pdb",
    "appsettings*.json",
    "*.user",
    "*.Designer.cs"
]

Usage

  • folder: Path to the folder to be processed.
  • output: Path to the output file where the content will be written.
  • lang: (Optional) Language for output messages (default is English).

Example Execution

English Output

node folder2txt.js folder=/c/git/folder2txt/ output=/c/public/output.txt

Spanish Output

node folder2txt.js folder=/c/git/folder2txt/ output=/c/public/out2.txt lang=es

About

Convert folder file contents to text to assist conversations with large language models like ChatGPT, Claude, Gemini, etc.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published