Metadata-Version: 2.4
Name: lcea
Version: 0.1.0
Summary: Minimal diff format and robust edit applier for LLM-driven code editing
Requires-Python: >=3.11
Description-Content-Type: text/markdown

# lcea

`lcea` is the short name for the project formerly called `llm-code-edit-applier`.
The shorter name is used for the package and CLI command so it is easier to type and remember.

This project provides:

- a minimal diff-like edit format for LLM output
- a prompt template that constrains model output to that format
- a robust applier that parses, validates, and applies edits to a workspace

## Minimal edit format

Each edit targets one file and uses a single fenced block:

```text
path/to/file.py
```edit
<<<<<<< SEARCH
old text
=======
new text
>>>>>>> REPLACE
```
```

Rules:

- The line before the fenced block is the relative file path.
- Fence info string must be `edit`.
- `SEARCH` is matched literally.
- `REPLACE` is the replacement text.
- Empty `SEARCH` means create at file start when the file already exists, or create a new file.
- Empty `REPLACE` means delete the matched text.
- A `SEARCH` block must match exactly once in the target file unless `SEARCH` is empty.

## Prompt template

See `src/llm_edit_applier/prompts.md`.

## Run tests

```bash
python -m pytest
```

## CLI

After installation:

```bash
lcea spec
lcea prompt
lcea apply edits.txt --root .
cat edits.txt | lcea apply --root .
```
