Skip to content

davestanyer/clipboard-screenshot-saver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

📸 Clipboard Image Saver

Ultra-fast screenshot workflow for developers

Save clipboard images to your project with smart numbering and get the path instantly copied back to your clipboard.

Why did I make this

I've started using Claude Code CLI and Gemini CLI as part of my development workflow, which is fantastic - but I quickly hit a frustrating limitation: you can't paste clipboard images directly into the terminal like you can in Cursor.

While Claude Code supports drag-and-drop images and file paths to images, screenshots still need to be saved as files first. This broke my quick workflow of:

  1. Take a screenshot with Snipping Tool
  2. Instantly share it with the AI

Now the workflow becomes:

  1. Take a screenshot
  2. Save it somewhere manually
  3. Find the file path
  4. Reference it in Claude Code

This tool fixes that by automating steps 2-4. Now it's just:

  1. Take a screenshot → img → Done!

The image is saved with smart numbering, and the path is already in your clipboard ready to paste into Claude Code. Perfect for showing bugs, UI mockups, error messages, or any visual context to your AI assistant.

Bonus: The context prefixes (-Bug, -UI, -Context, etc.) also help me be less lazy with providing context. Instead of just dropping a random screenshot, I'm forced to think "is this a bug I'm reporting or UI I'm referencing?" - which leads to better, more focused conversations with the AI.

🚀 Quick Start

Installation

Option 1: Install as module (recommended)

# Detect your PowerShell type and set correct module path
$DocumentsPath = [Environment]::GetFolderPath("MyDocuments")
if ($PSVersionTable.PSEdition -eq "Core") {
    $ModulePath = "$DocumentsPath\PowerShell\Modules\ClipboardImageSaver"
} else {
    $ModulePath = "$DocumentsPath\WindowsPowerShell\Modules\ClipboardImageSaver"
}

Write-Host "Installing to: $ModulePath" -ForegroundColor Cyan

# Copy module to your PowerShell modules folder
Copy-Item -Path ".\ClipboardImageSaver" -Destination $ModulePath -Recurse -Force

# Add to your profile to auto-import
Add-Content $PROFILE "Import-Module ClipboardImageSaver"

Option 2: Direct import from current location

# Add this line to your PowerShell profile ($PROFILE)
Import-Module "C:\path\to\your\clipboard-screenshot-saver\ClipboardImageSaver" -Force

Option 3: Dot-source the function

# Add these lines to your PowerShell profile
. "C:\path\to\your\clipboard-screenshot-saver\ClipboardImageSaver\Public\Save-ClipboardImage.ps1"
New-Alias img Save-ClipboardImage

Usage

img                    # Save screenshot, get path in clipboard
img -Format jpg       # Save as JPG
img -UI               # Save as ui1.png (for interface screenshots)
img -Bug              # Save as bug1.png (for bug reports)

✨ Features

  • Ultra-short command: Just img
  • Smart numbering: Finds next available number (img1, img2, etc.)
  • Context prefixes: Use -UI, -Bug, -Context, -Before, -After for organized naming
  • Multiple formats: PNG, JPG, BMP
  • Auto-folder creation: Creates imgs folder automatically
  • Path in clipboard: Instantly ready to paste

📋 Usage Examples

# Basic usage
img                          # Saves to ./imgs/img1.png, copies full path

# Context-specific saves
img -UI                      # Saves as ui1.png (UI screenshots)
img -Bug                     # Saves as bug1.png (bug reports)
img -Context                 # Saves as context1.png (general context)
img -Before                  # Saves as before1.png (before state)
img -After                   # Saves as after1.png (after state)

# Format and folder options
img -Format jpg              # Save as JPG format
img -FolderName "assets"     # Save to custom folder
img -DirectPath "temp/screenshot.png"  # Save to specific path
img -Silent                  # No console output

🛠️ Development

# Clone and test
git clone https://github.com/yourusername/clipboard-image-saver.git
cd clipboard-image-saver
Import-Module ./ClipboardImageSaver -Force

# Run tests
Invoke-Pester ./ClipboardImageSaver/Tests/

📁 Project Structure

clipboard-screenshot-saver/
├── README.md
├── .gitignore
├── CLAUDE.md
└── ClipboardImageSaver/
    ├── ClipboardImageSaver.psd1     # Module manifest
    ├── ClipboardImageSaver.psm1     # Main module file
    ├── Public/
    │   └── Save-ClipboardImage.ps1  # Main function
    ├── Private/
    │   └── (helper functions)
    └── Tests/
        └── (test files)

📝 License

MIT License - see LICENSE file for details.

Releases

No releases published

Packages

No packages published