npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pi-image-tools

v1.0.7

Published

Image attachment and rendering extension for Pi TUI

Readme

🖼️ pi-image-tools

Image attachment and preview extension for the Pi coding agent.

pi-image-tools lets you attach clipboard images or recent screenshots to your next user message, then preview them inline in the TUI before the message is sent.

pi-image-tools preview

Features

  • Clipboard image attach with /paste-image and keyboard shortcuts
  • Recent image picker for screenshots and cached clipboard images
  • Inline preview rendering in the TUI chat before the message is sent
  • Cross-platform recent image discovery for Windows, Linux, and macOS
  • Multiple clipboard backends with platform-specific fallbacks
  • Recent-cache persistence so clipboard images also appear in the recent picker
  • Terminal image safety that preserves inline image protocol rows during width fitting

Platform support

| Platform | Clipboard paste | Recent image picker | Notes | |----------|-----------------|---------------------|-------| | Windows | Yes | Yes | Uses native clipboard module first, then PowerShell fallback | | Linux | Yes | Yes | Requires a graphical session; uses wl-paste or xclip, then native module fallback | | macOS | Yes* | Yes | Clipboard paste depends on @mariozechner/clipboard being available | | Termux / headless Linux | No | Limited | Clipboard image paste is disabled without a graphical session |

* macOS clipboard image support relies on the optional native clipboard module.

Installation

Extension folder

Place this folder in one of these locations:

| Scope | Path | |-------|------| | Global | ~/.pi/agent/extensions/pi-image-tools | | Project | .pi/extensions/pi-image-tools |

Pi auto-discovers extensions in those paths.

Via npm

pi install npm:pi-image-tools

Via Git

pi install git:github.com/MasuRii/pi-image-tools

Usage

Commands

Paste from clipboard

/paste-image clipboard

or simply:

/paste-image

This reads an image from your clipboard and queues it for attachment. A marker ([󰈟 Image Attached]) is inserted into your draft. When you send the message, the marker is removed and the image payload is attached.

Remove all markers from the draft before sending if you want to discard pending images.

Paste from recent images

/paste-image recent

This opens an interactive picker showing recent screenshots and cached clipboard images.

Example entry:

01. Screenshot 2026-03-02 142233.png • 2m ago • 412 KB • C:\Users\...\Pictures\Screenshots\...

Selecting an entry queues that image for your next message.

Keyboard shortcuts

| Platform | Shortcuts | |----------|-----------| | Windows | Alt+V, Ctrl+Alt+V | | Linux / macOS | Ctrl+V, Alt+V, Ctrl+Alt+V |

Configuration

Environment variables

| Variable | Description | Default | |----------|-------------|---------| | PI_IMAGE_TOOLS_RECENT_DIRS | Semicolon-separated directories to search for recent images | Platform defaults listed below | | PI_IMAGE_TOOLS_RECENT_CACHE_DIR | Custom cache directory for clipboard-pasted images | OS temp dir + pi-image-tools/recent-cache |

Example:

$env:PI_IMAGE_TOOLS_RECENT_DIRS = "C:\Users\me\Pictures\Screenshots;D:\Shares\Screens"

Runtime config

A config file can be placed at:

~/.pi/agent/extensions/pi-image-tools/config.json

Starter template:

{
  "enabled": true
}

See config/config.example.json for the same template.

Default recent-image search locations

Windows

  1. Cache directory for clipboard-pasted images
  2. ~/Pictures/Screenshots
  3. ~/OneDrive/Pictures/Screenshots
  4. ~/Desktop filtered to screenshot-like names

Linux

  1. Cache directory for clipboard-pasted images
  2. ~/Pictures/Screenshots
  3. ~/Pictures filtered to screenshot-like names
  4. ~/Downloads filtered to screenshot-like names
  5. ~/Desktop filtered to screenshot-like names

macOS

  1. Cache directory for clipboard-pasted images
  2. ~/Desktop filtered to screenshot-like names
  3. ~/Downloads filtered to screenshot-like names
  4. ~/Pictures/Screenshots
  5. ~/Pictures filtered to screenshot-like names

Supported image formats:

  • .png
  • .jpg
  • .jpeg
  • .webp
  • .gif
  • .bmp

Rendering details

Inline user preview

When you queue one or more images, the extension renders an inline preview inside the user message area.

Preview behavior:

  • up to 3 images are previewed per message
  • Sixel rendering is attempted on Windows when available
  • native TUI image rendering is used as the fallback
  • inline width fitting now preserves Sixel, Kitty, and iTerm image protocol rows instead of truncating them like plain text

Clipboard readers

pi-image-tools uses the first available clipboard backend for the current platform:

  • Windows
    • @mariozechner/clipboard
    • PowerShell System.Windows.Forms.Clipboard
  • Linux
    • wl-paste (wl-clipboard) in Wayland sessions
    • xclip in X11 sessions
    • @mariozechner/clipboard fallback
  • macOS
    • @mariozechner/clipboard

If a platform-specific reader exists but no image is currently on the clipboard, the command returns a normal “No image found in clipboard” message. If no usable reader exists at all, the extension surfaces a setup-oriented error.

Project structure

pi-image-tools/
├── index.ts                    # Root entrypoint for Pi auto-discovery
├── src/
│   ├── index.ts                # Extension bootstrap and message flow
│   ├── commands.ts             # /paste-image command registration
│   ├── clipboard.ts            # Cross-platform clipboard image reading
│   ├── recent-images.ts        # Recent image discovery and cache management
│   ├── image-preview.ts        # Preview building and Sixel/native rendering
│   ├── inline-user-preview.ts  # Inline preview patching for user messages
│   ├── keybindings.ts          # Keyboard shortcut registration
│   ├── temp-file.ts            # Temporary file management and cleanup
│   └── types.ts                # Shared TypeScript types
├── config/
│   └── config.example.json     # Starter runtime config
└── asset/
    └── pi-image-tools.png      # README preview image

Troubleshooting

| Issue | Solution | |-------|----------| | No image found in clipboard | Confirm you copied an actual image, not text or a file path | | Linux clipboard paste fails | Make sure you are in a graphical session and install wl-clipboard or xclip | | Recent picker is empty | Add directories via PI_IMAGE_TOOLS_RECENT_DIRS or paste images from clipboard first so they enter the recent cache | | /paste-image recent says it requires interactive mode | Run Pi in interactive TUI mode | | Sixel preview warning appears | On Windows, install the PowerShell Sixel module and restart Pi |

Manual Sixel installation:

Install-Module -Name Sixel -Scope CurrentUser -Force -AllowClobber

Development

# Type-check
npm run build

# Run tests
npm run test

# Full verification
npm run check

License

MIT