Feature request: docs +insert-image helper to embed Drive-hosted images without requiring public sharing
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start by reading the existing helpers pattern and the proposed gws docs +insert-image entry point, then review how insertInlineImage and authenticated Drive downloads are used. Compare the temporary GCS or Drive upload flow with the Apps Script DriveApp and DocumentApp alternative. Done means private Drive images can be inserted with optional width and index without public sharing, while temporary data is cleaned up.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
The Google Docs REST API's insertInlineImage requires a publicly accessible URL — it does a server-side fetch with no authentication context. This makes it impossible to programmatically insert images stored in private Google Drive files into a document, even when the caller has full Drive and Docs scopes.
Workarounds all hit dead ends:
drive.google.com/uc?export=downloadURLs → 403 forbiddenthumbnailLinkfrom Drive API → 403 forbiddendrive.google.com/thumbnail?id=...→ retrieval error- HTML upload with base64 data URI → images silently stripped during conversion
- HTML upload with Drive
<img src>→ blank image placeholder (fetch needs public access)
The only working path is Google Apps Script (DriveApp.getFileById().getBlob() → doc.getBody().insertImage(blob)), which runs server-side as the authenticated user and doesn't need a public URL. But that requires enabling the Apps Script API separately — significant friction for a common task.
Proposal
Add a gws docs +insert-image helper that handles private Drive images transparently:
# Insert a Drive-hosted image at the start of a document
gws docs +insert-image --document <DOC_ID> --file <DRIVE_FILE_ID>
# With explicit size
gws docs +insert-image --document <DOC_ID> --file <DRIVE_FILE_ID> --width 468 --index 5
Under the hood it could:
- Download the image bytes via the Drive API (authenticated, using the caller's existing credentials)
- Upload them to a temporary GCS or Drive location scoped to the request
- Insert via
insertInlineImageand immediately clean up
Or, if Apps Script is available, use DriveApp + DocumentApp to insert the blob directly — similar to how #686 suggests using Apps Script for pageless mode.
Why it matters
Inserting architecture diagrams, charts, and other locally-generated images into Docs is a core use case for AI agents and automation workflows. Right now any agent that renders a diagram locally (e.g. via mmdc) has no clean path to embed it in a private document — the only options are making files public (unacceptable for sensitive content) or manual copy-paste.
The helpers pattern exists precisely to paper over gaps like this in the underlying API surface.
- Ngôn ngữ chính
- Rust
- Star
- 31.3k
- Fork
- 1.9k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của googleworkspace/cli
-
Replace gemini with agyĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
googleworkspace/cli#958 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
googleworkspace/cli#921 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add cli to awesome-ai-plugins?Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
googleworkspace/cli#920 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
docs(gmail): the --draft tip prints a send command that fails (users.drafts.send --body)Có thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
googleworkspace/cli#914 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
auth setup: pasted OAuth Client ID is not trimmed — trailing whitespace causes 401 invalid_client at loginCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
googleworkspace/cli#882 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của googleworkspace/cli
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
needs: triage type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:docs documentation P3
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Raaif-Yousuf/Wingman#837 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
priority: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
storytold/photocraft#6759 ·
Maintainer thường phản hồi trong vòng 1 ngày