A VS Code extension to paste clipboard images directly into Markdown files. Currently fully supported on macOS Sequoia, and tested in VS Code, VSCodium, and Cursor IDE.
- Smart Asset Management: Automatically creates and manages
assets/imagesfolders - Accessibility Focus: Prompts for descriptive alt text
- Fast Workflow: Quick paste-to-markdown workflow
- Local Storage: Saves images as PNGs in the project structure
- Detailed Logging: Built-in logging for troubleshooting
- Capture image data from the macOS clipboard
- Prompt user for a filename (no extension) and alt-text
- Create (if missing) an
assets/images/folder alongside the current Markdown file - Save the clipboard image as PNG in that folder
- Insert a Markdown image link (
!\[alt-text\]\(assets/images/name.png\)) at the cursor
On macOS
brew install pngpaste- Download the
.vsixfile from the Releases page - In VS Code, VSCodium, or Cursor IDE,:
- ⇧⌘P
Extensions: Install from VSIX...
- ⇧⌘P
- Click the
...menu (top-right of the extension view) and selectInstall from VSIX... - Locate and select the downloaded
.vsixfile
On macOS
brew install pngpaste- Clone the repository
- Run
npm install(or your preferred package manager) - Run
npm run packageto build the VSIX file - Install the VSIX as described above
- VS Code 1.80.0 or higher (or compatible editor)
-
Copy an image to your clipboard:
- Take a screenshot (
Cmd+Shift+4on macOS) - Copy an image from any application
- Take a screenshot (
-
In a Markdown file:
- Press
Cmd+Alt+V(macOS) - Or use command palette (
Cmd+Shift+P): "Paste Image and Insert Markdown Link"
- Press
-
When prompted:
- Enter a filename (alphanumeric, hyphens, underscores)
- Provide alt text for accessibility
-
The extension will:
- Create
assets/imagesif needed - Save the image as PNG
- Insert a Markdown link at your cursor:
!\[the alt text\]\(assets/images/your-filename.png\)
- Create
src/
├── extension.ts # Main extension logic
└── clipboard.ts # Platform-specific clipboard handling
- TypeScript
- VS Code Extension API
- Vitest for testing
- Platform utilities (pngpaste)
- Clone the repository
- Install dependencies:
npm install
- Open in VS Code
- Press F5 to start debugging
The project includes unit, integration, and E2E tests:
npm test # Run all tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Run tests with coverage reportCurrent test coverage:
- Overall: 19.47% statement coverage
- clipboard.ts: 86.84%
- settings.ts: 100%
- extension.ts: 12.73% (in progress)
npm run package- Full functionality currently on macOS only
- PNG format only
- Single image paste at a time
- Document must be saved before pasting
- Filenames limited to alphanumeric, hyphens, underscores
If you get "No image found in clipboard":
- Verify you've copied an image
- Try copying again
- Check if
pngpasteis installed (macOS)
If image saving fails:
- Check write permissions
- Ensure document is saved
- Verify
assets/imagesisn't write-protected
Active areas for contribution:
- Windows implementation
- Linux implementation
- Additional image format support
- Test coverage improvements
MIT