ProvidersOpenCode

OpenCode

Install, configure, verify, and run OpenCode through Tejus on Windows.

Tejus connects to the OpenCode CLI installed on your machine. By default it starts a private local OpenCode server (opencode serve on 127.0.0.1, protected by a generated password) and talks to it for each task. OpenCode owns its configured model providers, credentials, model catalog, agents, and commands; Tejus supplies the task, environment, transcript, Git workflow, and review surfaces around the session.

Install

Install OpenCode with npm from PowerShell:

npm install -g opencode-ai

Tejus looks for the opencode executable on PATH. It also checks common Windows install folders, including %USERPROFILE%\.opencode\bin, %LOCALAPPDATA%\Programs\opencode, the npm global folder (%APPDATA%\npm), Scoop, Chocolatey, Bun, and pnpm. Verify the installation:

opencode --version

Authenticate

OpenCode can connect to many model providers. In Tejus, open Settings → Agent providers, expand OpenCode under Provider tools, and click Sign in; Tejus runs opencode auth login in a terminal window. Choose a model provider, then complete its OAuth or API-key setup. Or run it yourself:

opencode auth login

You can also start the OpenCode TUI with opencode and use /connect to add a provider and /models to select a model. OpenCode can also read provider credentials and model definitions from its own configuration.

Authentication belongs to OpenCode and the selected model provider. Tejus does not move API keys into a separate account system, and it does not read a login status for OpenCode, so the provider shows as installed with unknown authentication until you run a task.

Verify

From a new PowerShell window:

opencode --version
opencode

Confirm that:

  • The intended model provider is connected
  • /models shows the expected catalog
  • A harmless read-only request succeeds
  • The same executable is the one Tejus should use

Connect to Tejus

Enable OpenCode

Open Settings → Agent providers, keep OpenCode enabled under Provider activity, and click Refresh status.

Check the binary path

Use automatic discovery unless you intentionally installed multiple OpenCode versions. OpenCode binary path (in OpenCode's Runtime section under Provider tools) should point to the executable, not its configuration directory.

Check the model catalog

Tejus reads models, variants, and agents from the OpenCode server. Confirm that the model and variant controls match the configuration you tested in OpenCode.

Start a test task

Use a small repository and one explicit model before relying on custom routing, local models, or a large provider catalog.

Server settings

OpenCode's Runtime section has optional server settings:

  • OpenCode server URL: connect to an OpenCode server you already run (for example http://127.0.0.1:4096). Leave blank and Tejus starts its own local server.
  • OpenCode server password: the password for that external server.
  • OpenAI response WebSockets: use OpenCode's experimental OpenAI response WebSocket transport. It applies only to servers Tejus starts.

Capabilities in Tejus

OpenCode sessions can expose:

  • Models configured through OpenCode and its connected providers
  • Provider-specific variants and OpenCode agents
  • Tool calls, file changes, and command output
  • OpenCode commands and skills where the runtime advertises them
  • Session continuation and task history
  • Plan mode, which runs OpenCode's plan agent with only read-only tools allowed
  • Permission requests (allow once, always allow, or reject) and questions
  • Context compaction

OpenCode supports many underlying model providers. Two users with the same OpenCode version can therefore see different models, authentication requirements, and limits.

Tejus does not support live steering of a running OpenCode turn. Send follow-ups according to the controls available in the active task rather than assuming Claude, Codex, and OpenCode behave identically.

Configuration

Keep provider credentials and model definitions in OpenCode's supported configuration locations. Project-level configuration can intentionally differ from global configuration, so verify the catalog from the same repository Tejus will open.

When a model appears in OpenCode but not Tejus, compare:

  • The executable path
  • Global and project configuration
  • Provider credentials
  • OpenCode version
  • The working directory used for discovery

Updating

OpenCode supports an update command:

opencode upgrade

Settings → Agent providers → Updates can run this for you; for npm, pnpm, and Bun installs Tejus adds the matching --method. Restart Tejus after updating.

Troubleshooting

OpenCode is not detected

Tejus shows “OpenCode CLI (opencode) is not installed or not on PATH.” Run opencode --version in a new PowerShell window. If it works there but not in Tejus, check the custom binary path and restart Tejus so it picks up your current PATH.

The configured server is rejected

“Configured OpenCode server URL is invalid” means the OpenCode server URL field does not contain a valid URL. Fix or clear it; with the field blank, Tejus starts its own server.

OpenCode opens but no model is usable

Configure at least one model provider through opencode auth login, /connect, or OpenCode configuration, then verify it directly with /models and a test request.

The wrong provider or model catalog appears

Multiple OpenCode installations or project-level configuration can produce different catalogs. Confirm the exact executable and working directory.

A model option is ignored

Not every underlying provider supports the same options. Reproduce the selection in OpenCode first, then report the OpenCode version, model ID, provider ID, and option that differs.

Official documentation

Continue with Your first task or Provider handoffs.

Last updated on