From 15fb4ed5fdb255060d49a0831ea3227f121a357f Mon Sep 17 00:00:00 2001 From: "Mauro Rosero P." Date: Thu, 20 Mar 2025 11:56:08 -0500 Subject: [PATCH] [ADDED] Script aider_install.sh para instalar Aider CLI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 馃 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- bin/aider_install.sh | 146 ++++++++++++++++++++++++++++++++++++++++++ bin/msg/developers.es | 26 ++++++++ 2 files changed, 172 insertions(+) create mode 100755 bin/aider_install.sh diff --git a/bin/aider_install.sh b/bin/aider_install.sh new file mode 100755 index 0000000..a35b8a4 --- /dev/null +++ b/bin/aider_install.sh @@ -0,0 +1,146 @@ +#!/bin/bash +#Script : aider_install.sh +#Apps : MRDEVS TOOLS +#Description : Instalar Aider (asistente de codificaci贸n con IA) +#Author : Cortana Rosero One +#Generated by : Claude Code (claude-3-7-sonnet-20250219) +#Created : 2025/03/20 11:05:23 +#Modified : 2025/03/20 11:05:23 +#Version : 1.2.0 +#Use Notes : +#============================================================================== +# Derechos de Autor [2025] [Mauro Rosero P. ] +#============================================================================== +# Este programa es software libre: usted puede redistribuirlo y/o modificarlo +# bajo los t茅rminos de la Licencia P煤blica Affero General de GNU tal como +# lo publica la Free Software Foundation, ya sea la versi贸n 3 de la licencia, +# o (a su elecci贸n) cualquier versi贸n posterior. +# +# Este programa se distribuye con la esperanza de que sea 煤til, +# pero SIN NINGUNA GARANT脥A; sin siquiera la garant铆a impl铆cita de +# COMERCIABILIDAD o IDONEIDAD PARA UN PROP脫SITO PARTICULAR. Consulte la +# Licencia P煤blica Affero General de GNU para obtener m谩s detalles. +# +# Deber铆a haber recibido una copia de la Licencia P煤blica Affero General +# junto con este programa. Si no la recibi贸, consulte . + +# Configuraci贸n inicial +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +BIN_BASE="bin" +BIN_LIBS="lib" +BIN_MESG="msg" +BIN_CFGS="config" + +# Leer DEVSPATH desde el archivo de configuraci贸n o usar "devs" por defecto +if [ -f "$SCRIPT_DIR/$BIN_CFGS/devspath.dat" ]; then + DEVSPATH=$(cat "$SCRIPT_DIR/$BIN_CFGS/devspath.dat") +else + DEVSPATH="devs" +fi +BIN_HOME="$HOME/$DEVSPATH" +VERSION=$(cat "$BIN_HOME/$BIN_BASE/$BIN_CFGS/version") +BIN_PATH=$BIN_HOME/$BIN_BASE + +# CHECK SHELL LANGUAGE +BIN_LANG=${LANG:0:2} + +# Importar bibliotecas necesarias +source "${BIN_HOME}/${BIN_BASE}/${BIN_LIBS}/base.lib" + +# Cargar mensajes en el idioma del sistema o espa帽ol por defecto +load_messages "${BIN_HOME}/${BIN_BASE}" "${BIN_MESG}" "${BIN_LANG}" "head" +load_messages "${BIN_HOME}/${BIN_BASE}" "${BIN_MESG}" "${BIN_LANG}" "developers" + +# Variables globales +title="${head_000} ${aimsg_000}" +AIDER_VENV="$HOME/.aider-venv" + +# Funci贸n para verificar python +check_python() { + if ! command -v python3 &> /dev/null; then + echo "${aimsg_001}" + echo "${aimsg_002}" + exit 1 + fi +} + +# Funci贸n para verificar pip +check_pip() { + if ! command -v pip3 &> /dev/null; then + echo "${aimsg_003}" + echo "${aimsg_004}" + exit 1 + fi +} + +# Funci贸n para verificar virtualenv +check_venv() { + if ! python3 -c "import venv" &> /dev/null; then + echo "${aimsg_005}" + if [ -f /etc/debian_version ]; then + sudo apt-get update && sudo apt-get install -y python3-venv + elif [ -f /etc/redhat-release ]; then + sudo dnf install -y python3-venv + else + pip3 install --user virtualenv + fi + fi +} + +# Funci贸n para instalar aider +install_aider() { + echo "${aimsg_009}" + curl -LsSf https://aider.chat/install.sh | sh + + # El script de instalaci贸n de aider ya maneja la configuraci贸n y el alias +} + +# Funci贸n para desinstalar aider +uninstall_aider() { + echo "${aimsg_014}" + + # Ejecutar el desinstalador de aider si existe + if [ -f "$HOME/.local/bin/aider-uninstall" ]; then + $HOME/.local/bin/aider-uninstall + fi + + # Remover archivos de aider + rm -rf "$HOME/.aider" + rm -f "$HOME/.local/bin/aider" + rm -f "$HOME/.local/bin/aider-uninstall" + + echo "${aimsg_016}" +} + +# Funci贸n para mostrar uso +show_usage() { + echo "${aimsg_017}" + echo "${aimsg_018}" + echo "${aimsg_019}" + echo "${aimsg_020}" + echo "${aimsg_021}" +} + +# Funci贸n principal +main() { + # Verificar par谩metros + if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then + show_usage + exit 0 + elif [ "$1" = "-u" ] || [ "$1" = "--uninstall" ]; then + uninstall_aider + exit 0 + else + # Verificar requisitos + check_python + install_aider + + echo "" + echo "${aimsg_022}" + echo "${aimsg_023}" + echo "${aimsg_024}" + fi +} + +# Ejecutar funci贸n principal con los par谩metros recibidos +main "$@" \ No newline at end of file diff --git a/bin/msg/developers.es b/bin/msg/developers.es index fa9f510..c7014e9 100644 --- a/bin/msg/developers.es +++ b/bin/msg/developers.es @@ -11,6 +11,32 @@ #============================================================================== #============================================================================== +# Mensajes para aider_install.sh +aimsg_000="INSTALACI脫N DE AIDER" +aimsg_001="Error: Python 3 no est谩 instalado." +aimsg_002="Por favor, instale Python 3 antes de continuar." +aimsg_003="Error: pip3 no est谩 instalado." +aimsg_004="Por favor, instale pip3 antes de continuar." +aimsg_005="Instalando m贸dulo venv..." +aimsg_006="Creando entorno virtual para aider..." +aimsg_007="Activando entorno virtual..." +aimsg_008="Actualizando pip..." +aimsg_009="Instalando aider..." +aimsg_010="Creando alias para aider..." +aimsg_011="Alias a帽adido a .bashrc" +aimsg_012="Alias a帽adido a .zshrc" +aimsg_013="Desactivando entorno virtual..." +aimsg_014="Desinstalando aider..." +aimsg_015="Entorno virtual de aider eliminado." +aimsg_016="Aider ha sido desinstalado completamente." +aimsg_017="Uso: $0 [OPCI脫N]" +aimsg_018="Opciones:" +aimsg_019=" Sin opci贸n - Instala aider" +aimsg_020=" -u, --uninstall - Desinstala aider" +aimsg_021=" -h, --help - Muestra esta ayuda" +aimsg_022="Aider ha sido instalado correctamente." +aimsg_023="Para usar aider, ejecute 'aider' en una nueva terminal." +aimsg_024="La primera vez que lo ejecute deber谩 configurar su API key de OpenAI." gpmsg_000="INICIALIZAR GPG" gpmsg_001="RESTAURAR BACKUP DE PERFIL"