Textify is a developer tool designed to prepare your codebase for Large Language Models (LLMs) like Claude, ChatGPT, and Gemini.
It flattens your project structure into a single, well-formatted text file. Instead of manually copy-pasting dozens of files, Textify scans your project, respects your .gitignore, filters out binaries, and applies custom inclusion rules defined in a simple configuration file.
- Smart Discovery: Automatically detects directory structures and file extensions to pre-populate your configuration.
- Workflow Driven: Simple
init,scan, andstartcommands to manage your context. - Directory-Scoped Configuration: Define different rules for different folders (e.g., only include
.tsfiles in/frontendbut.gofiles in/backend). - Granular Control: Use the
enabledflag to quickly include or exclude entire directory branches. - Smart Filtering: Automatically respects
.gitignoreand detects binary files (images, PDFs, executables) to keep output clean. - Force Includes: Easily include files normally ignored (like
.env.exampleor GitHub workflow configs) using the allowlist.
If you have Go installed, this is the fastest way to get started:
go install github.com/JohnEsleyer/textify/cmd/textify@latestgit clone https://github.com/JohnEsleyer/textify.git
cd textify
go build -o textify ./cmd/textify(Optional) Move the binary to your path:
sudo mv textify /usr/local/bin/Textify uses a three-step workflow: Initialize, Refine, and Start.
Navigate to your project root and run:
textify initThis scans your current directory structure, detects extensions used in each folder, and generates a textify.yaml configuration file. It automatically marks ignored folders (like node_modules or dist) as enabled: false.
If you add new directories to your project, you don't need to rebuild your config manually. Just run:
textify scanThis will detect new folders and append them to your textify.yaml while preserving your existing rules.
Open textify.yaml. You can customize what gets included by toggling the enabled flag or modifying extensions.
Example textify.yaml:
output_file: codebase.txt
dirs:
# Root Directory Rules
.:
enabled: true
extensions:
- md
- json
- yaml
include:
- .env.example
# Backend Directory Rules
cmd:
enabled: true
extensions:
- go
# Frontend Directory Rules
frontend:
enabled: true
extensions:
- ts
- tsx
- css
include:
- package.json
# Excluded Directory
node_modules:
enabled: falseOnce satisfied with your config, run:
textify startThis reads your configuration and generates codebase.txt (or whatever you named your output file).
The textify.yaml file gives you granular control over what gets sent to the LLM.
The name of the generated text file.
output_file: context_for_ai.txtThis section maps directory paths to rules.
- Keys: The directory path relative to the project root (e.g.,
.,src,src/components). - Inheritance: If a subdirectory is not explicitly listed in
dirs, it inherits the rules from its parent directory.
A boolean (true/false) that determines if the directory and all its children should be scanned.
- If
false, Textify will skip this entire branch.
A list of file extensions to include.
- If provided (e.g.,
[go, js]), only files with these extensions will be included. - If empty, all text files not ignored by
.gitignorewill be included.
A list of specific files or folders to Force Include, regardless of extension rules or .gitignore.
- Useful for including
.envfiles, specific config files in build folders, or dotfiles. - Supports standard glob patterns (e.g.,
scripts/*.sh).
Textify includes hardcoded logic to prevent scanning itself or common noise:
- Always Ignored:
.gitfolder,textify.yaml, and the definedoutput_file. - Binaries: Automatically detects and skips non-text files (images, compiled binaries).
- Gitignore: Respects your project's
.gitignorerules duringinitandscanto set defaultenabledstates.
- Fork the repository.
- Create your feature branch (
git checkout -b feature/amazing-feature). - Commit your changes (
git commit -m 'Add some amazing feature'). - Push to the branch (
git push origin feature/amazing-feature). - Open a Pull Request.
Distributed under the MIT License. See LICENSE for more information.