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

@f97/opencode-morph-fast-apply

v1.1.0

Published

OpenCode plugin for Morph Fast Apply - 10x faster code editing

Downloads

59

Readme

opencode-morph-fast-apply

OpenCode plugin for Morph Fast Apply - 10x faster code editing with lazy edit markers.

Features

  • 10,500+ tokens/sec code editing via Morph's Fast Apply API
  • Lazy edit markers (// ... existing code ...) - no exact string matching needed
  • Unified diff output with context for easy review
  • Graceful fallback - suggests native edit tool on API failure

Installation

1. Clone the repository

git clone https://github.com/JRedeker/opencode-morph-fast-apply.git ~/dev/oc-plugins/morph-fast-apply
cd ~/dev/oc-plugins/morph-fast-apply
npm install

2. Set your Morph API key

Get an API key at morphllm.com/dashboard, then add to your shell profile:

export MORPH_API_KEY="sk-your-key-here"

3. Add the plugin to your OpenCode config

Add to your global config (~/.config/opencode/opencode.json):

{
  "plugin": [
    "/path/to/morph-fast-apply"
  ],
  "instructions": [
    "/path/to/morph-fast-apply/MORPH_INSTRUCTIONS.md"
  ]
}

Or in a project-local .opencode/config.json:

{
  "plugin": [
    "~/dev/oc-plugins/morph-fast-apply"
  ],
  "instructions": [
    "~/dev/oc-plugins/morph-fast-apply/MORPH_INSTRUCTIONS.md"
  ]
}

4. Restart OpenCode

The morph_edit tool will now be available.

Usage

The LLM can use morph_edit for efficient partial file edits:

morph_edit({
  target_filepath: "src/auth.ts",
  instructions: "Add error handling for invalid tokens",
  code_edit: `// ... existing code ...
function validateToken(token) {
  if (!token) {
    throw new Error("Token is required");
  }
  // ... existing code ...
}
// ... existing code ...`
})

When to use morph_edit vs edit

| Situation | Tool | Reason | |-----------|------|--------| | Small, exact replacement | edit | Fast, no API call | | Large file (500+ lines) | morph_edit | Handles partial snippets | | Multiple scattered changes | morph_edit | Batch efficiently | | Whitespace-sensitive | morph_edit | Forgiving with formatting |

Configuration

| Variable | Default | Description | |----------|---------|-------------| | MORPH_API_KEY | (required) | Your Morph API key | | MORPH_API_URL | https://api.morphllm.com | API endpoint | | MORPH_MODEL | morph-v3-fast | Model (morph-v3-fast, morph-v3-large, auto) | | MORPH_TIMEOUT | 30000 | Request timeout in ms |

How It Works

  1. Reads the original file content
  2. Sends <instruction>, <code>, and <update> to Morph API
  3. Morph intelligently merges the lazy edit markers with original code
  4. Writes the merged result back to the file
  5. Returns a unified diff showing what changed

Contributing

Contributions welcome! This plugin could potentially be integrated into OpenCode core.

License

MIT