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

imagic-agent

v1.0.0

Published

AI agent for image processing — convert, resize, and merge images using natural language

Readme

imagic-agent

A standalone CLI AI agent for image processing using natural language. Powered by the Imagic MCP server, it lets you convert formats, resize to presets, and merge images — all locally — by describing what you want in plain English.

How It Works

Your prompt → AI provider (Claude / GPT-4o / Gemini) → Imagic MCP tools → result

The agent uses the Vercel AI SDK to connect an AI model to the Imagic MCP server over stdio. The model decides which tools to call and can chain multiple operations automatically.

Requirements

  • Node.js 18+
  • API key for at least one supported provider

Installation

# Run without installing
npx imagic-agent

# Or install globally
npm install -g imagic-agent

Usage

Interactive mode

ANTHROPIC_API_KEY=sk-ant-... imagic-agent
Imagic Agent v1.0.0  |  Provider: Anthropic (claude-sonnet-4-6)
Type your request or "exit" to quit.

You: convert /tmp/photo.png to webp
Agent: Done! Saved to /tmp/photo.webp (42 KB).

You: resize it to instagram-square
...

Type exit or quit, or press Ctrl+C to exit.

Single-shot mode

Pass your request as a CLI argument and the agent exits after completing it.

imagic-agent "convert /tmp/photo.png to webp"
imagic-agent "resize /tmp/logo.png to favicon"
imagic-agent "merge /tmp/a.png /tmp/b.png /tmp/c.png into /tmp/merged.png as a grid"

Providers

The agent auto-detects the provider from your environment variables. You can also override it explicitly.

| Provider | Env var | Default model | |-----------|------------------------------------------------------|---------------------| | Anthropic | ANTHROPIC_API_KEY | claude-sonnet-4-6 | | OpenAI | OPENAI_API_KEY | gpt-4o | | Google | GOOGLE_GENERATIVE_AI_API_KEY or GEMINI_API_KEY | gemini-2.0-flash |

Auto-detection priority: --provider flag → ANTHROPIC_API_KEYOPENAI_API_KEY → Google key → defaults to Anthropic.

Override provider or model

imagic-agent --provider=openai "convert /tmp/a.png to webp"
imagic-agent --provider=google --model=gemini-1.5-pro "resize /tmp/logo.png to 512x512"

Available Tools

The agent has access to five tools from the Imagic MCP server:

| Tool | What it does | |----------------------|-----------------------------------------------------------------------| | convert_image | Convert a single image to PNG, JPEG, WebP, GIF, or ICO | | resize_image | Resize a single image to custom dimensions or a named preset | | convert_and_resize | Convert and resize a single image in one operation | | merge_images | Merge 2+ images horizontally, vertically, or in a grid | | process_folder | Apply convert/resize/convert_and_resize to all images in a folder |

Folder processing

Pass a folder path and the agent will find every image file automatically, skip non-images, and report per-file results. Supported input formats: JPG, PNG, GIF, WebP, BMP, TIFF, AVIF, HEIC/HEIF.

Resize presets

instagram-square, instagram-portrait, instagram-landscape, twitter-post, twitter-header, full-hd, 4k, youtube-thumbnail, favicon

Examples

# Convert a single file
imagic-agent "convert /tmp/photo.jpg to webp at quality 85"

# Resize to a social media preset
imagic-agent "resize /tmp/banner.png to twitter-header"

# Custom dimensions
imagic-agent "resize /tmp/avatar.png to 256x256, no aspect ratio lock"

# Merge images side by side
imagic-agent "merge /tmp/before.png and /tmp/after.png horizontally into /tmp/compare.png"

# Convert every image in a folder to WebP
imagic-agent "convert all images in /tmp/photos to webp"

# Resize all images in a folder to instagram-square, save to a new folder
imagic-agent "resize all images in /tmp/photos to instagram-square and save to /tmp/resized"

# Convert + resize an entire folder in one go
imagic-agent "convert all images in /tmp/shots to jpeg at quality 80 and resize to 1920x1080"

Tips

  • Always use absolute file paths (e.g. /Users/you/images/photo.png).
  • The agent maintains conversation history in interactive mode, so you can refer back to previous files.
  • Multi-step operations (convert + resize) are handled automatically — the model chains tool calls internally.