Skip to content

petergpt/Code-to-TXT-for-LLMs

Repository files navigation

Code to TXT - Replit Extension

Note: This README was generated by AI based on the project codebase.

Overview

Code to TXT is a Replit extension that helps developers gather their code files into a single text file, making it easier to work with Large Language Models (LLMs). The extension provides a user-friendly interface to select specific files and folders from your codebase.

Features

  • 🔍 Scans your codebase while intelligently skipping common non-code directories (node_modules, .git, etc.)
  • ✅ Auto-selects common code file types (.js, .jsx, .ts, .tsx, .py, .json, .html, .css)
  • 📁 Folder-based selection/deselection with partial state support
  • 📊 Shows line count statistics for files and folders
  • 📝 Generates a structured text file with:
    • Table of contents (file tree)
    • Complete file contents
    • Timestamped output files

Technical Details

  • Built with React and TypeScript
  • Uses Replit Extensions API for file system operations
  • Implements efficient file scanning with concurrent reads
  • Handles large codebases with pagination and size limits

Usage

  1. Click "Scan Codebase" to analyze your project
  2. Select/deselect files and folders as needed
  3. Click "Generate a TXT File" to create the output
  4. Find your generated file named code-to-text-{timestamp}.txt

File Size Limits

  • Maximum file size: ~2MB (in base64 form)
  • Automatically skips binary files (images, PDFs, etc.)

License

MIT License

Copyright (c) 2024

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Releases

No releases published

Packages

 
 
 

Contributors