Skip to content

Expand Drive --convert-to to sheet|doc|slides#226

Closed
TheCrazyLex wants to merge 1 commit intoopenclaw:mainfrom
TheCrazyLex:dev/drive-convert-to-sheet
Closed

Expand Drive --convert-to to sheet|doc|slides#226
TheCrazyLex wants to merge 1 commit intoopenclaw:mainfrom
TheCrazyLex:dev/drive-convert-to-sheet

Conversation

@TheCrazyLex
Copy link
Copy Markdown
Contributor

@TheCrazyLex TheCrazyLex commented Feb 11, 2026

Ticket

N/A

Summary

Expand Drive conversion support to allow --convert-to sheet|doc|slides for both upload and copy flows, with stronger request-level test coverage and updated docs.

Changes

  • extend gog drive copy --convert-to to support sheet, doc, and slides
  • extend gog drive upload --convert-to to support sheet, doc, and slides
  • map each convert target to Google Workspace metadata MIME type:
    • sheet -> application/vnd.google-apps.spreadsheet
    • doc -> application/vnd.google-apps.document
    • slides -> application/vnd.google-apps.presentation
  • improve validation messaging to show the full allowed set (sheet|doc|slides)
  • expand command tests to cover all three targets for both copy and upload
  • harden upload conversion tests by parsing multipart metadata JSON (instead of brittle substring matching)
  • update docs:
    • README Drive examples
    • docs/spec.md command signatures

Testing

  • go test ./internal/cmd/...
  • Manual live tests with generated sample files:
    • DOCX raw upload + conversion to Google Docs via copy and upload
    • PPTX raw upload + conversion to Google Slides via copy and upload
    • XLSX conversion to Google Sheets regression check
  • Invalid value handling:
    • --convert-to nope returns usage error with allowed values

Checklist

  • Code follows project conventions
  • Documentation updated
  • No breaking changes

Copilot AI review requested due to automatic review settings February 11, 2026 19:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new --convert-to sheet option to Drive upload/copy commands so users can directly convert uploaded/copied files into Google Sheets by setting Drive metadata mimeType=application/vnd.google-apps.spreadsheet.

Changes:

  • Add --convert-to sheet flag to gog drive upload and gog drive copy, with validation via driveConvertToMimeType.
  • Plumb optional targetMimeType into the Drive copy helper and apply it to the Drive API request metadata.
  • Extend tests and docs to cover conversion behavior and updated command signatures/examples.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/cmd/drive.go Adds --convert-to flags, conversion validation helper, and sets upload metadata MimeType when requested.
internal/cmd/drive_copy.go Extends copyViaDrive helper to accept/apply an optional target MIME type.
internal/cmd/docs.go Updates Docs copy command callsite for new copyViaDrive signature.
internal/cmd/sheets.go Updates Sheets copy command callsite for new copyViaDrive signature.
internal/cmd/slides.go Updates Slides copy command callsite for new copyViaDrive signature.
internal/cmd/drive_helpers_test.go Adds unit tests for driveConvertToMimeType (valid/invalid values, exit code).
internal/cmd/drive_commands_more_test.go Extends integration-style Drive command test to assert conversion metadata is sent on copy/upload.
docs/spec.md Updates documented CLI signatures for Drive copy/upload to include --convert-to sheet.
README.md Adds examples demonstrating --convert-to sheet for Drive copy/upload.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/cmd/drive_commands_more_test.go Outdated
Extend Drive conversion support for both upload and copy commands by
mapping --convert-to values to Google Workspace target mimeTypes for
sheet, doc, and slides.

Keep the CLI surface simple with one conversion flag while expanding
validation and tests across all supported targets. Invalid values now
report the allowed set explicitly.

Harden upload conversion tests by parsing multipart upload metadata
instead of brittle substring matching, addressing PR review feedback.

Update Drive examples in README and command signatures in docs/spec
for the expanded conversion target set.
@TheCrazyLex TheCrazyLex force-pushed the dev/drive-convert-to-sheet branch from f37ec86 to b6ff833 Compare February 11, 2026 22:00
@TheCrazyLex TheCrazyLex changed the title Add --convert-to sheet for Drive copy/upload Expand Drive --convert-to to sheet|doc|slides Feb 11, 2026
@TheCrazyLex
Copy link
Copy Markdown
Contributor Author

@steipete Please review

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.

2 participants