#+TITLE: Delete Calendar Event Workflow #+AUTHOR: Craig Jennings & Claude #+DATE: 2026-02-01 * Overview Workflow for deleting calendar events via gcalcli with explicit confirmation. * Triggers - "delete the meeting" - "cancel my appointment" - "remove the event" - "clear my calendar for..." * Prerequisites - gcalcli installed and authenticated - Event must exist on calendar * Note: Calendar Visibility Events can only be deleted from Google calendars via gcalcli. DeepSat (work) and Proton calendar events are visible in =~/.emacs.d/data/{dcal,pcal}.org= but cannot be modified from here. * Workflow Steps ** 1. Parse User Request Extract: - Which event (title, partial match, or date hint) - Date context (if provided) Examples: - "Delete the dentist appointment" → search for "dentist" - "Cancel tomorrow's meeting" → search tomorrow's events - "Remove the 3pm call" → search by time ** 2. Search for Event #+begin_src bash # Search by title gcalcli --calendar "Calendar Name" search "event title" # Or list events for a date gcalcli --calendar "Calendar Name" agenda "date" "date 11:59pm" #+end_src ** 3. Handle Multiple Matches If search returns multiple events: #+begin_example Found 3 events matching "meeting": 1. Team Meeting - Feb 3, 2026 at 9:00 AM 2. Project Meeting - Feb 4, 2026 at 2:00 PM 3. Client Meeting - Feb 5, 2026 at 10:00 AM Which event do you want to delete? (1-3) #+end_example ** 4. Display Full Event Details Show the event that will be deleted: #+begin_example Event to Delete: ================ Event: Team Meeting When: Monday, Feb 3, 2026 at 9:00 AM Duration: 1 hour Location: Conference Room A Description: Weekly sync Calendar: Work #+end_example ** 5. Explicit Confirmation Ask clearly: #+begin_example Delete this event? (yes/no) #+end_example *Do NOT delete until user explicitly confirms with "yes".* ** 6. Execute Delete gcalcli delete requires interactive confirmation. Since Claude can't interact with the prompt, pipe "y" to confirm: #+begin_src bash echo "y" | gcalcli --calendar "Calendar Name" delete "Event Title" #+end_src Use a date range to narrow matches and avoid deleting the wrong event: #+begin_src bash echo "y" | gcalcli --calendar "Calendar Name" delete "Event Title" 2026-02-14 2026-02-15 #+end_src ** 7. Verify Confirm the event is gone: #+begin_src bash gcalcli --calendar "Calendar Name" search "Event Title" #+end_src Report success: #+begin_example Event "Team Meeting" has been deleted from your calendar. #+end_example * gcalcli Delete Command ** Basic Delete (pipe confirmation) gcalcli delete prompts interactively, which fails in non-interactive shells. Always pipe "y" to confirm: #+begin_src bash echo "y" | gcalcli delete "Event Title" #+end_src ** With Date Range (preferred — avoids accidental matches) #+begin_src bash echo "y" | gcalcli delete "Event Title" 2026-02-14 2026-02-15 #+end_src ** Calendar-Specific Delete #+begin_src bash echo "y" | gcalcli --calendar "Craig" delete "Meeting" 2026-02-14 2026-02-15 #+end_src ** Skip All Prompts (dangerous) #+begin_src bash gcalcli delete "Event Title" --iamaexpert #+end_src *Warning:* =--iamaexpert= skips all prompts and deletes every match. Avoid unless the search is guaranteed to match exactly one event. * Handling Multiple Events If the search pattern matches multiple events, gcalcli may: - Delete all matching events (dangerous!) - Prompt for each one (interactive mode) *Best practice:* Use specific titles or search first, then delete by exact match. * Recurring Events *Warning:* Deleting a recurring event deletes ALL instances. For recurring events: 1. Warn the user that all instances will be deleted 2. Ask for confirmation specifically mentioning "all occurrences" 3. Consider if they only want to delete one instance (not supported by simple delete) #+begin_example This is a recurring event. Deleting it will remove ALL occurrences. Delete all instances of "Weekly Standup"? (yes/no) #+end_example * Error Handling ** Event Not Found - Verify spelling - Try partial match - Check date range - May have already been deleted ** Delete Failed - Check calendar permissions - Verify event exists - Try with --calendar flag ** Wrong Event Deleted - Cannot undo gcalcli delete - Would need to recreate the event manually * Safety Considerations 1. *Always show full event details* before asking for confirmation 2. *Never delete without explicit "yes"* from user 3. *Warn about recurring events* before deletion 4. *Verify deletion* by searching after 5. *Read-only calendars* (like Christine's) cannot have events deleted * Read-Only Calendars Some calendars are read-only: | Calendar | Can Delete? | |---------------------------+-------------| | Craig | Yes | | Christine | Yes | | Todoist | Yes | | Craig Jennings (TripIt) | No | | Holidays in United States | No | | Craig Proton | No | If user tries to delete from read-only calendar: #+begin_example Cannot delete from "Craig Proton" - this is a read-only calendar. #+end_example * Related - [[file:add-calendar-event.org][Add Calendar Event]] - create events - [[file:read-calendar-events.org][Read Calendar Events]] - view events - [[file:edit-calendar-event.org][Edit Calendar Event]] - modify events - [[file:../calendar-api-research.org][Calendar API Research]] - gcalcli reference