Skip to content

Feature request: include thumbnailLink in drive ls and drive get output #486

@gtapps

Description

@gtapps

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions