Skip to content

Support binary file downloads from Google Drive (alt=media) #46

@moekatib

Description

@moekatib

Feature Request

Problem

When working with Google Drive files (e.g., .docx, .pdf) through One CLI, there's no way to download binary files to disk. The current API passthrough only handles JSON responses.

Specific issues encountered:

  1. alt=media query parameter not supported — When passing --query-params '{"alt": "media"}' to the Get File action, One CLI treats it as a template variable ({{alt}}) instead of a query parameter, returning: Invalid value "{{alt}}" for query parameter 'alt'
  2. Download action fails — The POST /drive/v3/files/{fileId}/download action returns 411 Length Required because One CLI doesn't send a Content-Length header for the empty POST body
  3. Export action only works for native Google DocsGET /drive/v3/files/{fileId}/export returns 403: Export only supports Docs Editors files for uploaded .docx/.pdf files

Expected Behavior

Users should be able to download binary files from Google Drive to a local path, e.g.:

one actions execute google-drive <get-file-action> <key> \
  --path-vars '{"fileId": "abc123"}' \
  --query-params '{"alt": "media"}' \
  --output ./file.docx

Use Case

Downloading document files (.docx, .pdf) from shared Google Drive folders for local processing — a very common workflow when building AI agents that work with documents.

Workaround

Currently users must manually download files from the browser, which breaks the automation flow.

Environment

  • One CLI (latest)
  • macOS
  • Google Drive connection (OAuth operational)

Moved from withoneai/cli#35

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions