Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
gtasks_core
gtasks_core is an offline-first, thread-safe Rust SDK and engine for the Google Tasks API.
Designed as the core foundation for terminal (TUI) and graphical (GUI) task managers, gtasks_core provides zero-hassle OAuth 2.0 PKCE authentication, automatic OS keyring credential persistence, thread-safe SQLite local caching, background delta synchronization, and natural-language date parsing.
✨ Features
- 🔐 Automatic OAuth 2.0 + PKCE: Handles the browser authentication handshake and securely persists refresh tokens in system secret stores (D-Bus Secret Service, KWallet, macOS Keychain).
- 🔄 Bidirectional Delta Synchronization: Periodically synchronizes remote modifications using
updatedMinRFC3339 timestamps while maintaining local dirty states for offline operations. - 📴 Offline-First SQLite Cache: High-performance, thread-safe SQLite persistence layer powered by
rusqlitefor local read/write performance. - 🌲 Subtask Tree Ordering: Processes flat API responses into hierarchical parent-child task structures while maintaining custom visual ordering.
- 🧠 Natural Language Processing (NLP): Built-in date parser extracting temporal expressions like
"today","tomorrow", or"next monday"directly from task titles. - ⚡ Actor-Based Background Sync: Non-blocking async
SyncManageractor for background sync polling and window focus triggers.
📦 Installation
Add gtasks_core to your Cargo.toml:
[]
= "0.1.2"
= { = "1.0", = ["full"] }
= { = "0.4", = ["serde"] }
System Prerequisites
To build system keyring bindings (keyring) and OpenSSL dependencies on Linux, install the required development headers:
# Ubuntu / Debian
# Fedora
# Arch Linux
🚀 Quickstart
1. Authenticate & Perform API Operations
obtain_authenticated_client() automatically retrieves saved credentials from the system keyring, or initiates a browser OAuth PKCE authorization loop if no valid token exists.
use obtain_authenticated_client;
use Error;
async
2. Offline-First SQLite Synchronization
Use Database for local persistence and sync_remote_to_db for bidirectional synchronization:
use ;
use Error;
async
🏗️ Architecture Overview
┌──────────────────────────────────────────────┐
│ Client App (TUI / GUI / CLI Script) │
└──────────────┬────────────────┬──────────────┘
│ │
Local Queries & │ │ Background Events
Offline Writes ▼ ▼
┌────────────────────┐ ┌────────────────────┐
│ Database (SQLite) │ │ SyncManager │
└─────────▲──────────┘ └─────────┬──────────┘
│ │
└──────────┬──────────────┘
│ Network Sync
▼
┌──────────────────────────────────────────────┐
│ GoogleTasksClient (REST API) │
└────────────────────┬─────────────────────────┘
│ HTTPS (Bearer Auth)
▼
┌──────────────────────────────────────────────┐
│ Google Tasks API │
└──────────────────────────────────────────────┘
The library is organized into specialized modules:
| Module | Description |
|---|---|
api |
Direct Google Tasks REST API client with exponential backoff and retry handlers. |
auth |
OAuth 2.0 PKCE challenge generator, token refresh, and OS keyring persistence. |
db |
Thread-safe SQLite schema, CRUD operations, transactions, and soft-delete queues. |
sync |
MPSC actor managing active/idle sync interval loops and window state updates. |
util |
Natural language date parsing and hierarchical task tree layout algorithms. |
🤝 Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
📄 License
Distributed under the MIT License. See LICENSE.md for details.