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-morph-plugin

v1.0.1

Published

Pi extension for Morph SDK — Fast Apply, WarpGrep, Public Repo Context, and Compaction

Readme

🌀 pi-morph-plugin

Fast Apply, WarpGrep, Compaction & Repo Context via Morph

10,500+ tok/s code editing, agentic search, and 25,000+ tok/s compression for pi.

pi extension license



Quick Start

1. Get a Morph API key

Sign up at morphllm.com/dashboard and configure it:

Option A: Environment variable (recommended for quick setup)

export MORPH_API_KEY="sk-..."

Add this to your shell profile (~/.zshrc, ~/.bashrc, etc.) so it persists.

Option B: auth.json (recommended for persistent config)

Add to ~/.pi/agent/auth.json:

{
  "morph": { "type": "api_key", "key": "sk-..." }
}

The environment variable takes priority over auth.json.

2. Install the plugin

pi install https://github.com/morphllm/pi-morph-plugin

Or install locally in your project:

pi install -l https://github.com/morphllm/pi-morph-plugin

3. Start Pi

pi

You should see morph_edit, warpgrep_codebase_search, and warpgrep_github_search in the available tools. Compaction runs automatically when context exceeds the threshold.


Tools

Fast Apply (morph_edit)

10,500+ tok/s code merging. The LLM writes partial snippets with lazy markers (// ... existing code ...), Morph merges them into the full file.

Best for large files (300+ lines) and multiple scattered changes. For small exact replacements, use Pi's built-in edit tool.

WarpGrep (warpgrep_codebase_search)

Fast agentic codebase search. Runs multi-turn ripgrep + file reads to find relevant code contexts. Sub-6s per query. Best for exploratory queries ("how does X work?", "where is Y handled?").

Public Repo Context (warpgrep_github_search)

Search public GitHub repositories without cloning. Pass an owner/repo or GitHub URL and a search query. Returns relevant file contexts from Morph's indexed public repo search.

Compaction

Context compression via the Morph Compact API. When Pi's built-in compaction triggers (context exceeds threshold), this extension intercepts it and uses the Morph Compact API instead of default LLM summarization. Compresses in ~250ms at 25,000+ tok/s.


Configuration

All configuration is via environment variables.

| Variable | Default | Description | | ------------------------------- | ---------- | ------------------------------------------------------------ | | MORPH_API_KEY | required | Your Morph API key | | MORPH_COMPACT_RATIO | 0.3 | Target compression ratio (0.05-1.0, lower = more aggressive) | | MORPH_COMPACT_PRESERVE_RECENT | 1 | Number of recent messages to keep uncompacted | | MORPH_COMPACT | true | Set false to disable compaction | | MORPH_EDIT | true | Set false to disable Fast Apply | | MORPH_WARPGREP | true | Set false to disable WarpGrep | | MORPH_WARPGREP_GITHUB | true | Set false to disable public repo search |

Pi's compaction threshold is configured in ~/.pi/agent/settings.json or .pi/settings.json:

{
  "compaction": {
    "enabled": true,
    "reserveTokens": 16384,
    "keepRecentTokens": 20000
  }
}

Development

npm install

To test locally:

pi -e ./extensions/index.ts

Or symlink into your pi extensions directory:

ln -s $(pwd)/extensions/index.ts ~/.pi/agent/extensions/morph-plugin.ts

License

MIT