opencode

package
v1.14.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 13 Imported by: 0

README

OpenCode App

Installs and configures OpenCode — a terminal-based AI code editor.

After Installation

Start OpenCode:

opencode

View configuration:

ls ~/.config/opencode/

Provider

Use OpenRouter — one API key, access to all models below.

export OPENROUTER_API_KEY="your-key-here"

Models

Model Role
anthropic/claude-fable-5 Hardest reasoning
anthropic/claude-opus-5 Daily coding (default)
moonshotai/kimi-k3 Agents + large repos
z-ai/glm-5.2 Deep review + architecture
deepseek/deepseek-v4-flash Cheap bulk tasks
When to switch
  • claude-fable-5 — when nothing else solves it
  • claude-opus-5 — everyday coding, bug fixes, PR reviews
  • kimi-k3 — large codebases, multi-file refactors, long agent workflows
  • glm-5.2 — architecture decisions, hard debugging, critical reviews
  • deepseek-v4-flash — background or non-critical automation

Plugins

~/.config/opencode/plugin/notify.js reports this coder's activity into the tmux pane it's running in — working / finished / blocked / errored — so dg ws's status dot and tmux's status bar can show it without switching windows.

Event mapping:

Event Writes
chat.message busy
session.idle idle
permission.updated blocked
session.error error

It writes via tmux set-option -p -t "$TMUX_PANE" @dg_agent_state <value>, plus a window-level mirror (@dg_window_agent_state) that tmux's status bar reads to flag a window nobody is looking at. It no-ops silently outside tmux (TMUX_PANE unset) — running opencode without tmux produces no error and no output about tmux.

See ADR-0005 for the full design.

Documentation

Index

Constants

View Source
const DEFAULT_THEME_NAME = "default"

Variables

This section is empty.

Functions

This section is empty.

Types

type OpenCode

type OpenCode struct {
	Cmd  cmd.Command
	Base cmd.BaseCommandExecutor
	// contains filtered or unexported fields
}

func New

func New() *OpenCode

func (*OpenCode) ConfigurableParts

func (o *OpenCode) ConfigurableParts() []string

ConfigurableParts lists the parts --only can refresh: the shared config subtrees plus the rtk integration (installs rtk's OpenCode plugin — the explicit opt-in required by ADR-0004).

func (*OpenCode) ExecuteCommand

func (o *OpenCode) ExecuteCommand(args ...string) error

func (*OpenCode) ForceConfigure

func (o *OpenCode) ForceConfigure() error

func (*OpenCode) ForceConfigureParts

func (o *OpenCode) ForceConfigureParts(parts []string) error

ForceConfigureParts refreshes only the named parts. Shared subtrees (skills, commands, agents) are overwritten from the embedded configs; the rtk part runs `rtk init -g --opencode`, which installs rtk's plugin as its own file (plugins/rtk.ts) — devgeta never touches that file, so no opt-in state needs tracking here, unlike claude's settings.json hook. Unlike full ForceConfigure this does not remove or regenerate opencode.json or themes, so a hand-edited config survives. This is the `--force --only=...` path.

func (*OpenCode) ForceInstall

func (o *OpenCode) ForceInstall() error

func (*OpenCode) Install

func (o *OpenCode) Install() error

func (*OpenCode) Kind

func (o *OpenCode) Kind() apps.AppKind

func (*OpenCode) Name

func (o *OpenCode) Name() string

func (*OpenCode) SoftConfigure

func (o *OpenCode) SoftConfigure() error

func (*OpenCode) SoftInstall

func (o *OpenCode) SoftInstall() error

func (*OpenCode) Uninstall

func (o *OpenCode) Uninstall() error

func (*OpenCode) Update

func (o *OpenCode) Update() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL