Skip to content

feat: add delete-list subcommand with --confirm guard - #70

Merged
udondan merged 1 commit into
mainfrom
feat/delete-list
Sep 14, 2026
Merged

udondan merged 1 commit into
mainfrom
feat/delete-list

Conversation

@udondan

@udondan udondan commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Closes #50

Adds reminders delete-list <list> [--confirm] [--format plain|json].

  • Without --confirm nothing is deleted. The command exits 13 with a new confirmation_required error whose message says what would be removed, e.g. 'Groceries' contains 14 reminders (3 completed). Deleting the list deletes all of them.
  • Exact list matching only. Accepts the list ID or the whole name (case-insensitive). Unlike the other commands there is no substring step, so delete-list gro --confirm fails with list_not_found and names 'Groceries' in the suggestion. Two lists with the same name are list_ambiguous instead of first-wins.
  • Refusals (invalid_argument, checked before the confirmation): the default list for new reminders, and read-only lists. Resolution runs over all reminder lists so read-only ones get this clear error instead of list_not_found.
  • Output: Deleted list 'Groceries' (14 reminders), or {calendarIdentifier, deleted, reminderCount, title} with --format json.

The deletion rules (checkListDeletion) and the exact resolver (resolveCalendarExactly) are EventKit-free free functions with unit tests in DeleteListTests. README (new Create a list / Delete a list sections, errors table), SKILL.md (command row, JSON shape, exit 13, and a rule that agents must never pass --confirm without the user's OK) and CLAUDE.md are updated.

Testing

  • swift build -Xswiftc -warnings-as-errors and swift test -Xswiftc -warnings-as-errors (294 tests pass).
  • Live against Reminders.app, only on lists created for the test: no --confirm → exit 13 and the list stays; partial name with --confirm → exit 2 and the list stays; default list (without --confirm) → exit 12; by ID with --confirm → deleted, plain and JSON output checked; unknown list with --format json → JSON error on stderr.

Deletes a reminders list and every reminder on it. Without --confirm nothing is removed and the command exits 13 (new confirmation_required code) with a summary of what would be deleted. The list must be given by ID or whole name (no substring matching), and the default list and read-only lists are refused.

Closes #50
@udondan
udondan merged commit e3c838e into main Sep 14, 2026
3 checks passed
@udondan
udondan deleted the feat/delete-list branch September 14, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add delete-list subcommand with --confirm guard

1 participant