Add quicknote tool and update aliases

This commit is contained in:
2026-01-30 23:16:05 -06:00
parent 41dc7ca06b
commit 7123c4ccd2
2 changed files with 60 additions and 0 deletions

View File

@ -41,3 +41,5 @@ lsproj() {
alias search='python3 $WORKSPACE/tools/search.py' alias search='python3 $WORKSPACE/tools/search.py'
alias inbox='python3 $WORKSPACE/tools/inbox-processor.py' alias inbox='python3 $WORKSPACE/tools/inbox-processor.py'
alias digest='python3 $WORKSPACE/tools/daily-digest.py' alias digest='python3 $WORKSPACE/tools/daily-digest.py'
alias qnote='python3 $WORKSPACE/tools/quicknote.py'
alias clip='python3 $WORKSPACE/tools/web-clipper.py'

58
tools/quicknote.py Executable file
View File

@ -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()