Skip to content

feat(drive): add --convert flag to upload#240

Closed
Danielkweber wants to merge 1 commit intosteipete:mainfrom
Danielkweber:daniel/feat/drive-upload-convert
Closed

feat(drive): add --convert flag to upload#240
Danielkweber wants to merge 1 commit intosteipete:mainfrom
Danielkweber:daniel/feat/drive-upload-convert

Conversation

@Danielkweber
Copy link
Contributor

Summary

  • Adds a --convert flag to gog drive upload that converts Office files to native Google formats on upload
  • Supported conversions: .docx/.doc → Google Doc, .xlsx/.xls/.csv → Google Sheet, .pptx/.ppt → Google Slides, .txt/.html → Google Doc
  • Automatically strips Office extensions from the filename (e.g., report.docxreport)
  • Returns a clear error when --convert is used with an unsupported file type

Usage

gog drive upload report.docx --convert
gog drive upload budget.xlsx --convert --parent=<folderId>

Test plan

  • Unit tests for googleConvertMimeType() — 13 cases covering all supported and unsupported extensions
  • Unit tests for stripOfficeExt() — 9 cases for extension stripping
  • Integration test for upload with --convert flag
  • Error path test for unsupported file type with --convert
  • Full test suite passes
  • Manual test: uploaded a .docx and confirmed it appears as a native Google Doc in Drive

🤖 Generated with Claude Code

…nversion

Uploads .docx/.xlsx/.pptx (and legacy .doc/.xls/.ppt, .csv, .txt, .html)
as native Google Docs/Sheets/Slides instead of opaque files. Strips Office
extensions from the filename automatically.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@TheCrazyLex
Copy link

Duplicate of #226

@steipete steipete self-assigned this Feb 13, 2026
steipete added a commit that referenced this pull request Feb 13, 2026
Add Drive upload conversion with auto detection (--convert) and explicit targets (--convert-to), preserve explicit --name values, and improve conversion behavior tests/docs for PR #240.

Co-authored-by: Daniel Weber <daniel@suno.com>
@steipete steipete closed this Feb 13, 2026
@steipete
Copy link
Owner

Landed on main in 2ecdf2f (squashed from this PR). Included: --convert auto mode, --convert-to explicit target mode, pre-service conversion validation, preserved explicit --name, stronger upload metadata tests, and docs/changelog updates. Thanks @Danielkweber.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants