-
Notifications
You must be signed in to change notification settings - Fork 334
[feat] add image support to cli #386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
brandonkachen
wants to merge
22
commits into
main
Choose a base branch
from
image-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+2,757
−500
Conversation
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
- Add image-handler.ts for auto-detecting and processing image paths - Add terminal-images.ts for iTerm2/Kitty inline image rendering - Add ImageContentBlock type and ImageBlock component - Update SDK RunOptions to accept multimodal content (text + images) - Auto-detect image paths in user input (e.g. @image.png, ./path/to/image.jpg) - Display images inline in supported terminals, fallback to metadata
…rd paste, and visual cards - Add /image slash command to attach images - Add image input mode similar to bash/referral mode - Add Ctrl+V clipboard paste for images (macOS/Linux/Windows) - Add PendingImagesBanner with visual image cards and X to remove - Update keyboard actions to detect Ctrl+V for image paste - Remove pasted status messages (now shown in banner)
…tachments in user messages
- Add image-thumbnail.ts utility to extract pixel colors using Jimp - Add ImageThumbnail component rendering with Unicode half-blocks (▀) - Use OpenTUI native fg/backgroundColor styling instead of ANSI escapes - Works in terminals without iTerm2/Kitty inline image support - Falls back to emoji if image processing fails
- Store images with queued messages so they travel with the message - Clear pending images when queuing to fix banner persistence - Fix banner not showing after /image command by rendering directly - Update queue types to support QueuedMessage objects with content and images
Ensures consistent XML framing when content contains both text and images by wrapping only the first text part in <user_message> tags.
- Remove duplicate AskUserContentBlock from ContentBlock union type - Remove unused execSync import from clipboard-image.ts - Fix Ctrl+V to fall through for text paste when no image in clipboard - Fix buildUserMessageContent to wrap text in user_message tags for multipart content
- Increase timeout from 800ms to 2000ms for slower CI environments - Listen to both stdout and stderr for CLI startup detection
- Remove dead code (validateTotalImageSize, MAX_TOTAL_SIZE) - Make CLI processImageFile synchronous (no async needed) - Simplify normalizeUserProvidedPath (consolidated unicode/shell escapes) - Remove unnecessary clipboard image cleanup (OS handles temp files) - Remove verbose logging from clipboard-image.ts - Unexport internal functions (generateITerm2ImageSequence, generateKittyImageSequence) - Add logging to silent catch blocks in image-thumbnail.ts and terminal-images.ts - Extract magic numbers to named constants in image-card.tsx
- Replace inline import with proper type import in message-footer.tsx - Remove keyboard debug logging from use-chat-keyboard.ts - Convert map().filter() to reduce() in use-send-message.ts - Remove duplicate implementor helpers from constants.ts (already in implementor-helpers.ts)
Previously /image would transform the command into a prompt with the path, expecting auto-detection. Now it properly adds to pendingImages in the chat store so the image shows in the banner before sending.
- Use bilinear interpolation for sharper thumbnail downscaling - Reduce card width (18 chars) and adjust thumbnail size - Move close button outside the card border for better visibility - Remove gray background from thumbnail area
- Combine image support features with main branch bash execution - Add PendingBashMessage, PendingToolResult types to chat-store - Add bash history handlers to chat keyboard - Preserve all image support functionality (clipboard, thumbnails, etc.) - Fix duplicate content parameter in SDK run.ts
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.
dis p cool yo