A VS Code extension that seamlessly pastes clipboard images directly into your terminal, automatically saving them to your project and inserting the file path. Works with Claude Code, OpenCode, and any workflow that requires quick image sharing in terminal environments.
Note: This project is a maintained fork of terminal-paste-image-vscode by Feras Abdalrahman, originally released under the MIT License.
- Zero Configuration Required - Works out of the box across all platforms
- Cross-Platform Support - Windows, macOS, Linux, and WSL/WSL2 compatible
- Smart Clipboard Detection - Automatically detects when images are in your clipboard
- Automatic File Management - Saves images to configurable folder (default:
.cp-images/) with timestamps - Instant Path Insertion - Immediately inserts the path into your active terminal
- Terminal AI Tool Ready - Works with Claude Code, OpenCode, and other terminal-based AI assistants
- WSL Integration - Seamless PowerShell integration for WSL environments
- Keyboard Shortcut - Quick
Ctrl+Alt+V(Windows/Linux) orCmd+Alt+V(macOS) - Terminal Focus Aware - Only activates when terminal is in focus
- Multiple Image Formats - Supports PNG and other common clipboard image formats
- Smart Git Integration - Automatically adds images folder to .gitignore (configurable)
- Customizable Folder Name - Configure where images are saved (default:
.cp-images/) - Automatic Cleanup - Keeps only recent images (default: 10) to prevent folder bloat
- Path Format Options - Choose between relative or absolute paths for terminal output
- Visual Studio Code 1.74.0 or higher
- For Windows/WSL: PowerShell (included by default)
- For macOS:
pngpasteutility (install viabrew install pngpaste) - For Linux:
xcliputility (install via your package manager)
Share screenshots, diagrams, or images with Claude Code, OpenCode, or any terminal-based AI:
- Copy any image to clipboard (screenshot, design, diagram)
- Press
Ctrl+Alt+Vin terminal - Image path is automatically inserted for the AI tool to reference
- Share UI mockups or designs with team members
- Include error screenshots in bug reports
- Add visual context to code discussions
- Document visual issues or features
- Quickly include screenshots in documentation workflows
- Save and reference images during technical writing
- Create visual guides and tutorials
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X) - Search for "Terminal Image Paste"
- Click "Install"
- Download the latest
.vsixfile from releases - Open VS Code
- Press
Ctrl+Shift+Pand type "Install from VSIX" - Select the downloaded file
- Copy an image to your clipboard (screenshot, image file, etc.)
- Focus on any terminal in VS Code
- Press
Ctrl+Alt+V(Windows/Linux) orCmd+Alt+V(macOS) - The image is saved to your configured folder and path is inserted in terminal
- Open Command Palette (
Ctrl+Shift+P) - Type "Paste Image to Terminal"
- Execute the command
- Works out of the box with PowerShell
- No additional setup required
- Automatically detects WSL environment
- Uses Windows PowerShell for clipboard operations
- No additional configuration needed
Install pngpaste for optimal performance:
brew install pngpasteInstall xclip for clipboard operations:
# Ubuntu/Debian
sudo apt-get install xclip
# Fedora/RHEL
sudo dnf install xclip
# Arch
sudo pacman -S xclipImages are automatically saved to:
your-project/
├── .cp-images/
│ ├── pasted-image-2024-01-15T10-30-45.png
│ ├── pasted-image-2024-01-15T10-31-02.png
│ └── ...
| Platform | Shortcut |
|---|---|
| Windows/Linux | Ctrl+Alt+V |
| macOS | Cmd+Alt+V |
Note: Shortcuts only work when terminal is focused to avoid conflicts with normal paste operations.
The extension provides several configuration options that can be customized in VS Code settings:
| Setting | Type | Default | Description |
|---|---|---|---|
terminalPasteImage.folderName |
string | .cp-images |
Name of the folder where pasted images will be saved |
terminalPasteImage.autoGitIgnore |
boolean | true |
Automatically add the images folder to .gitignore if not present |
terminalPasteImage.maxImages |
number | 10 |
Maximum number of images to keep (older images are automatically deleted) |
terminalPasteImage.pathFormat |
string | relative |
Format of the image path inserted into terminal (relative or absolute) |
- Open VS Code Settings (
Ctrl+,orCmd+,) - Search for "Terminal Paste Image"
- Modify the settings as needed
By default, the extension will:
- Check if a
.gitignorefile exists in your workspace - Verify if your images folder is already ignored
- Automatically add the folder to
.gitignoreif not present - Add a helpful comment indicating it's for Terminal Paste Image
This behavior can be disabled by setting terminalPasteImage.autoGitIgnore to false.
You can change the default folder name from .cp-images to any folder name you prefer:
{
"terminalPasteImage.folderName": "screenshots"
}The folder will be created relative to your workspace root.
You can choose between relative and absolute paths for the terminal output:
{
"terminalPasteImage.pathFormat": "absolute"
}relative(default): Inserts path relative to workspace root (e.g.,.cp-images/pasted-image-2024-01-15T10-30-45.png)absolute: Inserts full file system path (e.g.,/home/user/project/.cp-images/pasted-image-2024-01-15T10-30-45.png)
Use absolute when you need the full path for tools that don't run from the workspace root, or when sharing paths across different terminal sessions.
By default, the extension keeps only the 10 most recent images to prevent folder bloat:
{
"terminalPasteImage.maxImages": 10
}- When you paste a new image, older images beyond the limit are automatically deleted
- Images are sorted by modification time (newest kept, oldest deleted)
- Only images matching the
pasted-image-*.pngpattern are managed - Set to a higher number if you need to keep more images
- Minimum value is 1, maximum is 100
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Clone this repository
- Run
npm install - Open in VS Code
- Press
F5to launch extension development host - Test your changes
- Forked and rebranded as Terminal Image Paste
- Added
pathFormatsetting to choose between relative and absolute paths
- Initial release by Feras Abdalrahman
- Cross-platform clipboard image detection
- Automatic image saving with timestamps
- Terminal path insertion
- WSL/WSL2 support
- Keyboard shortcut integration
- Configurable folder name, auto .gitignore, image cleanup
- macOS requires
pngpasteutility for best experience - Linux requires
xclipfor clipboard operations - Some image formats may need conversion to PNG
This project is licensed under the MIT License - see the LICENSE file for details.
Originally created by Feras Abdalrahman. Now maintained by Cybersader.
