#!/bin/bash # install.sh — Installation manuelle de Konan (sans Docker) set -e echo "=== Installation de Konan ===" # 1. Dependances systeme echo "[1/5] Installation des dependances systeme..." sudo apt-get update -q sudo apt-get install -y ffmpeg libportaudio2 git wget python3 python3-venv alsa-utils # 2. Environnement Python echo "[2/5] Creation de l'environnement Python..." python3 -m venv ~/agent/venv ~/agent/venv/bin/pip install --upgrade pip -q ~/agent/venv/bin/pip install -r requirements.txt -q # 3. Voix Piper (masculine francaise) echo "[3/5] Telechargement de la voix Piper (fr_FR-tom-medium)..." mkdir -p ~/agent/voices BASE_URL="https://huggingface.co/rhasspy/piper-voices/resolve/main/fr/fr_FR/tom/medium" wget -q --show-progress -O ~/agent/voices/fr_FR-tom-medium.onnx "$BASE_URL/fr_FR-tom-medium.onnx" wget -q -O ~/agent/voices/fr_FR-tom-medium.onnx.json "$BASE_URL/fr_FR-tom-medium.onnx.json" # 4. Ollama echo "[4/5] Installation de Ollama..." if ! command -v ollama &> /dev/null; then curl -fsSL https://ollama.ai/install.sh | sh fi echo "Telechargement des modeles LLM (peut prendre plusieurs minutes)..." ollama pull qwen2.5:3b ollama pull qwen2.5-coder:3b # 5. Service systemd echo "[5/5] Configuration du service systemd..." sudo tee /etc/systemd/system/agent-bot.service > /dev/null << EOF [Unit] Description=Konan AI Assistant After=network.target ollama.service [Service] Type=simple User=$USER WorkingDirectory=$HOME/agent ExecStart=$HOME/agent/venv/bin/python3 $HOME/agent/bot.py Restart=always RestartSec=10 StandardOutput=journal StandardError=journal [Install] WantedBy=multi-user.target EOF sudo systemctl daemon-reload sudo systemctl enable agent-bot sudo systemctl start agent-bot echo "" echo "=== Konan installe avec succes ! ===" echo "" echo "Commandes utiles :" echo " sudo systemctl status agent-bot # etat du bot" echo " journalctl -u agent-bot -f # logs en direct" echo " python3 ~/agent/konan_voice.py # interface vocale" echo "" echo "N'oublie pas de copier tes fichiers :" echo " - google_credentials.json -> ~/agent/" echo " - google_token.json -> ~/agent/ (si deja authentifie)"