Turn your codebase into AI-ready text context instantly.
TXT-Forge scans your project, detects your tech stack (TypeScript, Python, Rust, etc.), and merges your code into optimized text files. It handles .gitignore rules automatically and splits large files so they fit into ChatGPT, Claude, or Gemini context windows.
You don't need to clone this repo. Just run it anywhere:
# Install globally
npm install -g txt-forge
# Run in any project folder
txt-forgeThis will launch a local GUI in your browser.
- Auto-Detection: Smartly identifies frameworks (React, SvelteKit, Django, Laravel, etc.).
- Visual Tree Selection: Pick exactly which files or folders to include.
- Smart Splitting: Files larger than your limit (e.g., 75k chars) are split at function boundaries, not randomly.
- Respects Git: Automatically respects your .gitignore rules.
- Privacy First: Runs 100% locally. Your code never leaves your machine.
Ensure you have Node.js installed (v18 or higher recommended).
npm install -g txt-forgeSimply run the command in your project folder to launch the local web interface:
txt-forgeSkip the browser and instantly convert your project using auto-detection:
# Auto-detect and save to ./TXT-Forge/ folder
txt-forge --auto
# Short alias:
txt-forge -a
# Save to Global Vault instead (~/.txt-forge-vault)
txt-forge -a --vault
# Short alias:
txt-forge -a -v
# Save to a specific custom path
txt-forge -a --custom "C:/Users/Dev/Desktop/MyContext"
# Short alias:
txt-forge -a -c "./my-output"
# Include ignored files (like package-lock.json) in the Source Tree map
# (Useful for giving AI context on dependencies without including the file content)
txt-forge -a --ignore
# Short alias:
txt-forge -a -i
# Single File Mode (Disable splitting into multiple files)
txt-forge -a --single
# Short alias:
txt-forge -a -s
# Combine flags (Auto + Vault + Single File)
txt-forge -a -v -sTXT-Forge creates a folder (default: TXT-Forge/) containing:
- Source-Tree.txt: A visual map of your project structure.
- Source-1.txt: Your combined code files with clear headers.
Issues and Pull Requests are welcome!
- Clone the repo
- Run
npm install - Run
npm run devto start the development server
MIT © DavidMGDev