-
Notifications
You must be signed in to change notification settings - Fork 33
Description
Summary
Add support for location-based reminder triggers to remindctl, allowing reminders to fire when arriving at or leaving specific locations.
Use Case
As a system administrator, I need reminders that trigger when I arrive at specific locations (office, home, etc.) rather than at specific times. For example:
- "Start the Coffee Pot" → trigger when arriving at office
- "Check the Mail" → trigger when arriving home
- "Submit expense report" → trigger when leaving office
- This would enable location-aware productivity workflows that complement time-based reminders.
Current Limitation
remindctl currently supports time-based triggers (--due) but no location-based triggers, despite the underlying EventKit framework providing full support for location-based alarms via EKStructuredLocation and EKAlarm.
This functionality exists in the native Reminders app GUI but isn't exposed through remindctl, creating a gap for command-line automation workflows.
Proposed Solution
CLI Interface
Basic location trigger
remindctl add "Task description" --location "Office" --proximity entering
With address resolution
remindctl add "Task description" --address "123 Main St, City" --proximity leaving
With custom radius
remindctl add "Task description" --location "Home" --proximity entering --radius 100
Combined with existing features
remindctl add "Submit report" --location "Office" --proximity leaving --due "2026-01-30" --priority high
New Parameters
--location - Location display name ("Office", "Home", etc.)
--address
--proximity <entering|leaving> - Trigger on arrival or departure
--radius - Geofence radius (default: 100m)
Technical Implementation Research
EventKit Foundation
The iOS EventKit framework already supports location-based reminders through:
EKStructuredLocation - Represents locations with coordinates and geofence radius
EKAlarm(location:) - Creates location-based alarms
CLGeocoder - Converts addresses to coordinates
Code Structure Analysis
Based on the current codebase structure, here are conceptual integration points:
- Models Extension (Sources/RemindCore/Models.swift)
public struct ReminderDraft: Sendable {
// ... existing properties ...
public let location: LocationTrigger? // NEW
}
public struct LocationTrigger: Sendable {
public let name: String
public let address: String?
public let coordinate: (lat: Double, lon: Double)?
public let radius: Double
public let proximity: LocationProximity
}
public enum LocationProximity: String, CaseIterable {
case entering, leaving
}
2. Core Logic (Sources/RemindCore/EventKitStore.swift)
public func createReminder(_ draft: ReminderDraft, listName: String) async throws -> ReminderItem {
// ... existing reminder creation ...
if let locationTrigger = draft.location {
let location = EKStructuredLocation()
location.title = locationTrigger.name
if let coord = locationTrigger.coordinate {
location.geoLocation = CLLocation(latitude: coord.lat, longitude: coord.lon)
location.radius = locationTrigger.radius
}
let alarm = EKAlarm(location: location)
alarm.proximity = locationTrigger.proximity == .entering ? .enter : .leave
reminder.addAlarm(alarm)
}
// ... rest of creation logic ...
}
3. CLI Interface (Sources/remindctl/Commands/AddCommand.swift)
// Add to existing options array:
.make(label: "location", names: [.long("location")], help: "Location name", parsing: .singleValue),
.make(label: "address", names: [.long("address")], help: "Street address", parsing: .singleValue),
.make(label: "proximity", names: [.long("proximity")], help: "entering|leaving", parsing: .singleValue),
.make(label: "radius", names: [.long("radius")], help: "Radius in meters (default: 100)", parsing: .singleValue),
Privacy Considerations
Requires Location Services permissions
Geolocation data handled by system frameworks only
No data transmitted outside of native Reminders app
User controls location accuracy and sharing
Follows existing iOS privacy model for location-based reminders
Implementation Phases
Phase 1: Basic location support
Location name + manual coordinate entry
Basic geofence triggers
Phase 2: Address geocoding
Automatic coordinate resolution via CLGeocoder
Error handling for invalid addresses
Phase 3: Enhanced features
Location favorites/presets
Integration with system location services
Benefits
For Users
Location-aware productivity - Tasks trigger at the right place, not just time
Reduced cognitive load - No need to remember tasks when context changes
Better workflow automation - Integrates with location-based work patterns
For the Project
Leverages full EventKit capabilities - Uses native iOS reminder features
Differentiates from other CLI tools - Unique location-based functionality
Maintains clean API design - Follows existing parameter patterns
Backward compatible - Existing functionality unchanged
Alternative Implementations
Option A: Basic implementation - Location names only, requires manual setup in Reminders app
Option B: Full implementation - Address geocoding, automatic coordinate resolution
Option C: Hybrid approach - Basic CLI support + enhanced features via Reminders app integration
Questions for Maintainer
Interest level - Does this align with the project's goals?
Preferred approach - Which implementation phase would you prefer to start with?
API design - Any preferences for the CLI parameter naming/structure?
Dependencies - Acceptable to add CoreLocation framework dependency?
System requirements - Should this require macOS 14+ for optimal location services reliability?
Additional Context
This feature request comes from real-world usage where time-based reminders don't match location-based workflows. The technical analysis shows this is well-supported by the underlying frameworks and would integrate cleanly with the existing codebase architecture.