🚨 Latest Research:Tanstack npm Packages Compromised in Ongoing Mini Shai-Hulud Supply-Chain Attack.Learn More →
Socket
Book a DemoSign in
Socket

@f97/opencode-morph-fast-apply

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@f97/opencode-morph-fast-apply

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

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

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

SituationToolReason
Small, exact replacementeditFast, no API call
Large file (500+ lines)morph_editHandles partial snippets
Multiple scattered changesmorph_editBatch efficiently
Whitespace-sensitivemorph_editForgiving with formatting

Configuration

VariableDefaultDescription
MORPH_API_KEY(required)Your Morph API key
MORPH_API_URLhttps://api.morphllm.comAPI endpoint
MORPH_MODELmorph-v3-fastModel (morph-v3-fast, morph-v3-large, auto)
MORPH_TIMEOUT30000Request timeout in ms

How It Works

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

Contributing

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

License

MIT

Keywords

opencode

FAQs

Package last updated on 07 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts