Skip to content

Commit

Permalink
Merge pull request #4 from bodo-run/readme
Browse files Browse the repository at this point in the history
fix: update readme
  • Loading branch information
mohsen1 authored Jan 19, 2025
2 parents c122a9c + b46d56a commit 5a4d966
Showing 1 changed file with 52 additions and 47 deletions.
99 changes: 52 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 having 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 prioritize more important files to come last in the output. This is useful for LLM consumption.
## Installation

### Via Homebrew (recommended for macOS)
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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)
Expand Down

0 comments on commit 5a4d966

Please sign in to comment.