feat: extend raw subcommand to gmail/calendar/people/contacts/tasks/forms#496
Open
karbassi wants to merge 17 commits intosteipete:mainfrom
Open
feat: extend raw subcommand to gmail/calendar/people/contacts/tasks/forms#496karbassi wants to merge 17 commits intosteipete:mainfrom
raw subcommand to gmail/calendar/people/contacts/tasks/forms#496karbassi wants to merge 17 commits intosteipete:mainfrom
Conversation
Emits a value as bare JSON (no envelope), compact by default with an optional Pretty mode. HTML escaping disabled so URLs survive unchanged. Backs the forthcoming `gog <group> raw` subcommands. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Records the security review performed before shipping `gog docs/sheets/ slides/drive raw`. Documents the redaction rule (redact only when --fields is not user-specified) and per-endpoint findings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dumps the full Documents.Get response as JSON with no Fields restriction, exposing the canonical Google Docs API tree (tables, suggestions, per-run styling, list nesting, named ranges, inline objects) that `docs info` strips. Compact by default, `--pretty` for indented. Tests cover happy path, API error, not-found, and empty-docId paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dumps the full Spreadsheets.Get response as JSON. `--include-grid-data` opts into cell-level data; off by default because grid payloads can be multi-MB and formulas may embed API keys or tokens. Emits a stderr warning when grid data is included or when developerMetadata is present in the response. Tests cover happy path (no grid), --include-grid-data propagation and warning, API error, not-found, and empty-id paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dumps the full Presentations.Get response. The Slides API has no field mask so output is unconditionally lossless. Audit updated to ship image/video URLs as-is (risk accepted): they are short-lived and auth-gated, substantially lower risk than Drive's thumbnailLink, and the lossless guarantee is valued more than marginal hardening. Same rationale applied to Docs in the audit doc. Tests cover happy path, API error, not-found, and empty-id paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dumps Files.Get response as JSON. Defaults to fields=* and strips a small set of capability-shaped fields (thumbnailLink, webContentLink, exportLinks, resourceKey, appProperties, properties, contentHints.thumbnail.image) when the user did not name fields explicitly. When --fields is set the response is returned verbatim, honoring exactly what the user asked for. Passing --fields "id,name,thumbnailLink" returns thumbnailLink as requested. Tests cover: - default redaction strips every audited sensitive field - explicit --fields honors user request (thumbnailLink preserved) - API error, not-found, and empty-id paths Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…pete#486) Both commands previously used a hard-coded Drive API field mask and --select could only filter client-side. Adds a --fields flag that passes directly to the Drive API fields parameter, letting users request fields the defaults don't include (thumbnailLink, imageMediaMetadata, videoMediaMetadata, contentHints, etc.). Closes steipete#486. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…CHANGELOG Adds a raw vs export/info comparison section to the docs/sheets/slides command reference, example commands for each new `<group> raw`, and a CHANGELOG entry under the unreleased section covering the raw feature and the drive ls/get --fields expansion closing steipete#486. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CI lint failed on wsl_v5 (missing blank lines before if/return statements). Pure formatting fix — no behavior change. All tests still pass. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds security review entries for gmail Users.Messages.Get, calendar
Events.Get, people People.Get (shared with contacts), tasks Tasks.Get,
and forms Forms.Get. None require redaction — risks are limited to
PII the caller already has access to, and none of the endpoints
return credentials in the API contract. Documents the gmail naming
collision ("raw" subcommand vs Gmail's format=raw) and the resolution.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dumps the full Users.Messages.Get response as JSON. Defaults to format=full (structured parsed Message); --format full|metadata| minimal|raw exposes Gmail's native formats. The "raw" subcommand name vs Gmail's format=raw value is a known collision; help text documents both senses. Tests cover default format, every --format value, invalid format, API error, not-found, and empty-id paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… dump Dumps the full Events.Get response as JSON. Uses the existing resolveCalendarSelector helper so calendar IDs, 'primary', short names, and email aliases all work the same as in \`calendar event\`. Tests cover happy path, API error, not-found, and empty-eventId. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds PeopleRawCmd (gog people raw) and ContactsRawCmd (gog contacts raw); both wrap the same People.Get call against the contacts service and share implementation via runPeopleRaw. Defaults to a broad personFields mask; --person-fields overrides. Tests cover happy path for both commands, API error, and empty-id. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dumps the full Tasks.Get response. Takes both tasklistId and taskId as positional args, matching the existing \`tasks get\` signature. Uses resolveTasklistID so short names work the same as elsewhere. Tests cover happy path, API error, not-found, and empty-id paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dumps the full Forms.Get response as JSON. Tests cover happy path, API error, not-found, and empty-id paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ands Adds example commands for gmail/calendar/people/contacts/tasks/forms raw subcommands to the README reference and expands the CHANGELOG entry to list the full set of raw commands now shipping under this unreleased version. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds gmailFormatMinimal constant to the existing set in gmail_get.go and reuses them in GmailRawCmd to satisfy goconst lint. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends the
rawsubcommand pattern established in #495 to the remaining Google API command groups:gog gmail raw <messageId>—Users.Messages.Get, defaultformat=full,--format full|metadata|minimal|rawgog calendar raw <calendarId> <eventId>—Events.Get, reusesresolveCalendarSelectorsoprimary/emails/aliases workgog people raw <userId>—People.Getwith a broad defaultpersonFieldsmask;--person-fieldsoverridesgog contacts raw <identifier>— samePeople.Getcall, exposed under the contacts groupgog tasks raw <tasklistId> <taskId>—Tasks.Get, reusesresolveTasklistIDgog forms raw <formId>—Forms.GetAll six follow the conventions locked in by #495:
--prettyfor indentedoutfmt.WriteRawhelper,-j/-psilently no-opStacked on #495
This PR is stacked on #495 and currently shows PR #495's commits as well as this one's. When #495 merges to main, the diff will shrink to only this PR's commits. Please review #495 first.
Security audit
docs/raw-audit.mdis extended with findings for all 6 new endpoints. None require redaction — risks are limited to data the caller already has access to, and none of the endpoints return credentials in the API contract. The gmail "raw" naming collision (subcommand name vs Gmail'sformat=raw) is explicitly documented.Gmail naming collision
gog gmail rawdefaults toformat=full(structured parsedMessage). Users who want Gmail's nativeformat=raw(base64url RFC822 blob) can pass--format raw; the blob appears as therawfield inside the returnedMessagestruct. Help text documents both senses.Explicitly out of scope (from the plan)
appscript raw— existingget/contentsubcommands already cover the useful surfacechat raw/classroom raw— no natural single-resourceGetendpoint--jq/--filterflag — deferredTest plan
gog gmail raw <id> | jq .payload.mimeTypereturns the MIME typegog gmail raw <id> --format raw | jq .rawreturns a base64url blobgog calendar raw primary <eventId>returns the full Event structgog people raw people/<resourceName>returns full Persongog contacts raw people/<resourceName>returns the samegog tasks raw <listId> <taskId>returns the Taskgog forms raw <formId>returns the full Form tree🤖 Generated with Claude Code