Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .changeset/drive-download-helper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
"@googleworkspace/cli": minor
---

Add `drive +download` helper for downloading Drive files to a local path

The new `+download` command is a multi-step helper that:
1. Fetches file metadata (name, MIME type) to determine how to download
2. For Google Workspace native files (Docs, Sheets, Slides) uses `files.export`
with the caller-supplied `--mime-type` (e.g. `application/pdf`, `text/csv`)
3. For all other files uses `files.get?alt=media`
4. Writes the response bytes to a local path validated against path traversal

This complements the existing `+upload` helper and follows all helper
guidelines: it performs multi-step orchestration that the raw Discovery
API cannot express as a single call.

```
gws drive +download --file FILE_ID
gws drive +download --file FILE_ID --output report.pdf
gws drive +download --file FILE_ID --mime-type application/pdf
```
Loading
Loading