Hand a model the whole repository
yek is a free, open-source command-line tool from Proofline. Point it at a repository, a directory or a list of files, and it writes their text into one file you can paste into a model or give to a coding agent.
brew install yek
One file, most important last
Run yek in a repository and it writes one file to a temporary directory, then prints the file's path. Each source file appears under a >>>> line with its path:
>>>> README.md
... content ...
>>>> tests/test.rs
... content ...
>>>> src/main.rs
... content ...
Files that yek rates more important come later, closest to the question you ask after them. Your priority rules set the order first; within them, files changed more recently in Git rank higher.
When the output goes to a pipe, yek streams it instead of writing a file:
yek src/ | pbcopy
Choose the files
yek follows the repository's .gitignore rules and skips binary files and other built-in patterns, such as lock files. Name directories, files or quoted glob patterns to narrow the input:
yek src/ tests/
yek "src/**/*.ts" docs/README.md
Add patterns with --ignore-patterns, or bring back a file that a built-in pattern skips with --unignore-patterns.
Stay within a context window
Cap the output by tokens or by bytes. When the files do not fit, yek leaves out the lower-ranked ones and keeps the files it rates most important.
yek --tokens 128k
yek --max-size 100KB src/
Token mode counts with OpenAI's cl100k_base encoding. Other models split text differently, so leave some room below their limit.
Configure a repository
A yek.yaml at the repository root keeps the same choices for everyone who runs yek there. yek.toml and yek.json work too.
ignore_patterns:
- "__generated__/**"
priority_rules:
- score: 100
pattern: "^src/lib/"
- score: 80
pattern: "^docs/"
tokens: "128k"
The same file can set the output directory, file name and template. --json, --line-numbers, --tree-header and --tree-only change what yek writes. The README lists every option.
Install
With Homebrew on macOS or Linux:
brew install yek
With the installer script on macOS or Linux, which downloads the latest release:
curl -fsSL https://proofline.sh/yek/install.sh | bash
On Windows, in PowerShell:
irm https://proofline.sh/yek/install.ps1 | iex
With Cargo, which builds from source:
cargo install yek
With Nix:
nix profile install nixpkgs#yek
Archives for macOS, Linux and Windows on x86-64 and ARM64 are on GitHub Releases. yek connects to the network only when you run yek --update, which downloads the latest release from GitHub.
From Proofline
Proofline maintains yek in the open, beside its other open-source tools. Report bugs and propose changes on GitHub. yek stands on its own: it needs no Proofline account and sends nothing to Proofline.
Proofline itself is an evidence-first production agent for teams on AWS and Google Cloud. It checks each change before it ships, against the code and the environment it deploys to. How Proofline works