LLM-Wrap Code Clipboard Command | Generated by AI
Done. Here’s what was implemented:
3 files changed:
-
ww/note/create_note_utils.py— Addedwrap_code_snippets(content)function that calls LLM to wrap code in triple-backtick markdown fences with language hints. Non-code content stays untouched. -
ww/note/note_queue.py— Updatedenqueue_clipboard()to accept optionaltextandcodeparameters. Whencode=True, stores"code": truein the queue entry. -
ww/main.py— Added--codeflag handling in thenotecommand:- Reads clipboard → calls
wrap_code_snippets()LLM → enqueues withcode=True - Runs before duplicate check (content is wrapped at enqueue time)
- Works with
ww note watchsince it enters the queue like any other entry
- Reads clipboard → calls
Also updated:
- Help text:
ww note --code LLM-wrap code in clipboard, then queue - Zsh completions:
--codeand--syncflags forww note
Flow:
ww note --code
→ clipboard read
→ LLM wraps code in ``` fences
→ enqueue (with code=true flag)
→ ww note watch consumes it → creates note → commit → push