1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
|
#+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
|