OpenCode sits in the same agentic CLI neighborhood as Codex CLI, Pi, NanoClaw, and Herdr, but its shape is different.
It is not just a terminal command. The current anomalyco/opencode repository is a Bun/TypeScript monorepo with a core CLI, server package, web app, desktop app, plugin package, SDK, LLM/provider layer, terminal UI pieces, and packaging infrastructure.
OpenCode is an open-source AI coding agent that can run as a terminal coding assistant, a local server, a web interface, and a desktop app.
OpenCode GitHub Source Code OpenCode Documentation OpenCode Desktop Download License: MIT
What is OpenCode?
OpenCode is a coding-agent CLI for local developer workflows.
The quick install options from the README include:
curl -fsSL https://opencode.ai/install | bash
npm i -g opencode-ai@latest
brew install anomalyco/tap/opencode
Once installed, the main command is:
opencode
The command surface I validated locally includes:
opencode --help
opencode run "explain this repository"
opencode serve --hostname 127.0.0.1 --port 14096
opencode web
opencode models openai
opencode providers
opencode agent list
opencode mcp
opencode session
The installed binary on this machine was opencode 1.15.13. The cloned source checkout was newer, at 1.16.2.
That difference matters: I validated the installed CLI and server behavior, but I did not validate a fresh source build of the newest checkout.
Repository Shape
The repository I inspected was:
tmp/foss-post/opencode
Source snapshot:
| Item | Value |
|---|---|
| Repository | anomalyco/opencode |
| Commit | 4519a1da329c1a4fc384054e7203ba7d06928205 |
| Commit date | 2026-06-06T13:57:23+00:00 |
| Commit message | chore: update nix node_modules hashes |
| Latest tag observed | v1.16.2 |
| Package manager | [email protected] |
| License | MIT |
Important paths:
| Path | What it contains |
|---|---|
packages/opencode/ |
main OpenCode CLI and core business logic |
packages/server/ |
server route layer and auth wiring |
packages/app/ |
web app |
packages/desktop/ |
desktop app |
packages/sdk/js/ |
JavaScript SDK |
packages/plugin/ |
plugin package |
packages/llm/ |
provider/model integration code |
packages/cli/ |
additional CLI package |
specs/v2/ |
provider/model and policy design specs |
This is also an important SEO and reader-clarity note: some older search results and articles refer to different or stale “OpenCode” projects. The current repo covered here is the Bun/TypeScript anomalyco/opencode project with the opencode-ai npm install path.
Built-in Agent Modes
The README documents two built-in agents:
| Agent | Practical use |
|---|---|
build |
default full-access development agent |
plan |
read-only analysis and planning agent |
It also documents a general subagent that can be invoked as:
@general
That separation is useful because many coding-agent workflows benefit from a read-only planning mode before handing execution to a higher-permission agent.
Provider and Model Support
OpenCode is provider-flexible. The provider/model spec in this checkout includes provider IDs such as:
opencodeanthropicopenaigooglegoogle-vertexgithub-copilotamazon-bedrockazureopenroutermistralgitlab
I also validated the installed CLI model listing for OpenAI:
opencode models openai
It returned many OpenAI model IDs, including gpt-5, gpt-5-codex, gpt-5.3-codex, gpt-5.4, gpt-5.5, image models, embedding models, and older GPT-4/o-series entries.
Provider support is not the same thing as being ready to spend tokens immediately. You still need credentials and provider configuration.
Local Field Test
Local environment during the trial:
| Item | Value |
|---|---|
| Node | v22.22.0 |
| npm | 10.9.4 |
| pnpm | 10.33.0 |
| Bun | not installed on PATH |
| Go | go1.26.3 |
| Free disk | about 17GB |
| Available RAM | about 2GB |
| Swap | 0B |
Source Dev Path
The cloned repo expects Bun:
bun install
bun dev
But on this machine:
bun --version
failed with:
bun: command not found
So I did not run the repo-local bun install, bun dev, or package tests from source.
That is the main local blocker for contributors: install Bun 1.3+ before trying to develop directly from the monorepo.
Installed CLI Path
This machine already had OpenCode installed:
which opencode
opencode --version
opencode --help
Observed:
/home/jalcocert/.nvm/versions/node/v22.22.0/bin/opencode
1.15.13
The help output exposed commands for completion, ACP, MCP, TUI mode, run, providers/auth, agents, server mode, web mode, model listing, stats, session export/import, plugins, database tools, and GitHub workflows.
Local Server UI
The documented server default is port 4096.
My first attempt failed:
opencode serve --hostname 127.0.0.1 --port 4096 --print-logs
because port 4096 was already in use by another local process:
Failed to start server. Is port 4096 in use?
I retried on a high port:
opencode serve --hostname 127.0.0.1 --port 14096 --print-logs
Result:
opencode server listening on http://127.0.0.1:14096
Fetching the local URL returned the OpenCode web app shell, including the root HTML, JavaScript bundle, stylesheet, favicon references, and a #root application mount point.
One important warning appeared:
Warning: OPENCODE_SERVER_PASSWORD is not set; server is unsecured.
For anything beyond a local-only quick test, set a server password and avoid binding it publicly without understanding the auth model.
Docker Notes
There is a packages/opencode/Dockerfile, but this repo is not a compose-first self-hosted web app in the same way as a dashboard or media service.
The Dockerfile expects a prebuilt OpenCode binary under a dist/ path and packages that binary into an Alpine image. I did not validate a Docker Compose deployment, so I did not add a Home-Lab compose file for this post.
For readers, the practical path today is:
- install the released CLI
- run the TUI locally
- run
opencode serveoropencode webif you want the local web surface - use source checkout only after installing Bun
Development Commands
From the repo docs:
bun install
bun dev
bun dev <directory>
bun dev serve
bun dev serve --port 8080
bun run --cwd packages/app dev
bun run --cwd packages/desktop dev
Tests should not be run from the root package:
bun test
The root package intentionally guards against that with:
do not run tests from root
Run tests and typechecks from package directories instead, for example:
bun run --cwd packages/opencode test
bun run --cwd packages/opencode typecheck
Where It Fits
I would put OpenCode in this mental model:
| Tool | Role |
|---|---|
| OpenCode | provider-flexible open-source coding agent CLI with local server/web/desktop surfaces |
| OpenAI Codex CLI | OpenAI-native local coding agent |
| Pi | TypeScript agentic coding CLI and toolkit |
| Herdr | terminal workspace manager around coding agents |
| NanoClaw | container-isolated assistant runtime |
| Graphify | code knowledge graph that can provide context to coding agents |
OpenCode is closest to Codex CLI and Pi, but with its own provider system, local app/server pieces, and desktop/web ambitions.
The honest pick:
- Pick OpenCode if you want an open-source coding agent with a local server, web surface, desktop ambitions, and provider flexibility.
- Pick Codex CLI if you want the OpenAI-native path and the reference Codex developer workflow.
- Pick Pi if you want a reusable TypeScript agent toolkit as much as a CLI.
- Add Herdr if your problem is supervising several terminal agents, not choosing one agent.
FAQ
Is OpenCode the same as OpenAI Codex?
Does OpenCode support OpenAI models?
openai, and the installed CLI successfully listed OpenAI model IDs with opencode models openai. You still need credentials and provider configuration before running real model calls.
Can I run OpenCode as a web UI?
opencode serve --hostname 127.0.0.1 --port 14096 and received the OpenCode web app shell. The default port is 4096, but it was already occupied on this machine.
Should I expose the OpenCode server publicly?
OPENCODE_SERVER_PASSWORD was not set, meaning the server was unsecured. Treat server mode as local-only until you configure authentication and understand the exposure.
Can I develop from source without Bun?
[email protected] as its package manager, and the contributor docs use bun install and bun dev. On this machine, Bun was missing, so source dev was not validated.
Comments