gitwtfhub

anomalyco/opencode

155,799TypeScriptAudience · developerComplexity · 3/5ActiveLicenseSetup · moderate

TL;DR

Open-source AI coding agent you run locally in your terminal, works with any AI provider, and gives you two modes: full-access build agent and read-only plan agent for exploring code.

Mindmap

mindmap
  root((repo))
    What it does
      AI coding agent
      Terminal interface
      Provider agnostic
      Two agent modes
    Key features
      Build agent
      Plan agent
      LSP support
      Client-server arch
    Use cases
      Real development work
      Explore codebases
      Plan changes safely
    Tech stack
      TypeScript
      Node.js
      LSP protocol
    Installation
      npm install
      Homebrew
      One-line script
    Audience
      Developers
      AI enthusiasts
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why anyone would actually build this

REASON 1

Write and modify code in your terminal with AI assistance while keeping full control over which provider you use.

REASON 2

Explore an unfamiliar codebase safely using the read-only plan agent before making any changes.

REASON 3

Run complex multi-step coding tasks and searches by invoking the internal general subagent with an at-mention.

Stack

TypeScriptNode.jsLSP

Spinning it up

Difficulty · moderate Time to first run · 30min

Requires Node.js runtime and API key configuration for an AI provider (OpenAI, Anthropic, etc.).

Use freely for any purpose including commercial, as long as you keep the copyright notice.

Wtf does this do

OpenCode is an open-source AI coding agent, a tool that lives in your terminal (and now also as a desktop app) and helps you write, change, and explore code by talking to a language model. The description calls it "the open source coding agent" and the README sub-headline calls it "the open source AI coding agent." The idea is that instead of copy-pasting code in and out of a chat window, you point the agent at your project and let it read files, edit them, and run commands on your behalf. The README lists many install paths: a one-line curl install script, the opencode-ai npm package (or bun, pnpm, yarn), Scoop and Chocolatey on Windows, Homebrew on macOS and Linux, pacman or AUR on Arch, mise, and Nix. A desktop application is available in beta for macOS (Apple Silicon and Intel), Windows, and Linux. OpenCode ships two built-in agents you switch between with the Tab key: a default "build" agent with full access for development work, and a read-only "plan" agent that denies file edits by default and asks permission before running shell commands, intended for exploring unfamiliar code or planning changes. A "general" subagent handles complex searches and multistep tasks and is invoked with @general. The FAQ contrasts OpenCode with Claude Code, highlighting that it is fully open source, not tied to one model provider (it can be used with Claude, OpenAI, Google, or local models), has opt-in LSP support, focuses on the terminal UI, and uses a client/server architecture so you could drive the agent from another client such as a mobile app. You would use this if you want a configurable, provider-agnostic coding assistant that runs locally and works in the terminal. The tech stack listed is TypeScript.

Yoink these prompts

Prompt 1
Help me set up OpenCode locally and connect it to Claude as my AI provider so I can start coding in the terminal.
Prompt 2
I want to explore a large codebase I'm unfamiliar with, show me how to use OpenCode's plan agent to read and understand the code without accidentally modifying anything.
Prompt 3
How do I switch between OpenCode's build and plan agents, and what's the difference in what each one can do?
Prompt 4
Set up OpenCode to work with a local language model instead of a cloud provider, and explain how the client-server architecture lets me use it from my phone.
View the repo → Decode another repo

← anomalyco on gitmyhub — every repo by this author, as a profile.

Don't trust strangers blindly. Verify against the repo.