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

pigmento

v0.1.0

Published

Local-first asset cleanup for codebases. Find duplicates, see references, hand cleanup to a coding agent.

Readme

pigmento

Every image in your repo, in one place.

Pigmento points at a codebase and gives you a browsable surface for every icon, illustration, and image inside it. It clusters duplicates and near-duplicates by perceptual similarity, shows where each asset is referenced across the source, and hands the cleanup plan to a coding agent that opens a PR.

Local-first. Runs on your machine. Nothing is uploaded. The agent-facing MCP server (pigmento mcp) is local stdio only: no network listener, no remote transport.

local-first · macos · linux · windows · MIT

Pika · folder tree, asset grid, and detail drawer side by side


What it does

  • Scans every image and icon under one or more local source roots.
  • Groups by content hash, perceptual hash, optional CLIP embedding, and filename family.
  • Maps references across your code and styles so you know what's safe to merge or delete.
  • Builds a cleanup plan in the app: pick a canonical, queue the dupes, mark unused assets.
  • Hands off to an agent (Claude Code today; Cursor, Codex, aider stubbed) which rewrites imports and opens a PR.

It's not a build tool, not a CDN, not a Figma plugin. It's the map of the asset surface that none of those give you.

Quick start

Prerequisites: Node 24, pnpm 10. On macOS, if you have libvips installed via Homebrew, prefix pnpm install with SHARP_IGNORE_GLOBAL_LIBVIPS=1.

git clone https://github.com/chinmaykunkikar/pigmento.git
cd pigmento
pnpm install
pnpm db:migrate
pnpm pigmento source add /path/to/your/repo
pnpm pigmento index
pnpm dev

The app opens at http://localhost:9900. Add more sources from the sidebar at any time, or via the CLI.

The three views

Grid. A high-density gallery of every image in the repo. Filter by folder, type, ref count, or search.

Clusters. Pigmento collapses look-alikes into a single row. The eleven logos you exported four times all live here, with the highest-resolution version recommended as canonical and an UNUSED flag on anything with zero references.

Near-duplicate clusters

Match. Drop any image onto the window and pigmento tells you whether a near-match already exists in the codebase, before you commit a new one.

Match a dropped file

Agent handoff

From the app, queue a set of merges and deletes into a cleanup plan. Pigmento emits a structured plan.json and a small CLI bridge hands it to your agent harness. The agent rewrites imports, deletes the redundant assets, and opens a PR. You stay in control of which clusters merge.

Plan dispatch panel · pick a harness, mode, and send to the agent

The wire format is plain JSON validated by lib/plan/schema.ts (the example below is abbreviated; every action kind carries full asset refs):

{
  "version": "pika/plan v1",
  "id": "plan-3f2a",
  "name": "logo cleanup",
  "sourceId": 1,
  "sourceLabel": "cohort-live-web",
  "createdAt": 1764979200000,
  "updatedAt": 1764979200000,
  "actions": [
    {
      "id": "act-1",
      "createdAt": 1764979200000,
      "kind": "merge-exact",
      "hashKey": "c0ffee42",
      "keep": { "assetId": 12, "relPath": "public/logo.svg", "name": "logo.svg", "size": 4096, "usageCount": 24 },
      "drop": [{ "assetId": 31, "relPath": "src/marketing/brand-logo.svg", "name": "brand-logo.svg", "size": 4096, "usageCount": 2 }]
    },
    {
      "id": "act-2",
      "createdAt": 1764979200000,
      "kind": "delete-unused",
      "drop": [{ "assetId": 44, "relPath": "archive/logo-old.svg", "name": "logo-old.svg", "size": 9120, "usageCount": 0 }]
    }
  ]
}

Stack

| | | |---|---| | Runtime | Node 24, pnpm 10 | | App | Next 16 App Router, React 19, TypeScript strict | | Styling | Tailwind CSS v4 (CSS-first config) + Radix Primitives + cmdk | | Data | SQLite via better-sqlite3 with WAL, Drizzle ORM | | Indexing | sharp (dims, raster, pHash), xxhash-wasm (content hash), optional CLIP embeddings | | Search | SQLite FTS5 + Fuse.js | | Lint/format | Biome (one tool) |

Architecture boundaries are strict: UI never imports from lib/db/ or lib/indexer/; everything goes through app/api/** via TanStack Query. The indexer is the only writer (plus plan CRUD). See CLAUDE.md for the engineering rules and DESIGN.md for the design system.

Configuration

pigmento.config.ts at the repo root holds source roots, code/style scan paths, ignore globs, and harness settings:

import type { Config } from "./lib/config/schema";

const config: Config = {
  sources: [],
  codeRoots: ["./src", "./app", "./pages", "./layouts"],
  styleRoots: ["./assets/css", "./src/styles"],
  extensions: ["svg", "png", "jpg", "jpeg", "webp", "gif"],
  ignore: ["**/node_modules/**", "**/.next/**", "**/.nuxt/**", "**/dist/**"],
  dbPath: "./data/pika.db",
  phash: { enabled: true, maxHamming: 12 },
  clip: { enabled: false },
  usage: { maxHitsPerAsset: 50 },
  agent: {
    harnesses: { "claude-code": { bin: "claude", cwd: "./" } },
  },
};

export default config;

Commands

pnpm dev                        # next dev on :9900
pnpm build && pnpm start        # production build
pnpm pigmento                   # CLI: source, index, status, match, plan
pnpm pigmento source add <path>
pnpm pigmento index [--full]
pnpm pigmento status
pnpm pigmento match <file>      # find near-matches for a file
pnpm db:generate                # drizzle-kit generate from schema diff
pnpm db:migrate                 # apply pending migrations
pnpm db:studio                  # web UI for the SQLite store
pnpm typecheck
pnpm lint
pnpm fmt

Contributing

See CONTRIBUTING.md. The short version: TypeScript strict, Biome clean, no em-dashes, immutable data. Open issues and PRs against master.

License

MIT. See LICENSE.