Lewati ke konten

Opencode

Panduan menggunakan AI API SemutSSH dengan Opencode CLI.

Terminal window
# Via npm
npm install -g opencode
# Via Homebrew (macOS)
brew install opencode

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”
Terminal window
# Masuk opencode
opencode
# ketika sudah masuk opencode jalankan command
/connect
Terminal window
# Mulai sesi interaktif
opencode
# Jalankan perintah langsung
opencode "buatkan fungsi untuk validasi email"
  • Code generation
  • Code review
  • Bug fixing
  • Refactoring
  • Documentation