A command-line tool to combine files from a directory into a single file for AI processing, with flexible filtering options.
- Combines multiple text files into one output file
- Can process a remote git repository in a temporary directory
- Supports configuration via CLI options and config files (YAML)
- Filters files by:
- Size
- File extensions (e.g.,
.txt,.md) - Directory inclusion/exclusion
- File inclusion/exclusion
- Optionally respects
.gitignorerules (can be disabled)
- Preserves file boundaries with headers showing filename and size
- Customizable input directory and output file
cargo install feedyouraiOr,
cargo install --git https://github.com/atrtde/feedyourai.gitThis installs the fyai binary to ~/.cargo/bin/. Ensure this directory is in your PATH.
Run fyai in your terminal to combine files:
You can specify options in a config file (YAML format):
- Local config:
./fyai.yaml(used if present in current directory) - Global config: System config directory (platform-specific), used if no local config found
- Precedence: Local config overrides global config. CLI options override both config files.
To see the exact global config path on your system, run:
fyai init --globaldirectory: ./src
output: combined.txt
include_ext:
- md
- txt
exclude_dirs:
- node_modules
- dist
min_size: 10240
max_size: 512000
respect_gitignore: true
tree_only: falseAll CLI options can be set in the config file. CLI flags always take precedence.
fyai
fyai --help # show help- Combines all files from the current directory into
fyai.txt
-
Combine only
.txtand.mdfiles from a specific directory:fyai -i ./docs --include-ext txt,md
-
Exclude all
.logand.tmpfiles from the output:fyai --exclude-ext log,tmp
-
Include only files named
README.mdandmain.rsfrom thesrcanddocsdirectories:fyai --include-dirs src,docs --include-files README.md,main.rs
-
Exclude all files named
LICENSEandconfig.jsonfrom any directory:fyai --exclude-files LICENSE,config.json
-
Include all files (no size minimum) up to 1MB:
fyai -n 0 -m 1048576
-
Custom output file with files between 10KB and 500KB, excluding
distandnode_modulesdirectories:fyai -n 10240 -m 512000 -o ai_input.txt -x dist,node_modules
-
Output only the project directory structure (no file contents):
fyai --tree-only -o tree.txt
-
Ignore .gitignore rules and include all files (even those normally excluded):
fyai --respect-gitignore false -
Run against a remote GitHub/GitLab repository without leaving the clone on disk:
fyai --repo https://github.com/owner/repo.git --repo-branch main
-
Run against a specific commit:
fyai --repo https://github.com/owner/repo.git --repo-commit 1234abcd
-
Generate a config template:
fyai init
The combined file includes headers for each source file:
- File: example.txt (12345 bytes)
[contents of example.txt]
- File: notes.md (67890 bytes)
[contents of notes.md]
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Submit a pull request
GPL-3.0 or later. See LICENSE for more details.
See CHANGELOG.md for release notes.
