Skip to content

morphllm/opencode

 
 

Repository files navigation

morphcli logo

AI coding agent with Morph Fast Apply integration.

Discord npm Build status

https://docs.morphllm.com This repo is based on the opencode repo and its brilliant contributiors!

Installation

# Package managers
npm i -g morphcli@latest        # or bun/pnpm/yarn
bun install morphcli@latest
yarn global add morphcli@latest
pnpm add -g morphcli@latest

Quick Start

Set your API keys and run the Morph integration:

ANTHROPIC_API_KEY="your-claude-key" MORPH_API_KEY="your-morph-key" morphcli run

Morph Fast Apply (Optional)

For faster, more accurate code edits, opencode can integrate with Morph - an AI model specialized for code merging at 4500+ tokens/second with 98.8% accuracy.

# Enable Morph Fast Apply
export MORPH_API_KEY=your_api_key

When enabled, opencode's edit tool automatically uses Morph's intelligent code merging instead of search-and-replace, supporting multiple edits and // ... existing code ... syntax.

Documentation

For more info on how to configure morphcli and Morph Fast Apply head over to the docs.

Development

To run morphcli locally you need:

  • Bun
  • Node.js/TypeScript

And run:

$ bun install
$ bun dev

Development Notes

Morph Integration: This CLI integrates with Morph Fast Apply API for intelligent code merging. See agent-instruction.txt for integration details.

Features

Morph Fast Apply Integration

  • Intelligent Code Merging: Replace full file rewrites with Morph's 4500+ tokens/second merging
  • Batch Processing: Non-interactive mode for automation
  • File-based Instructions: Read prompts from agent-instruction.txt by default
  • Provider Agnostic: Works with Claude, OpenAI, and other providers

Key Capabilities

  • Smart Editing: Uses // ... existing code ... syntax for precise edits
  • Error Handling: Robust error collection and reporting
  • Flexible Input: Command line args, stdin, or file input
  • Terminal Focused: Built for CLI workflows and automation

Learn more Morph Docs | Fast Apply Guide

About

AI coding agent, built for the terminal.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 53.6%
  • MDX 42.0%
  • CSS 3.3%
  • Rust 0.6%
  • Astro 0.2%
  • JavaScript 0.1%
  • Other 0.2%