yek CLI

yek packs the text files of a repository into one document for a language model, honors .gitignore and puts the most important files last

  • 2,475 ★ on the repository
  • Last commit
  • MIT
CLI

Extended access

Why this level

  • Reads every text file in the chosen folders, including keys and passwords missing from `.gitignore`
  • The main install method runs a script from the author's domain through `curl | bash`
All reasons and checks

mohsen1/yek

Install

Manual install

curl -fsSL https://azimi.me/yek.sh | bash

For macOS and Linux. The script is fetched from the author's domain, so read it before running.

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • Reads every text file in the chosen folders, including keys and passwords missing from `.gitignore`
  • The main install method runs a script from the author's domain through `curl | bash`

This is third-party code. Review the repository files before installing.

What it does

yek is a Rust command line program that serializes a folder or repository into a single text document. Each file comes with a `>>>> path` header, and the header template changes with `--output-template`. The file list follows `.gitignore` rules plus the program's own: binary and oversized files are skipped. The input can be folders, single files and glob patterns, several per command. File order follows priority. From git history yek works out which files changed more often and matter more, and places them near the end of the output, because according to the author models pay more attention to the end of the context. Your own priority rules and the git history bonus live in `yek.yaml` (also `yek.toml` and `yek.json`): `priority_rules`, `git_boost_max`. Size is capped with `--max-size` in bytes and `--tokens` in tokens: files that do not fit are dropped and the important ones stay. When output goes to a pipe, for example `yek src/ | pbcopy`, the program prints the content to standard output; otherwise it writes a file into a temporary folder and prints the path. There is JSON output, line numbers, and a directory tree at the start (`--tree-header`) or instead of the contents (`--tree-only`).

Who it is for. For developers who hand a model a whole project or part of it in one request and want to fit a token limit without choosing files by hand.

Good fit when

  • You need to paste a whole `src/` folder into a model chat: `yek src/ | pbcopy` puts the content on the macOS clipboard
  • The context is limited and the model should get the most significant files: `yek --tokens 128k` drops what does not fit
  • The project has generated folders and data to exclude through `ignore_patterns` in `yek.yaml`
  • You need output for a script: the `--json` flag returns the result as JSON
  • An agent should see the project structure first: `yek --tree-only` prints only the directory tree

Not a fit when

  • You need an MCP server through which an agent packs the repository itself: yek is a command line tool only and has no MCP mode
  • You want code compressed to signatures and token counts per file: Repomix does that, while yek caps the size but does not compress code
  • The repository holds keys and passwords outside `.gitignore`: secret filtering is not described in the yek documentation and the output goes to the model whole
  • You need the output split into several files by size: according to the documentation yek puts the result into one document

Example request

Pack the src folder and the tests into one file for a 128 thousand token context and tell me how many files fit

Limitations

  • The documentation has no secret check. A `.env` file or a key missing from `.gitignore` can end up in the output.
  • The main install method runs a script from the author's domain through `curl | bash` on macOS and Linux or `irm | iex` in PowerShell. Read the script before running it.
  • Binary files are skipped by an extension list, and extra extensions can be added only in the config file (`binary_extensions`).
  • Priority rules in `yek.yaml` are regular expressions over the file path, so test them on your own project.
  • The documentation's comparison with Repomix, where yek is called 230 times faster on the Next.js project, comes from the author and a single run, with no independent measurement.

How to disable. yek runs only when you call it and does not hook into the agent. Delete the executable that the install script placed, or run `cargo uninstall yek` if you installed from source. The `yek.yaml` file in a project is removed like any other project file.

FAQ

How does yek decide which files matter more?

It reads git history and raises the priority of files that changed more often. Your `priority_rules` from `yek.yaml` also apply: a rule with a higher `score` gives its files higher priority, and the final output puts the highest priority last.

What happens when files do not fit the limit?

With `--tokens` or `--max-size`, yek drops the files that do not fit and tries to keep the important ones. The default limit in byte mode is 10 MB.

Where does yek write the result?

When output goes to a pipe, it is printed to standard output. Otherwise, in a terminal, yek creates a file in a temporary folder and prints the path. `--output-dir` sets the folder and `--output-name` sets the file name in the current folder.

Can I change the file header format?

Yes, with `--output-template` or `output_template` in `yek.yaml`. The template must contain `FILE_PATH` and `FILE_CONTENT`. By default the header looks like `>>>> FILE_PATH`.

Does yek work on Windows?

The documentation gives a PowerShell install with `irm https://azimi.me/yek.ps1 | iex`, and the repository holds the `install_yek.ps1` script and an install check in CI.

Discussion

No questions or reviews yet.

CLI tools

A Rust CLI that packs a codebase into one prompt with a file tree, templates and token estimates

CLIExtended access7.7KRepository stars

Structural code search, lint and rewrite on the syntax tree, with patterns written like ordinary code

CLIExtended access16.4KRepository stars

A Rust binary for agents and the terminal that uses tree-sitter to find a symbol's definition, its calls and file dependencies

MCP serverMinimal access357Repository stars
Editors’ pick

Packs a repository into one LLM-ready file with token counts, code compression and secret filtering, also runs as an MCP server

CLIExtended access29.1KRepository stars

A terminal diff viewer: all files in one stream, and an agent with the hunk-review skill walks through the changes and leaves line comments

CLIExtended access9.7KRepository stars

README in short

The documentation opens with what yek does by default and a diagram of the output for a small project. Next come installation, command examples, the flag reference with detailed descriptions and an example `yek.yaml`. The repository has Rust sources with per-module tests, install scripts for Unix and Windows, benchmarks and an `ARCHITECTURE.md` file. The roadmap section points to feature requests in the tracker.

README badge

Report a problem

Foxx AIyek
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.