Opencode di Windows

Dari Dokumentasi Robie
Revisi sejak 2 November 2026 01.52 oleh Robie (bicara | kontrib)
Loncat ke navigasi Loncat ke pencarian

Sebelum menginstall opencode, jika menggunakan windows, kita butuh menginstall alat bantu berupa wsl. langkah-langkah menginstall wsl sebagai berikut:

Install wsl di cmd windows dengan perintah :

wsl --install lalu tekan enter

Install-wsl-windows.png


Microsoft Windows [Version 10.0.19045.3324]
(c) Microsoft Corporation. All rights reserved.
C:\Users\SMEKTA>wsl --install
Installing: Virtual Machine Platform
Virtual Machine Platform has been installed.
Installing: Windows Subsystem for Linux
Windows Subsystem for Linux has been installed.
Installing: Windows Subsystem for Linux
Windows Subsystem for Linux has been installed.
Installing: Ubuntu
Ubuntu has been installed.
The requested operation is successful. Changes will not be effective until the system is rebooted.

C:\Users\SMEKTA>

Selanjutnya jalankan perintah :

wsl.exe --install --no-distribution lalu tekan enter


wsl.exe --install --no-distribution
Installing Windows optional component: Microsoft-Windows-Subsystem-Linux
Deployment Image Servicing and Management tool
Version: 10.0.19041.844
Image Version: 10.0.19045.3324
Enabling feature(s)
[==========================100.0%==========================]
The operation completed successfully.
Installing Windows optional component: VirtualMachinePlatform
Deployment Image Servicing and Management tool
Version: 10.0.19041.844
Image Version: 10.0.19045.3324
Enabling feature(s)
[==========================100.0%==========================]
The operation completed successfully.
The requested operation is successful. Changes will not be effective until the system is rebooted.

C:\Users\SMEKTA>
Install-wsl-windows-2.png


Setelah proses selesai lakukan restart pc/laptop.

kemudian akan muncul proses download dan install ubuntu

Proses-install.png

tunggu proses hingga memasukkan username dan password untuk login ke termnal ubuntu seperti ini

Memasukkan-username-password.png

jika salah password akan diulangi lagi. lalu jika berhasil maka akan muncul tampilan seperti ini

Hasil-install-wsl.png
Tampilan-lain-hasil-wsl.png

lalu ketikan perintah berikut untuk menginstall opencode :

curl -fsSL https://opencode.ai/v2/install | bash

tunggu prosesnya hingga selesai

Install-opencode-wsl.png

untuk menjalankan opencode, silakan ketik exit lalu tekan enter dulu. kemudian masuk kembali dengan mengetikkan perintah wsl lalu enter

Masuk-ke-opencode.png

setelah mengetikkan opencode lalu tekan tombol enter, akan muncul seperti ini.

Finish-opencode-windows.png

sampai sini artinya opencode sudah berhasil terinstall di windows dengan baik.