Context
When building automation that lists Drive files and presents them to users (e.g., in a chat interface), it's useful to show a small preview without downloading the full file. The Google Drive API v3 supports a thumbnailLink field on file resources — a short-lived URL pointing to a small thumbnail image.
Current behavior
gog drive ls --json and gog drive get <fileId> --json return a fixed set of fields:
{
"id": "...",
"name": "...",
"mimeType": "image/png",
"modifiedTime": "...",
"size": "1780402",
"parents": ["..."],
"webViewLink": "..."
}
thumbnailLink (and hasThumbnail) are not included, even though the Drive API v3 supports them via the fields parameter.
Using --select "thumbnailLink" returns {} because --select filters client-side from what's already in the response — it can't request additional fields from the API.
Requested behavior
Option A (minimal): Add thumbnailLink and hasThumbnail to the default fields requested from the Drive API in drive ls and drive get.
Option B (flexible): Support a --fields flag that maps to the Drive API fields parameter, allowing users to request any file resource field. For example:
gog drive ls --parent <folderId> --json --fields "id,name,thumbnailLink"
gog drive get <fileId> --json --fields "id,name,thumbnailLink,imageMediaMetadata"
Option B would also cover other useful fields like imageMediaMetadata (width, height, rotation), videoMediaMetadata, contentHints, etc.
Use case
I'm automating content suggestions from a Drive folder — listing files and sending previews to Discord. Currently I have to gog drive download each full image (~1-3 MB) just to show a preview. With thumbnailLink, I could embed the URL directly or fetch a ~10-50 KB thumbnail instead.
References
Environment
Context
When building automation that lists Drive files and presents them to users (e.g., in a chat interface), it's useful to show a small preview without downloading the full file. The Google Drive API v3 supports a
thumbnailLinkfield on file resources — a short-lived URL pointing to a small thumbnail image.Current behavior
gog drive ls --jsonandgog drive get <fileId> --jsonreturn a fixed set of fields:{ "id": "...", "name": "...", "mimeType": "image/png", "modifiedTime": "...", "size": "1780402", "parents": ["..."], "webViewLink": "..." }thumbnailLink(andhasThumbnail) are not included, even though the Drive API v3 supports them via thefieldsparameter.Using
--select "thumbnailLink"returns{}because--selectfilters client-side from what's already in the response — it can't request additional fields from the API.Requested behavior
Option A (minimal): Add
thumbnailLinkandhasThumbnailto the default fields requested from the Drive API indrive lsanddrive get.Option B (flexible): Support a
--fieldsflag that maps to the Drive APIfieldsparameter, allowing users to request any file resource field. For example:Option B would also cover other useful fields like
imageMediaMetadata(width, height, rotation),videoMediaMetadata,contentHints, etc.Use case
I'm automating content suggestions from a Drive folder — listing files and sending previews to Discord. Currently I have to
gog drive downloadeach full image (~1-3 MB) just to show a preview. WiththumbnailLink, I could embed the URL directly or fetch a ~10-50 KB thumbnail instead.References
thumbnailLink,hasThumbnailfieldsfieldsparameterEnvironment