Skip to content

Rust CLI to sync macOS Stickies to SQLite for cross-machine sync and search

Notifications You must be signed in to change notification settings

harperreed/sticky-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sticky-situation

A Rust CLI tool to sync macOS Stickies across machines using a portable SQLite database.

Features

  • ✅ Bidirectional sync between Stickies.app and SQLite database
  • ✅ Full-text search with FTS5
  • ✅ List and show stickies from CLI
  • ✅ Create new stickies from CLI
  • ✅ Preserve complete RTFD formatting (text + images)
  • ✅ Configurable database location (XDG or iCloud)

Installation

cargo install --path .

Usage

Sync stickies

# Sync between filesystem and database
sticky sync

# Dry run to see what would change
sticky sync --dry-run --verbose

Create new sticky

sticky new "My new sticky note"

# After creating, sync to import the sticky with Stickies.app's UUID
sticky sync

Note: Stickies.app assigns its own UUID when importing new stickies, so you should run sync after creating to update your database with the correct UUID.

Search stickies

sticky search "meeting notes"
sticky search --color yellow "todo"

List all stickies

sticky list
sticky list --color yellow

Show a specific sticky

sticky show <uuid>

Reload Stickies.app

sticky hup

Sends a HUP signal to Stickies.app to reload it. Useful after manually editing files or syncing from another machine.

Configuration

Config file: ~/.config/sticky-situation/config.toml

[database]
path = "~/.local/share/sticky-situation/stickies.db"
# Or use iCloud:
# path = "~/Library/Mobile Documents/com~apple~CloudDocs/stickies.db"

[sync]
log_conflicts = true
conflict_log_path = "~/.local/share/sticky-situation/conflicts.log"

How It Works

  1. Reads Stickies from ~/Library/Containers/com.apple.Stickies/Data/Library/Stickies/
  2. Parses StickiesState.plist for metadata (color, position)
  3. Reads each <UUID>.rtfd/ bundle (RTF + attachments)
  4. Syncs to SQLite with last-write-wins conflict resolution
  5. Full-text search using FTS5

Known Limitations

  • Window positioning: When creating new stickies via sticky new, Stickies.app manages window positioning using its own internal logic. The CLI cannot control where new sticky windows appear on screen - they will be positioned by Stickies.app when it reloads.

  • UUID assignment: Stickies.app assigns its own UUID to newly created stickies when it imports them. After running sticky new, you should run sticky sync to update your database with the UUID that Stickies.app assigned.

Architecture

See design document for details.

Testing

cargo test

License

MIT

About

Rust CLI to sync macOS Stickies to SQLite for cross-machine sync and search

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages