- Fold files and instructions into json
- Unfold LLM return jsons in same format
- Intended to let LLM's produce codebase changes in a controlled manner
uv pip install https://github.com/wr1/cfold.git- JSON structure with keys:
instructions(list of objects),files. - Each instruction object:
{type: 'system'|'user'|'assistant', content: string, name: string (optional)}. files: Array of objects withpath(relative to CWD),content(full file content, optional if deleting), anddelete(bool, default false).- Modify files by updating
content(withdelete: false). - Delete files with
delete: true(content optional). - Add new files by adding new objects with
pathandcontent. - Move/rename: Delete old (
delete: true) and add new with updated path and content.