opencode is an open source AI coding agent (similar to CC)
Supports API from (virtually all of) providers
run
set environment
Run inside docker container as user because
- opencode will write files
- ⇒ change file permission (
rootif not configured)
- ⇒ change file permission (
- opencode will execute
- ⇒ require the same environment
For example,
docker run -it\
...\ # other options
--user=$(id -u $(whoami)):$(id -g $(whoami))\ # run as user
...\ # other optionsAnd, of course,
use tmux to keep your process running
launch
cd /path/to/project
# TUI (default)
opencode .
# localhost:8080 (phone/table)
opencode web --hostname 0.0.0.0 --port 8080commands
Only simple ones
per opencode instance
/connect/models
per repository
/initto createAGENTS.md
per session
/newfor new session/sessionsto list and switch sessions
inside session
/redo/undo/exportto markdown/compact
Mode
- Plan: cannot write
- Build: write