From 7123c4ccd27febaa94464c1e2f143218eec2e750 Mon Sep 17 00:00:00 2001 From: Case Date: Fri, 30 Jan 2026 23:16:05 -0600 Subject: [PATCH] Add quicknote tool and update aliases --- scripts/aliases.sh | 2 ++ tools/quicknote.py | 58 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100755 tools/quicknote.py diff --git a/scripts/aliases.sh b/scripts/aliases.sh index 680f279..10c03f7 100644 --- a/scripts/aliases.sh +++ b/scripts/aliases.sh @@ -41,3 +41,5 @@ lsproj() { alias search='python3 $WORKSPACE/tools/search.py' alias inbox='python3 $WORKSPACE/tools/inbox-processor.py' alias digest='python3 $WORKSPACE/tools/daily-digest.py' +alias qnote='python3 $WORKSPACE/tools/quicknote.py' +alias clip='python3 $WORKSPACE/tools/web-clipper.py' diff --git a/tools/quicknote.py b/tools/quicknote.py new file mode 100755 index 0000000..d6a536a --- /dev/null +++ b/tools/quicknote.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python3 +""" +Quick note capture - adds timestamped notes to today's memory file. +""" + +import sys +from datetime import datetime +from pathlib import Path + +WORKSPACE = Path("/home/wdjones/.openclaw/workspace") +MEMORY_DIR = WORKSPACE / "memory" + +def get_today_file() -> Path: + """Get path to today's memory file.""" + return MEMORY_DIR / f"{datetime.now().strftime('%Y-%m-%d')}.md" + +def ensure_today_file(): + """Create today's file if it doesn't exist.""" + today = get_today_file() + if not today.exists(): + MEMORY_DIR.mkdir(parents=True, exist_ok=True) + with open(today, 'w') as f: + f.write(f"# {datetime.now().strftime('%Y-%m-%d')}\n\n") + return today + +def add_note(text: str, section: str = None): + """Add a note to today's file.""" + today = ensure_today_file() + timestamp = datetime.now().strftime("%H:%M") + + with open(today, 'a') as f: + if section: + f.write(f"\n## {section}\n") + f.write(f"- {timestamp}: {text}\n") + + print(f"✓ Added to {today.name}") + +def show_today(): + """Show today's notes.""" + today = get_today_file() + if today.exists(): + print(today.read_text()) + else: + print("No notes for today yet.") + +def main(): + if len(sys.argv) < 2: + show_today() + return + + if sys.argv[1] == "show": + show_today() + else: + note = " ".join(sys.argv[1:]) + add_note(note) + +if __name__ == "__main__": + main()