Skip to content

feat(gmail): full Gmail API parity — drafts, label CRUD, attachments, settings, untrash, batch ops #90

@omriariav

Description

@omriariav

Context

gws gmail currently covers 9 commands (list, read, thread, send, reply, labels, label, archive, archive-thread, trash, event-id) — the core read/write/triage flow. The Gmail API has ~35 more methods we don't expose.

Full gap analysis

Messages — 4 missing

Command API Method Args/Flags
gmail untrash <message-id> messages.untrash positional
gmail delete <message-id> messages.delete positional, --force (permanent delete)
gmail batch-modify messages.batchModify --ids, --add-labels, --remove-labels
gmail batch-delete messages.batchDelete --ids, --force

Threads — 3 missing

Command API Method Args/Flags
gmail trash-thread <thread-id> threads.trash positional
gmail untrash-thread <thread-id> threads.untrash positional
gmail delete-thread <thread-id> threads.delete positional, --force

Note: threads.modify is partially covered by archive-thread (removes INBOX label). Could add label-thread for general label operations on threads.

Labels — 4 missing

Command API Method Args/Flags
gmail label-info <label-id> labels.get positional
gmail create-label labels.create --name, --visibility, --color
gmail update-label <label-id> labels.patch --name, --visibility, --color
gmail delete-label <label-id> labels.delete positional, --force

Drafts — 6 missing (entirely new area)

Command API Method Args/Flags
gmail drafts drafts.list --max, --query
gmail draft <draft-id> drafts.get positional
gmail create-draft drafts.create --to, --subject, --body, --cc, --bcc
gmail update-draft <draft-id> drafts.update --to, --subject, --body
gmail send-draft <draft-id> drafts.send positional
gmail delete-draft <draft-id> drafts.delete positional

Attachments — 1 missing

Command API Method Args/Flags
gmail attachment <message-id> <attachment-id> attachments.get positional, --output

Settings — 15 useful methods

Vacation / Auto-reply:

Command API Method Args/Flags
gmail vacation settings.getVacation
gmail set-vacation settings.updateVacation --enable, --subject, --body, --start, --end

Filters:

Command API Method Args/Flags
gmail filters settings.filters.list
gmail filter <filter-id> settings.filters.get positional
gmail create-filter settings.filters.create --from, --to, --subject, --query, --add-label, --remove-label, --archive, --star
gmail delete-filter <filter-id> settings.filters.delete positional

Forwarding:

Command API Method Args/Flags
gmail forwarding settings.forwardingAddresses.list
gmail add-forwarding settings.forwardingAddresses.create --email
gmail remove-forwarding settings.forwardingAddresses.delete --email
gmail auto-forwarding settings.getAutoForwarding
gmail set-auto-forwarding settings.updateAutoForwarding --enable, --email, --disposition

Send-as aliases:

Command API Method Args/Flags
gmail send-as settings.sendAs.list
gmail add-send-as settings.sendAs.create --email, --name
gmail remove-send-as settings.sendAs.delete --email
gmail verify-send-as settings.sendAs.verify --email

Delegates:

Command API Method Args/Flags
gmail delegates settings.delegates.list
gmail add-delegate settings.delegates.create --email
gmail remove-delegate settings.delegates.delete --email

Other — 2 useful

Command API Method Args/Flags
gmail profile users.getProfile — (email, messages total, threads total, history ID)
gmail history history.list --start-history-id, --max, --label-id (incremental sync)

Skipped (not useful for CLI)

Method Reason
messages.import Migration tool
messages.insert Migration tool
users.watch Push notifications, needs Pub/Sub setup
users.stop Stops watch
settings.getImap/updateImap Rarely needed from CLI
settings.getPop/updatePop Rarely needed from CLI
settings.getLanguage/updateLanguage Rarely needed from CLI
CSE identities/keypairs (~10 methods) Enterprise encryption, very niche
S/MIME (~5 methods) Enterprise encryption, very niche

Suggested implementation phases

Phase 1: Core gaps (high value, simple)

  • untrash, delete, trash-thread, untrash-thread, delete-thread
  • attachment
  • profile
  • Label CRUD: label-info, create-label, update-label, delete-label

Phase 2: Drafts (new area)

  • All 6 draft commands

Phase 3: Settings

  • Vacation, filters, forwarding, send-as, delegates

Phase 4: Batch & advanced

  • batch-modify, batch-delete
  • history (incremental sync)

Scopes

Current scopes (gmail.readonly, gmail.send, gmail.modify) should cover most methods. Settings may need gmail.settings.basic and gmail.settings.sharing.

Acceptance criteria

  • All ~35 new commands implemented and tested
  • Mock server tests for each command
  • TestGmailCommands updated in commands_test.go
  • skills/gmail/SKILL.md and references/commands.md updated
  • README.md gmail table updated
  • Version bump per phase

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions