Opencode Fast Apply banner
tickernelz tickernelz

Opencode Fast Apply

Development community

Description

OpenCode plugin for Fast Apply - 10x faster code editing with lazy edit markers. No MCP server needed.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

opencode-fast-apply

OpenCode plugin for Fast Apply - High-performance code editing with OpenAI-compatible APIs.

Features

  • Partial file editing - Only send relevant sections (50-500 lines), not entire files
  • Smart context matching - Automatically finds and replaces code sections
  • Token efficient - Save 80-98% tokens compared to full-file edits
  • Lazy edit markers - Use // ... existing code ... for unchanged sections
  • Multi-backend support - LM Studio, Ollama, OpenAI, any OpenAI-compatible endpoint
  • Robust XML handling - Safely handles special characters and XML tags in code

Installation

npm install -g opencode-fast-apply

Configure your API endpoint:

# LM Studio (default)
export FAST_APPLY_URL="http://localhost:1234"
export FAST_APPLY_MODEL="fastapply-1.5b"
export FAST_APPLY_API_KEY="optional-api-key"

# Ollama
export FAST_APPLY_URL="http://localhost:11434"
export FAST_APPLY_MODEL="codellama:7b"

# OpenAI
export FAST_APPLY_URL="https://api.openai.com"
export FAST_APPLY_MODEL="gpt-4"
export FAST_APPLY_API_KEY="sk-your-key"

Add to OpenCode config (`~/.config/opencode/opencode.json`):

{
  "plugin": ["opencode-fast-apply"]
}

Restart OpenCode. The `fast_apply_edit` tool is now available.

Usage

// 1. Read relevant section (not entire file)
const content = await read("src/app.ts", { offset: 100, limit: 50 })

// 2. Edit with partial context
fast_apply_edit({
  target_filepath: "src/app.ts",
  original_code: content,  // Just 50 lines!
  code_edit: `// ... existing code ...
function updated() {
  return "modified";
}
// ... existing code ...`
})

**Key points:**

  • Provide 50-500 lines of context around the area you want to change
  • Include 2-5 lines before/after the target section
  • Tool automatically finds and replaces that section in the full file
  • No need to send entire file (saves tokens and improves speed)

Configuration

| Variable | Default | Description | |-