Add destructive Docs/Slides ops: docs clear, slides delete-slide (+ list-slides)#22
Conversation
…e (+ list) Completes the Docs/Slides write surface from #21 with the destructive ops, gated at .full: docs clear <id> (batchUpdate deleteContentRange; reads the body extent first, keeps the final newline) slides delete-slide <id> <obj> (batchUpdate deleteObject) slides list-slides <id> (read: lists slide objectIds for delete-slide) docs clear leaves empty / tab-only docs untouched. Adds wiring tests (verb + endpoint + body, plus the empty-doc no-op path) and documents the commands in SKILL.md. Uses the docs/slides hosts already allow-listed in #21. https://claude.ai/code/session_01JGWAxXq3PZatbdBR4P5RrA
There was a problem hiding this comment.
Code Review
This pull request introduces several new commands to the Google Docs and Slides CLI, including gog docs clear to empty a document's content, gog slides list-slides to retrieve slide object IDs, and gog slides delete-slide to remove a slide. Corresponding unit tests and documentation updates are also provided. Feedback on these changes suggests outputting valid JSON instead of plain text when docs clear is run on an already empty document with the --json flag enabled, ensuring consistency by adding the standard --fail-empty flag to slides list-slides, and adding a unit test to verify this behavior.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 53ada375cc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…on & tabs
- slides list-slides: add --fail-empty (FailEmptyFlag) for parity with the
other list commands; test covers the empty -> exit 3 path.
- docs clear: emit {} (not plain text) under --json on the already-empty no-op.
- docs clear: it only clears the main (first) tab, so make that explicit in the
abstract/help/comment rather than claiming "all content" (multi-tab docs keep
their other tabs).
https://claude.ai/code/session_01JGWAxXq3PZatbdBR4P5RrA
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aa66f857cf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex: deleteObject removes any page element (shape/table/image), so a mistyped or copied element ID would quietly delete non-slide content while the CLI reports "deleted slide". Confirm the ID is one of the presentation's slide object IDs first (refuse with exit 2 otherwise); dry-run still previews offline. Tests cover both the valid and the rejected-ID paths. https://claude.ai/code/session_01JGWAxXq3PZatbdBR4P5RrA
Completes the Docs/Slides write surface from #21 with the destructive operations, gated at
.full(matching the tier model where destructive/irreversible writes need the top tier).New commands
docs clear <id>.fulldocuments.batchUpdate(deleteContentRange)slides delete-slide <id> <objectId>.fullpresentations.batchUpdate(deleteObject)slides list-slides <id>presentations.get(lists slide objectIds)list-slidesexists so the objectIds fordelete-slideare discoverable from the CLI.Notes
docs clearreads the body extent first (deleteContentRangeneeds an explicit range), deletes[1, end-1], and keeps the document's mandatory final newline. Empty or tab-only docs report no body content and are left untouched (fail-safe).--dry-runprints the intent without the read.--dry-run/--jsonas usual; usesdocs.googleapis.com/slides.googleapis.com, already allow-listed by Add Docs and Slides write commands (create / append / find-replace, etc.) #21.Tests
4 wiring tests:
docs cleardelete-range + the empty-doc no-op path,slides list-slidesobjectIds,slides delete-slidebody. SKILL.md documents all three. CI green.🤖 Generated with Claude Code
https://claude.ai/code/session_01JGWAxXq3PZatbdBR4P5RrA
Generated by Claude Code