Opencode
Panduan menggunakan AI API SemutSSH dengan Opencode CLI.
Instalasi Opencode
Section titled “Instalasi Opencode”# Via npmnpm install -g opencode
# Via Homebrew (macOS)brew install opencodeKonfigurasi
Section titled “Konfigurasi”Buat atau edit file konfigurasi ~/.opencode/opencode.json:
{ "$schema": "https://opencode.ai/config.json", "disabled_providers": [], "provider": { "semutssh": { "name": "Semut SSH", "npm": "@ai-sdk/openai-compatible", "models": { "claude-opus-4-6": { "name": "Opus 4.6" }, "claude-sonnet-4-6": { "name": "Sonnet 4.6" }, "gemini-3.1-pro-preview": { "name": "Gemini 3.1 Pro Preview" }, "gemini-3-flash-preview": { "name": "Gemini 3 Flash Preview" }, "glm-4.7": { "name": "GLM 4.7" }, "glm-5": { "name": "GLM 5" } }, "options": { "baseURL": "https://ai.semutssh.com", "apiKey": "your-api-key-here" } } }}atau bisa tambah API AI Key nya via opencode
Section titled “atau bisa tambah API AI Key nya via opencode”# Masuk opencodeopencode# ketika sudah masuk opencode jalankan command/connectPenggunaan
Section titled “Penggunaan”# Mulai sesi interaktifopencode
# Jalankan perintah langsungopencode "buatkan fungsi untuk validasi email"- Code generation
- Code review
- Bug fixing
- Refactoring
- Documentation