From eed6cda0c1001fa3eb9cafc91fcc0b6b54bff039 Mon Sep 17 00:00:00 2001 From: Mohsen Azimi Date: Sun, 19 Jan 2025 11:39:28 +0700 Subject: [PATCH 1/2] fix: update readme --- README.md | 99 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 52 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index 4a998cb..f7c9e93 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,35 @@ A fast Rust based tool to read text-based files in a repository or directory, ch - Supports processing multiple directories in a single command. - Configurable via a `yek.toml` file. +Yek ([يک](https://fa.wikipedia.org/wiki/۱)) means "One" in Farsi/Persian. + +Consider have a simple repo like this: + +``` +. +├── README.md +├── src +│ ├── main.rs +│ └── utils.rs +└── tests + └── test.rs +``` + +Running `yek` in this directory will produce a single file and write it to the temp directory with the following content: + +```txt +>>>> README.md +... content of README.md ... +>>>> tests/test.rs +... content of tests/test.rs ... +>>>> src/utils.rs +... content of src/utils.rs ... +>>>> src/main.rs +... rest of the file ... +``` + +> `yek` will priotize more important files to come last in the output. This is useful for LLM consumption. + ## Installation ### Via Homebrew (recommended for macOS) @@ -58,31 +87,43 @@ export PATH=$(pwd)/target/release:$PATH ### Examples -Process current directory: +Process current directory and write to temp directory: ```bash yek ``` -Process specific directories: +Pipe output to clipboard (macOS): ```bash -yek src/ tests/ +yek src/ | pbcopy ``` -Process multiple repositories: +Cap the max size to 128K tokens and only process the `src` directory: ```bash -yek ~/code/project1 ~/code/project2 +yek --max-size 128000 --tokens src/ ``` -Pipe output to clipboard: +Cap the max size to 100KB and only process the `src` directory, writing to a specific directory: ```bash -yek src/ | pbcopy +yek --max-size 100KB --output-dir /tmp/yek src/ ``` -### Run +Process multiple directories: + +```bash +yek src/ tests/ +``` + +Process multiple repositories: + +```bash +yek ~/code/project1 ~/code/project2 +``` + +### Help ```bash yek --help @@ -103,44 +144,6 @@ Options: -V, --version Print version ``` -## Examples - -- Serialize entire repository into chunks of 10MB (default): - -```bash -yek -``` - -- Split repository into chunks of 128MB: - -```bash -yek --max-size 128MB -``` - -- Split into chunks by token count instead of bytes: - -```bash -yek --tokens --max-size 128000 -``` - -- Serialize only files under a specific path: - -```bash -yek src/app -``` - -- Process multiple directories: - -```bash -yek src/app src/lib -``` - -- Stream output to another command: - -```bash -yek | pbcopy -``` - ## Configuration File You can place a file called `yek.toml` at your project root or pass a custom path via `--config`. The configuration file allows you to: @@ -150,7 +153,9 @@ You can place a file called `yek.toml` at your project root or pass a custom pat 3. Add additional binary file extensions to ignore (extends the built-in list) 4. Configure Git-based priority boost -Example configuration: +### Example `yek.toml` + +This is optional, you can configure the `yek.toml` file at the root of your project. ```toml # Add patterns to ignore (in addition to .gitignore) From b46d56a229313f9059dac3617d6c0f7d27d93cd6 Mon Sep 17 00:00:00 2001 From: Mohsen Azimi Date: Sun, 19 Jan 2025 11:53:59 +0700 Subject: [PATCH 2/2] fix: grammatical error --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f7c9e93..3c7e3a8 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ A fast Rust based tool to read text-based files in a repository or directory, ch Yek ([يک](https://fa.wikipedia.org/wiki/۱)) means "One" in Farsi/Persian. -Consider have a simple repo like this: +Consider having a simple repo like this: ``` . @@ -37,7 +37,7 @@ Running `yek` in this directory will produce a single file and write it to the t ... rest of the file ... ``` -> `yek` will priotize more important files to come last in the output. This is useful for LLM consumption. +> `yek` will prioritize more important files to come last in the output. This is useful for LLM consumption. ## Installation