diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..0274012 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,33 @@ +# MRDevs Tools Development Guide + +## Build & Installation Commands +- `bin/bootstrap.sh` - Install basic tools and container management +- `bin/update.sh` - Update development environment +- `bin/cortana_install.sh` - Install Claude Code CLI +- `bin/cortana_install.sh -u` - Uninstall Claude Code CLI + +## Code Style Guidelines +- **Shell Scripts**: + - Add license header with copyright info (AGPL) + - Include Modified date in comments + - Use functions for modularity + - Follow consistent variable naming (`UPPERCASE` for constants) + - Document function purpose with comments + - Include usage examples in script headers + - Handle errors with proper exit codes + +## Development Practices +- Use `bin/lib/base.lib` for common functions +- Message files stored in `bin/msg/` (multilingual support) +- Configuration in `bin/config/` directory +- Use git commit messages with prefixes: [ADDED], [IMPROVED], [FIXED], [SOPS] +- Prefer podman over docker for container management + +## Authorship Policy +- For new projects created by Claude Code, use author: "Cortana Rosero One " +- Include reference indicating generation by Claude Code and the version used +- Example header comment: + ``` + # [Author] Cortana Rosero One + # [Generated] Created by Claude Code (claude-3-7-sonnet-20250219) + ``` \ No newline at end of file diff --git a/fjcli_install.sh b/fjcli_install.sh new file mode 100755 index 0000000..d65f9a7 --- /dev/null +++ b/fjcli_install.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# ------------------------------------------------------------------ +# [Author] Cortana Rosero One +# [Title] fjcli_install.sh - Instalador de forgejo-cli +# [Generated] Created by Claude Code (claude-3-7-sonnet-20250219) +# +# AGPL License +# Modified date: 14/03/2025 +# ------------------------------------------------------------------ + +# Función para verificar si cargo está instalado +check_cargo() { + if ! command -v cargo &> /dev/null; then + echo "Cargo no está instalado. Instalando Rust y Cargo..." + curl https://sh.rustup.rs -sSf | sh + source "$HOME/.cargo/env" + echo "Rust y Cargo han sido instalados correctamente." + else + echo "Cargo ya está instalado." + fi +} + +# Función para verificar si codeberg-cli está instalado +check_codeberg_cli() { + if ! command -v codeberg &> /dev/null; then + echo "codeberg-cli no está instalado. Instalando..." + + # Verificar que cargo esté disponible + if ! command -v cargo &> /dev/null; then + echo "ERROR: No se pudo encontrar cargo en el PATH después de la instalación." + echo "Por favor reinicie su terminal e intente nuevamente." + exit 1 + fi + + # Instalar codeberg-cli + cargo install codeberg-cli + + if [ $? -eq 0 ]; then + echo "codeberg-cli instalado correctamente." + else + echo "ERROR: No se pudo instalar codeberg-cli." + exit 1 + fi + else + echo "codeberg-cli ya está instalado." + fi +} + +# Verificar si cargo está instalado +check_cargo + +echo "Preparando instalación de forgejo-cli..." + +# Instalar codeberg-cli si no está instalado +check_codeberg_cli + +echo "Instalación completada." + +exit 0 \ No newline at end of file