New Chat
  • Websites
  • Docs
  • Slides
  • Sheets
  • Deep Research
Kimi Code Kimi Claw
Chat History
  • Mobile App
  • About Us
    • Visit Moonshot AI
    • Open Platform
    • Features
    • Terms of Service
    • Privacy Policy
  • Language
  • User Feedback

Installing Oh My OpenCode Plugin

Developing Oh My OpenCode itself
Perfect! Since you're developing Oh My OpenCode itself and want to test it against your OpenCode dev branch, here's how to set up your local development environment:

Development Setup for Oh My OpenCode

1. Project Structure Setup

bash
Copy
# Create your development workspace
mkdir -p ~/dev/opencode-ecosystem
cd ~/dev/opencode-ecosystem

# Clone both repositories (if you haven't already)
git clone https://github.com/opencode-ai/opencode.git
git clone https://github.com/code-yeongyu/oh-my-opencode.git

2. Build Your OpenCode Dev Branch

bash
Copy
cd ~/dev/opencode-ecosystem/opencode
git checkout your-dev-branch  # Switch to your dev branch
bun install
bun run build

# Link your dev build globally (optional but recommended for testing)
bun link
# or use local path directly

3. Prepare Oh My OpenCode for Development

bash
Copy
cd ~/dev/opencode-ecosystem/oh-my-opencode
bun install

# Build the plugin
bun run build

4. Link Oh My OpenCode to Your Dev OpenCode

Method A: File Path Reference (Recommended for active development)
Edit your OpenCode configuration to point directly to your local Oh My OpenCode source:
bash
Copy
# Edit the global config
nano ~/.config/opencode/opencode.json
Add the absolute file path to your local Oh My OpenCode:
JSON
Copy
{
  "plugin": [
    "file:///home/YOUR_USERNAME/dev/opencode-ecosystem/oh-my-opencode"
  ],
  "model": {
    "default": "claude-sonnet-4-20250514"
  }
}
⚠️ Important: Use file:// protocol with absolute path. Relative paths may not resolve correctly.
Method B: Bun Link (Alternative)
bash
Copy
cd ~/dev/opencode-ecosystem/oh-my-opencode
bun link

cd ~/dev/opencode-ecosystem/opencode
bun link oh-my-opencode  # Link to your dev opencode

5. Hot Reload Development Workflow

Since you're actively developing, set up a watch mode:
bash
Copy
# Terminal 1: Watch and rebuild Oh My OpenCode on changes
cd ~/dev/opencode-ecosystem/oh-my-opencode
bun run build --watch  # or use chokidar-cli, etc.

# Terminal 2: Run OpenCode with your dev plugin
cd ~/dev/opencode-ecosystem/opencode
bun run start  # or ./dist/cli.js

6. Debugging Tips

Check plugin loading:
bash
Copy
# Run with verbose logging to see plugin initialization
DEBUG=opencode:* opencode
Verify config:
bash
Copy
cat ~/.config/opencode/opencode.json | jq '.plugin'
Test plugin functionality:
bash
Copy
# Start interactive session
opencode

# In the chat, test Oh My OpenCode features:
# - /commit command
# - Enhanced prompts
# - Custom agents

7. Project-Level Testing (Isolated)

If you want to test without affecting your global OpenCode config, create a project-level config:
bash
Copy
cd ~/dev/opencode-ecosystem/oh-my-opencode
mkdir -p test-project
cd test-project

# Create local opencode.json
cat > opencode.json << 'EOF'
{
  "plugin": ["file:///home/YOUR_USERNAME/dev/opencode-ecosystem/oh-my-opencode"],
  "model": {
    "default": "claude-sonnet-4-20250514"
  }
}
EOF

# Run opencode from this directory - it will use local config
opencode

8. Publishing Workflow (When Ready)

When you're ready to test the npm package flow:
bash
Copy
cd ~/dev/opencode-ecosystem/oh-my-opencode

# Bump version
npm version patch

# Pack locally to test
npm pack
# This creates oh-my-opencode-X.X.X.tgz

# Test install from tarball
cd ~/dev/test-project
opencode plugin install ./path/to/oh-my-opencode-X.X.X.tgz

Quick Reference: File Paths

Table
ComponentPath
OpenCode Dev Branch~/dev/opencode-ecosystem/opencode
Oh My OpenCode Source~/dev/opencode-ecosystem/oh-my-opencode
Global Config~/.config/opencode/opencode.json
Project Config./opencode.json (in any project dir)

Troubleshooting

Plugin not loading?
  • Ensure bun run build completed without errors in oh-my-opencode
  • Check that file:// path is absolute and correct
  • Verify OpenCode version supports plugins (≥1.0.150)
Changes not reflecting?
  • OpenCode may cache plugins - restart the CLI
  • Ensure you're running the dev build of OpenCode, not a globally installed stable version
Import errors?
  • Check that oh-my-opencode/dist/index.js exists and exports correctly
  • Verify package.json has correct main/exports fields
Would you like me to elaborate on any specific part of the setup, such as the build configuration or testing workflow?