Merged
Conversation
Add -u (--image-upload-command) and -d (--image-delete-command) flags to allow using external CLI tools for image upload and deletion instead of Google Drive. The external CLI receives image data via stdin and environment variables: - DECK_UPLOAD_MIME: MIME type of the image - DECK_UPLOAD_FILENAME: suggested filename - DECK_DELETE_ID: resource ID to delete The upload command should output: - Line 1: public URL of the uploaded image - Line 2: resource ID for later deletion This enables integration with custom storage backends like GCS, S3, or any other service via CLI wrappers, similar to how laminate works for code block to image conversion. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add support for CEL template expressions in image upload/delete commands,
similar to how -c (code-block-to-image-command) works.
Upload command (-u) supports:
- {{mime}} - MIME type of the image
- {{filename}} - suggested filename
- {{env.XXX}} - environment variables
Delete command (-d) supports:
- {{id}} - resource ID to delete
- {{env.XXX}} - environment variables
Implementation:
- Extract template expansion logic into new `template` package
- Move tests from md/template_test.go to template/template_test.go
- Update md and deck packages to use the shared template package
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
The filename is not used by external uploaders like reprint-gcs, which generate their own object IDs using UUIDs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Rename uploader.go to storage.go - Rename Uploader interface to Storage - Rename googleDriveUploader to googleDriveStorage - Rename externalUploader to externalStorage - Inline constants (DECK_UPLOAD_MIME, DECK_DELETE_ID) into functions - Inline generateTempFilename() into googleDriveStorage.Upload() 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-u(--image-upload-command) and-d(--image-delete-command) flags to theapplycommandStorageinterface for consistent architectureArchitecture
Storageinterface withUpload()andDelete()methodsgoogleDriveStorage: default implementation using Google DriveexternalStorage: implementation using external CLI commandsCLI Specification
Upload Command
The upload command receives:
DECK_UPLOAD_MIME(MIME type of the image){{mime}},{{env.XXX}}Expected output (stdout):
Delete Command
The delete command receives:
DECK_DELETE_ID(uploaded ID to delete){{id}},{{env.XXX}}Example Usage
Test plan
🤖 Generated with Claude Code