Developer-first CLI agent (open source) dengan subagent explorer dan multimodal. Berbicara ke gateway via provider custom @opencode/ai/providers/openai-compatible. Satu file opencode.json(c) mengatur credential + endpoint + model aktif sekaligus.
1
Install (pilih salah satu)
Recommended: curl -fsSL https://opencode.ai/install | bash (macOS/Linux/WSL — menginstal OpenCode v1). Alternatif: npm install -g @opencode/cli (postinstall memilih binary native per platform), brew install anomalyco/tap/opencode, atau download binary per-OS dari opencode.ai. Perintah lama npm install -g opencode-cli SUDAH TIDAK ADA (404 di npm registry). Verifikasi: opencode --version.
2
Buat API key
Buka halaman /keys di portal → buat key baru → salin (format edw-live-...). Satu key per device.
3
Tulis config
Simpan blok opencode.json di bawah ke ~/.config/opencode/opencode.json (Windows: %USERPROFILE%\.config\opencode\opencode.json; boleh juga .jsonc bila butuh komentar). Ikuti format resmi: root key providers (plural), credential via env + apiKey literal, runtime via package, endpoint via settings.baseURL. Ganti edw-live-ISI_KEY_KAMU dengan key milikmu.
4
Jalankan
opencode — model aktif langsung edworks/claude-opus-5.5.
5
Tes koneksi gagal?
curl base URL /models dulu (lihat Tes koneksi). Kalau curl 200 tapi opencode error auth — pastikan field-nya settings.baseURL (bukan baseUrl) dan key tanpa spasi/quotes. Catatan: contoh lama ber-root-key provider (singular) + npm/options = format pra-rilis, tidak cocok dengan schema resmi ($schema https://opencode.ai/config.json).
Model default claude-opus-5.5 (flagship coding, tier S+). Variabel EDWORKS_API_KEY didefinisikan agar contoh sesuai schema resmi (env = daftar nama variabel), tapi gateway juga menerima key literal di settings.apiKey seperti contoh di atas.
Contoh ini ditulis untuk OpenCode v1 (installer https://opencode.ai/install). OpenCode v2 tersedia via https://opencode.ai/v2/install; config v1 yang valid tetap dibaca v2 (kompatibel), hanya plugin/server-API yang breaking. Contoh juga menghapus blok agent.explorer fiktif — atur subagent lewat file agents di folder .opencode bila perlu.