
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
Fast Apply is a tool that you give to your AI agent that allows it to edit code or files.
apex-fast is a plugin for OpenCode AI that integrates Morph Fast Apply — an AI model specialized for code editing boasting 10,500+ tokens/second speeds and 98% accuracy. This plugin overrides the built-in edit tool with morph_edit, which is significantly faster for large files and complex changes.
morph-v3-fast or morph-v3-large models based on instruction complexityedit Tool — Blocks the built-in edit tool and directs the AI to use fastApply insteadplan or explore modes.Sign up and get your API key at morphllm.com.
Edit your ~/.config/opencode/opencode.json file and add the plugin:
{
"plugin": ["apex-fast@latest"],
"instructions": ["Follow Instructions in `~/.config/opencode/Morph-Rules.md`"]
}
Note: The
"instructions"field tells the AI to readMorph-Rules.mdas its guide on when to usefastApplyvs other tools.
Morph-Rules.md (REQUIRED)The Morph-Rules.md file acts as the primary behavioral guideline for the AI. You must copy it into your OpenCode config directory. Without it, the AI won't know how to use morph_edit properly.
# Download Morph-Rules.md into your OpenCode config directory
curl -o ~/.config/opencode/Morph-Rules.md \
https://raw.githubusercontent.com/yunaamelia/apex-fast/main/Morph-Rules.md
Alternatively, manually copy it from this repository.
The plugin requires the MORPH_API_KEY to be available in your environment.
Permanent approach (recommended):
# Add to ~/.bashrc or ~/.zshrc
echo 'export MORPH_API_KEY="sk-your-key-here"' >> ~/.bashrc
source ~/.bashrc
Or add it directly to a .env file in your working directory:
MORPH_API_KEY=sk-your-key-here
fastApply ToolOnce the plugin is active, your AI will have access to the fastApply tool. Use the syntax // ... existing code ... as a marker for unchanged code.
| Parameter | Type | Required | Description |
|---|---|---|---|
filePath | string | ✅ | Relative path to the file you want to edit |
instructions | string | ✅ | Specific instructions detailing what to change |
codeEdit | string | ❌ | Partial code snippet using // ... existing code ... markers |
Adding a new function:
// ... existing code ...
import { newDep } from './newDep';
// ... existing code ...
function newFeature() {
return newDep.process();
}
// ... existing code ...
Modifying existing code:
// ... existing code ...
function existingFunc(param) {
// Updated implementation
const result = param * 2; // Changed from * 1
return result;
}
// ... existing code ...
⚠️ IMPORTANT: Always include
// ... existing code ...at the beginning and end of your snippet. Otherwise, Morph will delete the code outside of the snippet.
| Situation | Tool | Reason |
|---|---|---|
| Small & exact string replacement | edit | Fastest, no API call |
| Simple variable/function rename | edit | Precise, no AI needed |
| Large files (300+ lines) | fastApply | 10x faster, partial snippets |
| Multiple scattered changes | fastApply | Batch changes in one pass |
| Complex refactoring | fastApply | AI parses context better |
| Whitespace-sensitive edits | fastApply | High tolerance for formatting differences |
This plugin can also run as a standalone MCP Server for use with other MCP clients (like Claude Desktop).
MORPH_API_KEY=sk-your-key npx apex-fast-mcp
MORPH_API_KEY=sk-your-key npx apex-fast-mcp sse 3000
The server will run on:
http://localhost:3000/ssehttp://localhost:3000/message[ERROR] Missing MORPH_API_KEYThe plugin cannot find the API key. Ensure:
MORPH_API_KEY environment variable is set.env, the file exists in the current working directory[ERROR] Failed to read fileThe specific filePath cannot be read. Ensure:
If you attempt to edit a large file (>10 lines) and omit the // ... existing code ... markers, the plugin will block the tool call to prevent catastrophic code loss. The AI should simply rewrite the codeEdit parameter correctly wrapped inside markers.
If Morph API times out or rate limits:
edit tooledit tool requires exact string matchingmise run build # Build the project
mise run test # Run the test suite
mise run lint # Lint the code
mise run lint:fix # Automatically fix linting issues
See the RELEASE.md file for instructions on how to release a new version.
Contributions are very welcome! Please open an issue or submit a pull request on the GitHub repository.
See the LICENSE file for details.
FAQs
Fast Apply is a tool that you give to your AI agent that allows it to edit code or files.
We found that apex-fast demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.