-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfigurarOpenCode.bash
More file actions
executable file
·71 lines (61 loc) · 1.53 KB
/
Copy pathConfigurarOpenCode.bash
File metadata and controls
executable file
·71 lines (61 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
# Instalação de pacotes no sistema
function run_as_root() {
# Instalando Docker
if ! [ "$(command -v docker)" ]; then
bash ./Install-DockerEngine.bash
fi
# Instalando Nvidia Container
bash ./Install-NvidiaContainer.bash
# Instalando Ollama
curl -fsSL https://ollama.com/install.sh | sh
}
# Executando instalação de pacotes no sistema
if [ "$(whoami)" == "root" ]; then
bash -c "$(declare -f run_as_root); run_as_root"
else
if [ "$(command -v sudo-rs)" ]; then
sudo-rs bash -c "$(declare -f run_as_root); run_as_root"
else
sudo bash -c "$(declare -f run_as_root); run_as_root"
fi
fi
# Instalando Open Code
curl -fsSL https://opencode.ai/install | bash
# Baixando modelos no Ollama
ollama serve &
ollama pull qwen3.5:latest
ollama pull deepseek-r1:latest
ollama pull mistral:latest
ollama pull gpt-oss:latest
# Garantindo que o diretório de config existe
mkdir -p "$HOME/.config/opencode"
# Configurando integração entre Ollama e Open Code
cat > "$HOME/.config/opencode/opencode.json" << 'EOF'
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"ollama": {
"npm": "@ai-sdk/openai-compatible",
"name": "Ollama",
"options": {
"baseURL": "http://localhost:11434/v1"
},
"models": {
"qwen3.5": {
"name": "qwen3.5"
},
"deepseek-r1": {
"name": "deepseek-r1"
},
"mistral": {
"name": "mistral"
},
"gpt-oss": {
"name": "gpt-oss"
}
}
}
}
}
EOF