Files
agent-manager/install.sh
T
bruno d71c3dd34d
release / release (push) Successful in 13m21s
release / macos (push) Canceled after 0s
feat: epique v1.1.0 — onboarding, copilot & roles aichat (am setup)
F1 — Wizard d'onboarding (src/setup.rs) :
- am setup : provider (anthropic, openai, deepseek, google, ollama, custom),
  token masque (rpassword) -> keyring OS (jamais en clair), modele par defaut
  (liste declaree + champ libre), ping API non-bloquant
- Declencheurs non-bloquants : am ai / am ask et banner REPL proposent
  am setup quand aucun provider n'est configure ; re-executable (mode revoir)
- settings.default_provider + providers.* ecrits via persist_setting

F2 — Integration aichat :
- Etape wizard 'Installer le moteur IA (aichat) ? [Y/n]' -> am install aichat
- am ai sans aichat -> 'aichat est manquant. Installer ? [Y/n]'
- install.ps1/install.sh enchainent sur am setup si stdin interactif

F3 — Roles copilot aichat (src/roles.rs) :
- 6 agents generes dans ~/.config/aichat/agents (ou %APPDATA%\aichat\agents) :
  am-copilot, am-operator, am-dev, am-do, am-analyst, am-orchestrator
- Prompts bilingues (FR defaut) privilegiant les contrats --json ; le prompt
  am-copilot embarque la liste des commandes am
- am ai --role <nom> (valide le fichier genere, passe --agent a aichat),
  completion REPL ; config aichat creee seulement si absente
- Câblage complet : cli, dispatch, help, REPL, tip, man (am-setup.1), i18n

Tests : 450 verts (roles + setup unitaires, ai_test ajustes locale-agnostic)
v1.1.0 ; ROADMAP axe 14 + maintenance note ; README Premier lancement
2026-08-20 23:09:21 -04:00

107 lines
3.5 KiB
Bash

#!/bin/sh
# agent-manager (am) — installateur Linux / macOS / WSL
#
# One-liner :
# curl -fsSL https://git.dracodev.net/Projets/agent-manager/raw/branch/main/install.sh | sh
#
# Télécharge le binaire de la dernière release Gitea ; à défaut, compile via
# cargo install --git. Relancez le script pour mettre à jour.
set -eu
BASE_URL="${AM_BASE_URL:-https://git.dracodev.net/Projets/agent-manager}"
API_URL="${AM_API_URL:-https://git.dracodev.net/api/v1/repos/Projets/agent-manager}"
INSTALL_DIR="${AM_INSTALL_DIR:-$HOME/.local/bin}"
GIT_URL="$BASE_URL.git"
fail() { echo "erreur: $1" >&2; exit 1; }
arch=$(uname -m)
case "$arch" in
x86_64|amd64) arch="x86_64" ;;
aarch64|arm64) arch="aarch64" ;;
*) fail "architecture non supportée: $arch" ;;
esac
os=$(uname -s | tr '[:upper:]' '[:lower:]')
case "$os" in
linux) platform="linux" ;;
darwin) platform="macos" ;;
*) fail "système non supporté: $os" ;;
esac
install_from_source() {
if ! command -v cargo >/dev/null 2>&1; then
fail "pas de binaire précompilé pour $arch et cargo est absent — installez Rust (https://rustup.rs) puis relancez"
fi
echo "Installation depuis les sources (cargo install --git $GIT_URL)…"
cargo install --git "$GIT_URL" --locked
echo ""
echo "OK — am est installé dans ~/.cargo/bin/am"
echo "Essayez : am list | am doctor (mise à jour : relancez ce script)"
exit 0
}
tmpdir=$(mktemp -d)
trap 'rm -rf "$tmpdir"' EXIT
tag=""
if command -v curl >/dev/null 2>&1; then
release=$(curl -fsSL --connect-timeout 15 "$API_URL/releases/latest" 2>/dev/null || true)
tag=$(printf '%s' "$release" | grep -o '"tag_name"[[:space:]]*:[[:space:]]*"[^"]*"' | head -n 1 | cut -d'"' -f4)
fi
installed=""
if [ -n "$tag" ] && command -v curl >/dev/null 2>&1; then
asset="am-$platform-$arch.tar.gz"
url="$BASE_URL/releases/download/$tag/$asset"
echo "Téléchargement de $url …"
if curl -fsSL --connect-timeout 20 -o "$tmpdir/am.tar.gz" "$url"; then
tar -xzf "$tmpdir/am.tar.gz" -C "$tmpdir" 2>/dev/null || true
# L'entrée de l'archive varie selon le pipeline CI : « am » ou
# « am-linux-x86_64 » (nom de la release). Prendre le premier fichier
# extrait.
bin=""
for cand in "$tmpdir/am" "$tmpdir/am-$platform-$arch" "$tmpdir/am-$arch" "$tmpdir"/*; do
if [ -f "$cand" ] && [ -z "$bin" ]; then
bin="$cand"
fi
done
if [ -n "$bin" ]; then
mkdir -p "$INSTALL_DIR"
cp "$bin" "$INSTALL_DIR/am"
chmod +x "$INSTALL_DIR/am"
installed=1
fi
fi
fi
if [ -z "$installed" ]; then
echo "Binaire précompilé indisponible — installation depuis les sources…"
install_from_source
fi
case ":$PATH:" in
*":$INSTALL_DIR:"*) ;;
*)
echo "Astuce : $INSTALL_DIR n'est pas dans votre PATH"
if [ -f "$HOME/.profile" ] && ! grep -qF "$INSTALL_DIR" "$HOME/.profile"; then
echo "export PATH="$INSTALL_DIR:\$PATH"" >> "$HOME/.profile"
echo "Ajouté à ~/.profile (reconnectez-vous pour en profiter)"
fi
;;
esac
"$INSTALL_DIR/am" --version || true
echo ""
# Épique v1.1.0 : wizard d'onboarding (provider + token + aichat + rôles)
# uniquement quand stdin est un terminal interactif (pas en CI).
if [ -t 0 ]; then
echo "Configuration initiale (provider, token, aichat) :"
"$INSTALL_DIR/am" setup
fi
echo ""
echo "OK — 'am' est installé. Essayez :"
echo " am list"
echo " am doctor"
echo "Mise à jour : relancez ce script."