Coder Social home page Coder Social logo

gpt_context_provider's Introduction

File Consolidation Script

This Bash script recursively explores a specified directory, appending the contents of all files found within that directory and its subdirectories into a single text file. Each file's path and name is included in the output as a comment line, followed by the actual contents of the file.

The main utility of this file is to use to give full context of your project to a Large Language Model, such as GPT.

Features

  • Recursive File Processing: The script searches through all subdirectories of the specified directory, processing all files.
  • Flexible Output Filename: If only the directory path is provided when running the script, the output file will automatically be named after the directory, suffixed with .txt. If an output file name is provided, the script will use that instead.

Prerequisites

To use this script, you will need:

  • A Unix-like environment (Linux, BSD, macOS)
  • Bash shell
  • Basic command-line utilities (find, cat, echo)

Installation

  1. Download the script consolidate_files.sh.
  2. Make the script executable:
   chmod +x consolidate_files.sh

Usage

To run the script, you can use the following commands:

./consolidate_files.sh /path/to/directory output.txt

This command specifies both the directory to explore and the name of the output file.

./consolidate_files.sh /path/to/directory

If the output filename is not provided, the script will name the output file based on the last segment of the directory path, adding a .txt suffix.

Notes

The script handles plain text files. Binary files or files with special characters in their names may not be processed correctly.

gpt_context_provider's People

Contributors

dpuertamartos avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.