The Problem

Developers need an AI‑driven coding assistant that can edit code, run commands, and switch between permissive and read‑only modes without leaving the IDE. Existing tools are either closed‑source or require heavyweight local servers, making onboarding and reproducibility difficult.

What This Does

OpenCode delivers a self‑hosted, open‑source coding agent built on a React front‑end and a TypeScript back‑end. The UI lives under packages/app/src/ (e.g., app.tsx, components/session/) and is bundled with Vite (packages/app/vite.config.ts). Core agent logic is in the .opencode/ directory (e.g., agent/docs.md, tool/github-pr-search.ts).

Two built‑in agents—build (full edit rights) and plan (read‑only)—are selectable with <kbd>Tab</kbd>. The agent runtime is orchestrated by the GitHub Action entry point github/index.ts, while infrastructure scaffolding lives in infra/app.ts and related files.

How To Use It

Setup

The repo uses Bun as the primary package manager (see bun.lock and bunfig.toml). Install dependencies and start the UI with the commands documented in the root README.md:

Install globally (npm) – also works with bun/pnpm/yarn

npm i -g opencode-ai@latest

Or use the provided script for a quick install curl -fsSL https://opencode.ai/install | bash

For local development, clone the repo and run:

Install Bun if not present

curl -fsSL https://bun.sh/install | bash

Install repo dependencies

bun install

Start the React UI (Vite dev server)

npm run dev # defined in packages/app/package.json scripts

Configuration

Environment variables controlling install location are documented in the README (OPENCODEINSTALLDIR, XDGBINDIR). No additional secret files are committed; the .opencode/opencode.jsonc file holds optional user configuration.

Running the Agent

UI: Open http://localhost:5173 after npm run dev. CLI/Action: Execute the GitHub Action entry point with node github/index.ts (or via the published GitHub Action). Desktop: Download the pre‑built binary from the releases page; the installer respects the same environment variable precedence.

Real‑World Use

A team can run OpenCode inside a CI container to automatically generate PR suggestions. Example workflow:

.github/workflows/opencode.yml uses: actions/checkout@v3 uses: anomalyco/opencode@v1 with: agent: build target: src/

The action invokes github/index.ts, which loads the build agent and applies edits to files under src/, then commits the changes.

Code Health & Issues

Low – Missing lockfile for github/package.json – reproducibility of the GitHub Action build is not guaranteed. (.github/workflows/.yml reference this package). Low – Limited test coverage – only 4 test files (*.test.ts) exist for a 200‑file codebase; edge cases may be untested. Medium – Mixed package managers – root uses Bun (bun.lock), while the github/ sub‑package relies on npm without a lockfile, increasing dependency drift risk. Low – No explicit linting config – repository contains .prettierignore but no .eslintrc; style enforcement may be inconsistent. Info – CI/CD present – multiple GitHub Actions (typecheck.yml, test.yml, publish.yml) run type checking, tests, and publishing, indicating a functional CI pipeline. Info – Documentation – README, multilingual docs, and agent guides are comprehensive; the AGENTS.md file explains mode switching.

The Bottom Line

OpenCode provides a functional, open‑source AI coding assistant with a clear React/Vite front‑end and extensible agent architecture. It is well‑documented and CI‑tested, but the mixed package‑manager setup and missing lockfile for the GitHub Action package pose reproducibility concerns. Suitable for teams that want a self‑hosted alternative to proprietary agents and are comfortable managing Bun/NPM dependencies.