OpenCode.ai — AI Coding Agent (Open Source)

A terminal-first, model-agnostic AI agent that plans, runs shell commands, edits files, and integrates with local LSPs while prioritizing privacy.

What is OpenCode

OpenCode is an open-source, terminal-first AI coding agent that runs where developers already work: the terminal, a local web UI, or a native desktop app. Unlike inline completion tools, OpenCode can plan multi-step tasks, run shell commands, edit files programmatically, and consult local Language Server Protocol (LSP) data to improve code understanding.

Key features

Practical commands

# initialize project context (creates AGENTS.md)
opencode init

# run a one-off prompt non-interactively
opencode run --prompt "Explain the authentication flow in src/auth.ts"

# launch local web interface (headless server)
opencode web

Usage tips

Privacy & security

OpenCode emphasizes local execution and privacy. When used with BYO keys or local models, source code and prompts remain on your machine. Review permission settings before granting shell or write rights in unfamiliar repositories.

Comparison (short)

Resources


Ready to try OpenCode? Start with opencode init in a copy of your repository and keep sandboxed branches for agent-driven edits.