Skip to content

lcode 0.3.0

Choose a tag to compare

@nasser1941 nasser1941 released this 30 Sep 15:51
ff2ecbf

Undo for local models. lcode now saves a checkpoint before the model changes your files, so a wrong edit or a script that went sideways is one command away from being undone.

Added

  • /undo takes back the file changes of the last request. Before the model first changes files in a request, lcode saves a checkpoint. /undo then restores edited and deleted files and removes new ones, including changes made by shell commands.
    • /undo again goes further back.
    • /rewind N goes back to before request N, optionally removing those requests from the conversation too.
    • /checkpoints lists them.
  • Checkpoints live in a separate git repository in lcode's state folder, so your own repository is never touched. They also work in folders that aren't git repositories. Turn them off with lcode config set checkpoints false.
● edit_file(calc.py)
  ✓ Edited calc.py
● write_file(notes.md)
  ✓ Created notes.md (1 lines)
  $ rm old.txt
↶ Checkpoint 1: 3 files changed · /undo reverts them

❯ /undo
Undoing request 1: In calc.py add a multiply(a, b) function. Also create notes.md with o…
  restore calc.py
  restore old.txt
  remove  notes.md
Done: restored calc.py, old.txt; removed notes.md.

Details: Undo and checkpoints

Upgrade

uv tool upgrade lcode-cli        # or: pipx upgrade lcode-cli

Full changelog: v0.2.2...v0.3.0