Skip to content

Commit

Permalink
fix: swap -s and -x flags for stream and max-size options
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen1 committed Jan 13, 2025
1 parent 1e6b424 commit fb23aa6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# `yek`

A simple tool to read text-based files in a repository or directory, chunk them, and serialize them for LLM consumption. By default, the tool:

- Uses `.gitignore` rules to skip unwanted files.
- Infers additional ignore patterns (binary, large, etc.).
- Splits content into chunks based on either approximate "token" count or byte size.
Expand All @@ -20,13 +21,15 @@ brew install yek
2. Clone this repository.
3. Run `make macos` or `make linux` to build for your platform (both run `cargo build --release`).
4. Add to your PATH:

```bash
export PATH=$(pwd)/target/release:$PATH
```

## Usage

### Run

```bash
yek --help

Expand All @@ -38,7 +41,7 @@ Arguments:
[path] Path to repository [default: .]

Options:
-s, --max-size <max-size> Maximum size in MB [default: 10]
-x, --max-size <max-size> Maximum size in MB [default: 10]
-c, --config <config> Path to config file
-o, --output-dir <output-dir> Directory to write output files (overrides config file)
-s, --stream Stream output to stdout instead of writing to file
Expand All @@ -51,27 +54,33 @@ Options:
```

## Examples

- Serialize entire repository into a single file (infinite chunk size)

```bash
yek
```

- Split repository into chunks of ~128KB:

```bash
yek --max-size 128
```

- Split into chunks of ~128k tokens

```bash
yek --tokens --max-size 128000
```

- Serialize only the src/app directory

```bash
yek --path-prefix src/app
```

- Stream output to stdout instead of writing files

```bash
yek --stream
```
Expand Down Expand Up @@ -120,9 +129,10 @@ binary_extensions = [
```

All configuration keys are optional. By default:

- No extra ignore patterns
- All files have equal priority (score: 1)
- Common binary file extensions are ignored (.jpg, .png, .exe, etc. - see source for full list)
- Common binary file extensions are ignored (.jpg, .png, .exe, etc. - see source for full list)

## Planned Features

Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ fn main() -> Result<()> {
.arg(
Arg::new("max-size")
.help("Maximum size in MB")
.short('s')
.short('x')
.long("max-size")
.value_parser(clap::value_parser!(usize))
.default_value("10"),
Expand All @@ -828,6 +828,7 @@ fn main() -> Result<()> {
.arg(
Arg::new("stream")
.help("Stream output to stdout instead of writing to files")
.short('s')
.long("stream")
.action(ArgAction::SetTrue),
)
Expand Down

0 comments on commit fb23aa6

Please sign in to comment.