# Aelius Code setup for opencode (https://aeliusai.com/code#opencode). # Asks for your key and writes %USERPROFILE%\.config\opencode\opencode.json. Nothing else. $key = (Read-Host "Paste your aelius_code_ key").Trim() if (-not $key.StartsWith("aelius_code_")) { Write-Host "That does not look like an Aelius Code key (it starts with aelius_code_)." -ForegroundColor Red return } $dir = Join-Path $HOME ".config\opencode" New-Item -ItemType Directory -Force $dir | Out-Null $f = Join-Path $dir "opencode.json" if (Test-Path $f) { Copy-Item $f "$f.bak" -Force; Write-Host "Old settings kept as $f.bak" } $json = @' { "$schema": "https://opencode.ai/config.json", "model": "aelius/qwen3.8-27b", "provider": { "aelius": { "models": { "qwen3.8-27b": { "attachment": true, "limit": { "context": 262144, "output": 32768 }, "modalities": { "input": [ "text", "image" ], "output": [ "text" ] }, "name": "Aelius Code", "tool_call": true } }, "name": "Aelius Code", "npm": "@ai-sdk/openai-compatible", "options": { "apiKey": "KEYHERE", "baseURL": "https://code.aeliusai.com/v1", "chunkTimeout": 300000, "headerTimeout": 900000, "timeout": false } } }, "small_model": "aelius/qwen3.8-27b" } '@ [IO.File]::WriteAllText($f, $json.Replace("KEYHERE", $key)) Write-Host "Saved. Now open opencode." -ForegroundColor Green