Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Fixed

- Gmail: keep label IDs case-sensitive during label resolution and duplicate-name checks while still matching label names case-insensitively.
- Gmail: clarify that `gmail drafts delete` permanently deletes drafts and cannot be recovered. (#656, #659) — thanks @chrischall.
- Docs: update the bundled `gog` agent skill to preserve broad user OAuth scopes during reauth and rely on command guards for scoped execution.

## 0.19.0 - 2026-05-22
Expand Down
2 changes: 1 addition & 1 deletion docs/commands.generated.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ Generated from `gog schema --json`.
- [`gog gmail (mail,email) batch modify (update,edit,set) <messageId> ... [flags]`](commands/gog-gmail-batch-modify.md) - Modify labels on multiple messages
- [`gog gmail (mail,email) drafts (draft) <command>`](commands/gog-gmail-drafts.md) - Draft operations
- [`gog gmail (mail,email) drafts (draft) create (add,new) [flags]`](commands/gog-gmail-drafts-create.md) - Create a draft
- [`gog gmail (mail,email) drafts (draft) delete (rm,del,remove) <draftId>`](commands/gog-gmail-drafts-delete.md) - Delete a draft
- [`gog gmail (mail,email) drafts (draft) delete (rm,del,remove) <draftId>`](commands/gog-gmail-drafts-delete.md) - Permanently delete a draft (not recoverable; drafts are not moved to Trash)
- [`gog gmail (mail,email) drafts (draft) get (info,show) <draftId> [flags]`](commands/gog-gmail-drafts-get.md) - Get draft details
- [`gog gmail (mail,email) drafts (draft) list (ls) [flags]`](commands/gog-gmail-drafts-list.md) - List drafts
- [`gog gmail (mail,email) drafts (draft) send (post) <draftId>`](commands/gog-gmail-drafts-send.md) - Send a draft
Expand Down
2 changes: 1 addition & 1 deletion docs/commands/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ Generated pages: 572.
- [gog gmail batch modify](gog-gmail-batch-modify.md) - Modify labels on multiple messages
- [gog gmail drafts](gog-gmail-drafts.md) - Draft operations
- [gog gmail drafts create](gog-gmail-drafts-create.md) - Create a draft
- [gog gmail drafts delete](gog-gmail-drafts-delete.md) - Delete a draft
- [gog gmail drafts delete](gog-gmail-drafts-delete.md) - Permanently delete a draft (not recoverable; drafts are not moved to Trash)
- [gog gmail drafts get](gog-gmail-drafts-get.md) - Get draft details
- [gog gmail drafts list](gog-gmail-drafts-list.md) - List drafts
- [gog gmail drafts send](gog-gmail-drafts-send.md) - Send a draft
Expand Down
2 changes: 1 addition & 1 deletion docs/commands/gog-gmail-drafts-delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> Generated from `gog schema --json`. Do not edit this page by hand; run `make docs-commands`.

Delete a draft
Permanently delete a draft (not recoverable; drafts are not moved to Trash)

## Usage

Expand Down
2 changes: 1 addition & 1 deletion docs/commands/gog-gmail-drafts.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ gog gmail (mail,email) drafts (draft) <command>
## Subcommands

- [gog gmail drafts create](gog-gmail-drafts-create.md) - Create a draft
- [gog gmail drafts delete](gog-gmail-drafts-delete.md) - Delete a draft
- [gog gmail drafts delete](gog-gmail-drafts-delete.md) - Permanently delete a draft (not recoverable; drafts are not moved to Trash)
- [gog gmail drafts get](gog-gmail-drafts-get.md) - Get draft details
- [gog gmail drafts list](gog-gmail-drafts-list.md) - List drafts
- [gog gmail drafts send](gog-gmail-drafts-send.md) - Send a draft
Expand Down
7 changes: 5 additions & 2 deletions internal/cmd/gmail_drafts.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
type GmailDraftsCmd struct {
List GmailDraftsListCmd `cmd:"" name:"list" aliases:"ls" help:"List drafts"`
Get GmailDraftsGetCmd `cmd:"" name:"get" aliases:"info,show" help:"Get draft details"`
Delete GmailDraftsDeleteCmd `cmd:"" name:"delete" aliases:"rm,del,remove" help:"Delete a draft"`
Delete GmailDraftsDeleteCmd `cmd:"" name:"delete" aliases:"rm,del,remove" help:"Permanently delete a draft (not recoverable; drafts are not moved to Trash)"`
Send GmailDraftsSendCmd `cmd:"" name:"send" aliases:"post" help:"Send a draft"`
Create GmailDraftsCreateCmd `cmd:"" name:"create" aliases:"add,new" help:"Create a draft"`
Update GmailDraftsUpdateCmd `cmd:"" name:"update" aliases:"edit,set" help:"Update a draft"`
Expand Down Expand Up @@ -178,6 +178,9 @@ func (c *GmailDraftsGetCmd) Run(ctx context.Context, flags *RootFlags) error {
return nil
}

// GmailDraftsDeleteCmd permanently deletes a draft. The Gmail API's
// users.drafts.delete is irreversible — drafts are not moved to Trash and have
// no untrash path — so this cannot be undone.
type GmailDraftsDeleteCmd struct {
DraftID string `arg:"" name:"draftId" help:"Draft ID"`
}
Expand All @@ -191,7 +194,7 @@ func (c *GmailDraftsDeleteCmd) Run(ctx context.Context, flags *RootFlags) error

if confirmErr := dryRunAndConfirmDestructive(ctx, flags, "gmail.drafts.delete", map[string]any{
"draft_id": draftID,
}, fmt.Sprintf("delete gmail draft %s", draftID)); confirmErr != nil {
}, fmt.Sprintf("permanently delete gmail draft %s (not recoverable; drafts are not moved to Trash)", draftID)); confirmErr != nil {
return confirmErr
}

Expand Down
Loading