patto-gcal-sync

January 21, 2026 ยท View on GitHub

Synchronize Patto task deadlines to Google Calendar.

Features

  • โœ… Sync Patto tasks with deadlines to Google Calendar events
  • ๐Ÿ”„ Automatic OAuth 2.0 authentication
  • ๐Ÿ” Dry-run mode to preview changes
  • ๐Ÿ“ Track sync state to avoid duplicates

Installation

cargo install patto-gcal-sync

Or build from source:

git clone https://github.com/ompugao/patto-gcal-sync
cd patto-gcal-sync
cargo install --path .

Setup

1. Get Google OAuth Credentials

  1. Go to Google Cloud Console
  2. Create a new project (or select existing)
  3. Enable the Google Calendar API
  4. Go to Credentials โ†’ Create Credentials โ†’ OAuth 2.0 Client ID
  5. Choose Desktop app as application type
  6. Download the credentials

2. Configure patto-gcal-sync

Add to ~/.config/patto/patto-lsp.toml:

[google_calendar]
client_id = "your-client-id.apps.googleusercontent.com"
client_secret = "your-client-secret"
calendar_id = "primary"  # or specific calendar ID

3. Authenticate

patto-gcal-sync auth

This will open a browser window for you to authorize the application.

Usage

Sync tasks to calendar

# Preview what will be synced
patto-gcal-sync sync --dry-run

# Actually sync
patto-gcal-sync sync

# Sync from specific directory
patto-gcal-sync --path ~/notes sync

Show configuration

patto-gcal-sync config

Revoke credentials

patto-gcal-sync revoke

How it works

  • Scans your Patto repository for tasks with deadlines:
    • !2024-12-31 - Todo
    • *2024-12-31 - In progress
    • -2024-12-31 - Done
  • Creates all-day Google Calendar events for each task
  • Maintains sync state in .patto/gcal_state.json to track synced tasks
  • Updates event titles when tasks change
  • Marks events as completed when tasks are marked done

Troubleshooting

"No credentials found" - Run patto-gcal-sync auth first

"Token expired" - The tool automatically refreshes tokens; if this fails, run patto-gcal-sync auth again

"Missing client_id or client_secret" - Check your ~/.config/patto/patto-lsp.toml configuration

  • Patto - The main note-taking system

License

MIT