A bidirectional synchronization tool between Taskwarrior and Google Tasks, written in Go.
THIS WHOLE THING IS VIBE CODED. USE AT YOUR OWN RISK.
- ✅ Bidirectional sync (Taskwarrior ↔ Google Tasks)
- 🔄 Recurring task support (syncs current instances only)
- 🏷️ Filter-based sync (e.g., only tasks with
+remindtag) - ⚔️ Configurable conflict resolution strategies
- 🔐 Secure OAuth 2.0 authentication
- 💾 SQLite-based sync state tracking
- 🎯 Field mapping: description, due date, status, project, tags, priority
- Go 1.21 or later
- Taskwarrior 3.x installed and configured
- Google Cloud project with Tasks API enabled
git clone https://github.com/Anaritus/taskwarrior-google-sync.git
cd taskwarrior-google-sync
go build -o tw-gsync ./cmd/tw-gsync
sudo mv tw-gsync /usr/local/bin/Download the latest binary from the releases page.
- Go to Google Cloud Console
- Create a new project (or select existing)
- Enable the Google Tasks API:
- Go to "APIs & Services" > "Library"
- Search for "Google Tasks API"
- Click "Enable"
- Create OAuth 2.0 credentials:
- Go to "APIs & Services" > "Credentials"
- Click "Create Credentials" > "OAuth client ID"
- Select "Desktop app" as application type
- Note your Client ID and Client Secret
Run the initialization command:
tw-gsync initThis will:
- Prompt for your Google OAuth credentials
- Create a configuration file at
~/.config/tw-gsync/config.yaml - Open a browser for Google authentication
- Save the OAuth token
tw-gsync syncThis performs bidirectional synchronization:
- Creates Google Tasks for new Taskwarrior tasks (matching filter)
- Updates Google Tasks when Taskwarrior tasks change
- Imports new Google Tasks into Taskwarrior
- Updates Taskwarrior tasks when Google Tasks change
- Handles deletions in both directions
Preview changes without applying them:
tw-gsync sync --dry-runSee detailed logging:
tw-gsync sync --verboseView sync statistics:
tw-gsync statustw-gsync configClear all sync mappings (use with caution):
tw-gsync resetEdit ~/.config/tw-gsync/config.yaml:
google:
client_id: "YOUR_CLIENT_ID.apps.googleusercontent.com"
client_secret: "YOUR_CLIENT_SECRET"
task_list_id: "@default" # or specific list ID
taskwarrior:
data_location: "~/.task"
task_bin: "task"
filter:
- "+remind" # Only sync tasks with +remind tag
sync:
conflict_strategy: "last_write_wins" # or google_wins, taskwarrior_wins
sync_completed: true
max_completed_age_days: 30
deleted_tasks_behavior: "delete" # or archiveSync only tasks with specific tag:
filter: ["+remind"]Sync tasks from specific project:
filter: ["project:work"]Sync multiple criteria:
filter: ["+remind", "project:personal"]last_write_wins(default): Use modification timestamp to determine winnergoogle_wins: Always prefer Google Tasks version in conflictstaskwarrior_wins: Always prefer Taskwarrior version in conflicts
| Taskwarrior | Google Tasks | Notes |
|---|---|---|
description |
title |
Task title |
due |
due |
Due date (RFC 3339) |
status |
status + completed |
pending/completed |
uuid |
Stored in notes |
Internal tracking |
project |
Stored in notes |
Project metadata |
tags |
Stored in notes |
Tag list |
priority |
Stored in notes |
H/M/L priority |
annotations |
Appended to notes |
With timestamps |
recur |
N/A | See recurring tasks |
Google Tasks does not support recurring tasks natively. This tool handles recurrence as follows:
- Recurring parent templates (status=recurring) are not synced
- Only current pending instances are synced to Google Tasks
- When you complete a task in Google:
- The instance is marked complete in Taskwarrior
- Taskwarrior automatically generates the next instance
- On next sync, the new instance is pushed to Google Tasks
Example workflow:
# Create recurring task in Taskwarrior
task add "Weekly review" due:friday recur:weekly +remind
# First sync - current instance appears in Google Tasks
tw-gsync sync
# Complete in Google Tasks (or Taskwarrior)
# Next sync detects completion and updates both systems
tw-gsync sync
# Taskwarrior has generated the next week's instance
# It will be synced on next runAdd to your crontab (crontab -e):
# Sync every 15 minutes
*/15 * * * * /usr/local/bin/tw-gsync sync >> ~/.local/share/tw-gsync/sync.log 2>&1Create ~/.config/systemd/user/tw-gsync.service:
[Unit]
Description=Taskwarrior Google Tasks Sync
[Service]
Type=oneshot
ExecStart=/usr/local/bin/tw-gsync syncCreate ~/.config/systemd/user/tw-gsync.timer:
[Unit]
Description=Run tw-gsync every 15 minutes
[Timer]
OnBootSec=5min
OnUnitActiveSec=15min
[Install]
WantedBy=timers.targetEnable and start:
systemctl --user enable --now tw-gsync.timer# Re-authenticate
rm ~/.config/tw-gsync/token.json
tw-gsync initEnsure Taskwarrior is in your PATH or set the full path in config:
taskwarrior:
task_bin: "/opt/homebrew/bin/task"If tasks are duplicating or not syncing correctly:
# Reset sync state
tw-gsync reset
# Re-sync from scratch
tw-gsync syncEnable verbose mode to see detailed sync operations:
tw-gsync sync --verbosego build -o tw-gsync ./cmd/tw-gsyncgo test ./...taskwarrior-google-sync/
├── cmd/tw-gsync/ # CLI application
├── internal/
│ ├── auth/ # OAuth 2.0 authentication
│ ├── config/ # Configuration management
│ ├── gtasks/ # Google Tasks API client
│ ├── storage/ # SQLite sync state
│ ├── sync/ # Sync engine
│ └── taskwarrior/ # Taskwarrior CLI wrapper
└── config/ # Example configs
- Google Tasks doesn't support native recurring tasks (see workaround above)
- Google Tasks doesn't support priorities (stored in notes field)
- Task dependencies are not synced
- Taskwarrior UDAs (user-defined attributes) are not synced
MIT License - see LICENSE file
Contributions welcome! Please open an issue or PR.
- Built with emersion/go-webdav
- Google Tasks API by Google
- Taskwarrior by GothenburgBitFactory
- bugwarrior - Sync bugs from various sources to Taskwarrior
- taskwarrior-syncall - Sync Taskwarrior with Google Calendar, Notion, and more