Gebruikershulpmiddelen

Site-hulpmiddelen


installatie_handleidingen:openclode

Verschillen

Dit geeft de verschillen weer tussen de geselecteerde revisie en de huidige revisie van de pagina.

Link naar deze vergelijking

Beide kanten vorige revisie Vorige revisie
Volgende revisie
Vorige revisie
installatie_handleidingen:openclode [2026/03/25 11:42]
abel [Software installation]
installatie_handleidingen:openclode [2026/03/31 10:56] (huidige)
abel [start opencode manually]
Regel 2: Regel 2:
  
 ===== Software installation ===== ===== Software installation =====
 +==== install npm installer ====
  
-Install with the bash script from the opencode website:+The best result is acchieved with an install through npm. install npm:
 <code> <code>
-curl -fsSL https://opencode.ai/install | bash+sudo apt update 
 +apt install npm 
 +</code> 
 + 
 +==== install opencode ==== 
 + 
 +<code> 
 +npm install -g opencode-ai
 </code> </code>
  
Regel 16: Regel 24:
  
  
-The install script from the opencode repository has a fixed location for the binary located in the users homedirectory together with the user settings. changing this would involve ajusting the script at: 
-<code> 
-... 
  
-INSTALL_DIR=$HOME/.opencode/bin +===== run the opencode application =====
-mkdir -p "$INSTALL_DIR"+
  
-... +==== start opencode manually ==== 
-</code> + 
-===== Auto-Start at Boot time ===== +''%%/home/abel/.opencode/bin/opencode --port 4096 --hostname 0.0.0.0%%'' 
-==== Create a systemd Service File ====+ 
 +==== Auto-Start at Boot time ==== 
 + 
 +Create a systemd Service File
 ''sudo vi /etc/systemd/system/opencode.service''\\ ''sudo vi /etc/systemd/system/opencode.service''\\
 add: add:
Regel 37: Regel 44:
 Type=simple Type=simple
 User=abel User=abel
-WorkingDirectory=%h/opencode/projects +ProtectHome=false 
-ExecStart=/usr/local/bin/opencode web --port 4096 --hostname 0.0.0.0+WorkingDirectory=/home/abel/opencode/projects 
 +ExecStart=/home/abel/.opencode/bin/opencode web --port 4096 --hostname 0.0.0.0
 Restart=always Restart=always
 RestartSec=10 RestartSec=10
Regel 48: Regel 56:
 ''User=abel'' seems unsafe but that is how it works, and seeing as it is on the personal workstation any sequrity risk is minimal. ''User=abel'' seems unsafe but that is how it works, and seeing as it is on the personal workstation any sequrity risk is minimal.
  
-==== start and enable ==== 
  
 Start and enable opencode by: Start and enable opencode by:
Regel 55: Regel 62:
 </code> </code>
  
 +===== configuration =====
 +This systemd unit started a web interface on http://localhost:4096/
 +
 +==== connection to an AI ====
 +
 +edit the configuration file:  ''vi ~/.config/opencode/opencode.json''
 +
 +and fill it with:
 +<code>
 +{
 +  "$schema": "https://opencode.ai/config.json",
 +  "provider": {
 +    "ollama": {
 +      "npm": "@ai-sdk/openai-compatible",
 +      "name": "Ollama (local)",
 +      "options": {
 +        "baseURL": "http://10.100.10.50:11434/v1"
 +      },
 +      "models": {
 +        "gurubot/GLM-4.6V-Flash-GGUF:Q4_K_M": {
 +          "name": "GLM-4.6V Flash"
 +        }
 +      }
 +    }
 +  }
 +}
 +
 +</code>
 +===== Connect tools =====
 +
 +there is also a VSCodium plugin. how to set this up you can find [[werkinstructies:vscodium_opencode|here]].
  
installatie_handleidingen/openclode.1774435373.txt.gz · Laatst gewijzigd: 2026/03/25 11:42 door abel