Skip to content

feat: Fix CLI integration + Add entry update functions#2

Open
marlian wants to merge 12 commits intoQuevin:mainfrom
marlian:main
Open

feat: Fix CLI integration + Add entry update functions#2
marlian wants to merge 12 commits intoQuevin:mainfrom
marlian:main

Conversation

@marlian
Copy link

@marlian marlian commented Aug 6, 2025

🐛 Some Fixes

This PR resolves some CLI issues that break write operations:

Fixed Issues:

  • create_journal_entry fails with "Missing command" error
  • ❌ Coordinate parameters passed incorrectly to CLI
  • ❌ CLI option parsing broken for tags/attachments

Root Cause:

Day One CLI requires -- separator between options and commands:

# BROKEN
dayone2 --tags work meeting new "Entry text"  
# CLI interprets "new" as tag value

# FIXED  
dayone2 --tags work meeting -- new "Entry text"
# ✅ Proper separation

✨ New Features
Added two highly-requested entry editing functions:
update_entry(uuid, content)

Replace existing entry content completely
Preserves all metadata (tags, location, weather, starred)
Auto-updates modification timestamp

append_to_entry(uuid, content, separator="\\n\\n")

Append content to existing entries efficiently
Perfect for incremental journaling workflow
Maintains proper Day One markdown rendering

🎯 Use Cases

python# Edit workflow that was impossible before
entries = read_recent_entries(limit=5)
target = entries[0]

# Add to existing entry instead of creating duplicate
append_to_entry(
    entry_uuid=target['uuid'],
    content="\\n\\n## Update\\n\\nAdded thoughts..."
)

✅ Testing

All original MCP tools now work correctly
New functions tested with real Day One database
Proper markdown rendering confirmed
Zero breaking changes

Would love to contribute these fixes back to help other users! Let me know if you'd like any adjustments.

marlian added 12 commits August 5, 2025 13:39
- Fix CLI command syntax with proper -- separator
- Fix coordinate parameters as separate arguments
- All MCP write operations now work correctly
- Resolves CLI syntax errors that prevented entry creation

Tested with:
- Basic entries with tags ✅
- Starred entries ✅
- Entries with GPS coordinates ✅
- All 10 MCP tools now functional ✅
- Add MCP-specific patterns (*.sqlite, logs/, temp/)
- Add macOS-specific patterns (.DS_Store)
- Add IDE patterns (.vscode/)
- Add personal config exclusions
- Prevent accidental commit of sensitive files
- Keep fork documentation local and private
- Document changes without affecting upstream compatibility
- Make README-FORK.md public to show improvements clearly
- Add fork notice to main README with link to detailed changes
- Improve transparency and help other developers with same issues
- Document all CLI integration fixes with before/after examples
- Increase preview text limits:
  * read_recent_entries: 100 → 300 chars
  * search_entries: 200 → 400 chars
  * get_entries_by_date: 300 → 500 chars
- Add new read_full_entry tool for complete entry retrieval by UUID
- Include UUID in all preview responses for workflow chaining
- Add comprehensive test suite (test_enhancements.py)
- Implement hybrid approach: catalog → chunks → full read workflow

Enables complete search-to-full-text workflow without truncation.
Backward compatible with existing tools.
- Remove unused 'Any' and 'Sequence' from typing imports
- Clean up import warnings in server.py
- All imports now properly utilized
- Add update_entry() to replace journal entry content completely
- Add append_to_entry() to append content to existing entries
- Both functions preserve existing metadata (tags, location, weather)
- Use proper ZMARKDOWNTEXT format for correct Day One rendering
- Add corresponding MCP tools and handlers
- Enables friction-free journal editing workflow
- Document update_entry() and append_to_entry() functions
- Add workflow examples and usage patterns
- Update changes summary with new features
- Show 12 total MCP tools (was 10)
…() object creation and duplicate stdio_server() calls

- Added missing server = Server('mcp-dayone') instantiation
- Fixed indentation that left handler registration orphaned
- Removed duplicate stdio_server() context creation
- Server now initializes properly and stays running instead of crashing
- Preserves enhanced logging functionality from previous commit
  contributor guide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant