2026-03-19 20:07:17 +05:30
2026-03-19 19:12:50 +05:30
2026-03-12 17:03:04 +05:30
2026-03-19 19:20:39 +05:30
2026-03-19 19:12:50 +05:30
2026-03-19 19:20:39 +05:30
2026-03-19 19:41:25 +05:30
2026-03-19 19:20:39 +05:30

opencode-multi-model

Launch multiple AI models in tmux sessions. Available as:

  • OpenCode Plugin
  • Standalone CLI
  • Project-level tool

Installation

As OpenCode Plugin

Add to your OpenCode config (opencode.json):

{
  "plugin": ["@username/opencode-multi-model"]
}

As Standalone CLI

# Using bunx (no install)
bunx @username/opencode-multi-model open my-session -m openai/gpt-4o anthropic/claude-3-5-sonnet

# Or install globally
bun install -g @username/opencode-multi-model
opencode-multi-model open my-session -m openai/gpt-4o

As Project Tool

If you installed it via bun and want to use it as a project tool, import it from the package:

// .opencode/tools/multi-model.ts
import { openTool as open, closeTool as close } from "@username/opencode-multi-model"
export { open, close }

If you are developing this package locally and want to test it in a project without publishing, import via relative paths:

// .opencode/tools/multi-model.ts
import { openTool } from "../../src/tools/open"
import { closeTool } from "../../src/tools/close"
export { openTool as open, closeTool as close }

Usage

Plugin Usage

Open a session:

Use multi-model-open tool:
sessionName: my-session, models: ["openai/gpt-4o", "anthropic/claude-3-5-sonnet"]

Close a session (using tool):

call tool multi-model-close with sessionName: my-session

Close a session (using manual command):

tmux kill-session -t my-session && rm -rf ~/.local/share/opencode/multi-model/my-session && git worktree prune && git branch -D $(git branch --format='%(refname:short)' --list 'opencode/my-session/*')

CLI Usage

Open a session:

# Basic usage
opencode-multi-model open my-session -m openai/gpt-4o anthropic/claude-3-5-sonnet

# With custom binary (via flag)
opencode-multi-model open my-session -m openai/gpt-4o -b kilo

# With custom binary (via env)
export OPENCODE_MULTI_MODEL_BINARY=kilo
opencode-multi-model open my-session -m openai/gpt-4o

Close a session (CLI command):

# Close and cleanup worktrees
opencode-multi-model close my-session

Close a session (manual command):

tmux kill-session -t my-session && rm -rf ~/.local/share/opencode/multi-model/my-session && git worktree prune && git branch -D $(git branch --format='%(refname:short)' --list 'opencode/my-session/*')

Help:

opencode-multi-model --help
opencode-multi-model open --help
opencode-multi-model close --help

Configuration

Custom Binary

By default uses opencode. To use kilo instead:

Via environment variable:

export OPENCODE_MULTI_MODEL_BINARY=kilo

Via CLI flag:

opencode-multi-model open my-session -m openai/gpt-4o -b kilo

Priority: CLI flag > Environment variable > Default ("opencode")

Requirements

  • tmux
  • git
  • opencode or kilo binary
  • Bun runtime

Development

For local development and testing without publishing:

# Install dependencies
bun install

# Build
bun run build

# Run tests
bun test

# Test CLI locally
bun dist/cli.js open test-session -m openai/gpt-4o
bun dist/cli.js close test-session

Architecture

├── src/
│   ├── index.ts               # Plugin entry point
│   ├── cli.ts                 # CLI entry point
│   ├── types.ts               # Shared TypeScript types
│   ├── core/
│   │   ├── index.ts           # Core exports
│   │   ├── launch.ts          # Launch session logic
│   │   ├── close.ts           # Close session logic
│   │   └── utils.ts           # Helper functions
│   └── tools/
│       ├── open.ts            # Open tool definition
│       └── close.ts           # Close tool definition
├── tests/
│   └── multi-model.test.ts    # Tests
├── package.json
├── tsconfig.json
└── README.md

License

MIT

S
Description
No description provided
Readme MIT
237 KiB
Languages
TypeScript 99.1%
Shell 0.9%