diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfa8698 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +# Enforce LF for shell scripts and text files +*.sh text eol=lf +*.ps1 text eol=lf +*.md text eol=lf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a849090 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,63 @@ +name: CI + +on: + push: + pull_request: + +jobs: + shellcheck: + name: Shellcheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install shellcheck + run: sudo apt-get update && sudo apt-get install -y shellcheck + - name: Run shellcheck on shell scripts + run: | + files=$(git ls-files '*.sh' || true) + if [ -z "$files" ]; then + echo "No shell scripts to check" + exit 0 + fi + echo "$files" + shellcheck $files + + syntax: + name: Syntax & EOL checks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Fail on CRLF in scripts + run: | + CRLF_FILES=$(git ls-files '*.sh' | xargs -r grep -Il $'\r' || true) + if [ -n "$CRLF_FILES" ]; then + echo "CRLF found in the following files:"; echo "$CRLF_FILES"; + exit 1 + fi + echo "No CRLF in shell scripts" + - name: Bash syntax-check + run: | + for f in $(git ls-files '*.sh'); do + echo "Checking $f"; + bash -n "$f"; + done + + preview-runner: + name: Preview installer scripts + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Bash syntax-check run_installers + run: bash -n run_installers.sh + - name: Preview run_installers (safe) + run: ./run_installers.sh --preview + + windows-preview: + name: PowerShell preview + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - name: Preview PowerShell wrapper + shell: pwsh + run: | + ./run_installers.ps1 -Preview diff --git a/README_INSTALL.md b/README_INSTALL.md new file mode 100644 index 0000000..728a700 --- /dev/null +++ b/README_INSTALL.md @@ -0,0 +1,46 @@ +Installation guide — learning_ai_devops_tools + +Purpose + +This repository contains interactive, safe installers and helpers to install CLI tools (Claude Code, OpenAI Codex, Antigravity agy, Devin, GitHub Copilot) on WSL/Ubuntu, macOS, and Windows. + +Files of interest + +- install_clis_wsl.sh — interactive WSL installer (WSL/Ubuntu). Preview and confirm before running remote installers. +- make_symlinks_wsl.sh — creates /usr/local/bin symlinks (requires sudo) +- run_installers.sh — cross-platform wrapper to run installers from WSL or show instructions +- run_installers.ps1 — Windows PowerShell wrapper to run WSL or show Windows-native steps +- cli-install-report.md — generated report of installs (example) + +Quick start (WSL/Ubuntu) + +1. Open WSL (Ubuntu) shell. +2. cd /mnt/d/SANDBOX/mygh/learning_ai_devops_tools +3. Ensure scripts use LF and are executable: + sudo apt-get update && sudo apt-get install -y dos2unix + dos2unix install_clis_wsl.sh run_installers.sh make_symlinks_wsl.sh || true + chmod +x install_clis_wsl.sh run_installers.sh make_symlinks_wsl.sh +4. Run the interactive installer (will preview each remote installer and ask confirmation): + bash -i ./install_clis_wsl.sh + +Quick start (Windows PowerShell with WSL) + +- From PowerShell run (recommended): + wsl bash -ic "cd /mnt/d/SANDBOX/mygh/learning_ai_devops_tools && dos2unix install_clis_wsl.sh || true && bash -i ./install_clis_wsl.sh" + +Quick start (macOS) + +- Inspect installers first. macOS support is similar to Linux; use the run_installers.sh wrapper to list commands. Do NOT pipe unknown scripts to shell without review. + +Security and safety + +- All remote installers are previewed before execution. +- No secrets or API keys are written to shell profiles. +- Auth steps are left interactive (use the tool's login commands). + +Developer notes + +- Use .gitattributes to enforce LF endings on shell scripts across platforms. +- To reproduce: run the scripts from a fresh WSL Ubuntu session and follow interactive prompts. + +If you want, run './run_installers.sh' to get an interactive cross-platform flow. diff --git a/run_installers.ps1 b/run_installers.ps1 new file mode 100644 index 0000000..ac4a774 --- /dev/null +++ b/run_installers.ps1 @@ -0,0 +1,16 @@ +<# +PowerShell wrapper to launch the WSL installer or show platform-specific instructions. +Usage: .\run_installers.ps1 [-Preview] +#> +param([switch]$Preview) + +Write-Host "Running cross-platform installer helper" +if (Get-Command wsl -ErrorAction SilentlyContinue) { + if ($Preview) { + wsl bash -lc 'sed -n "1,120p" /mnt/d/SANDBOX/mygh/learning_ai_devops_tools/install_clis_wsl.sh' + } else { + wsl bash -ic "cd /mnt/d/SANDBOX/mygh/learning_ai_devops_tools && bash -i ./install_clis_wsl.sh" + } +} else { + Write-Host "WSL not found. Please run manually on the target platform according to README_INSTALL.md" +} diff --git a/run_installers.sh b/run_installers.sh new file mode 100644 index 0000000..46e1e98 --- /dev/null +++ b/run_installers.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Cross-platform wrapper to run installers or show instructions. +# Usage: ./run_installers.sh [--preview] + +PREVIEW=0 +if [ "${1:-}" = "--preview" ]; then PREVIEW=1; fi + +is_wsl() { + grep -qi microsoft /proc/version 2>/dev/null || grep -qi microsoft /proc/sys/kernel/osrelease 2>/dev/null +} + +echo "Cross-platform installer helper" +if is_wsl; then + echo "Detected WSL/Ubuntu environment." + if [ "$PREVIEW" -eq 1 ]; then + echo "Preview mode: showing installers to be executed by install_clis_wsl.sh" + sed -n '1,120p' install_clis_wsl.sh + exit 0 + fi + read -rp "Run the interactive WSL installer (install_clis_wsl.sh)? [y/N]: " ans + case "$ans" in + [Yy]*) bash -i ./install_clis_wsl.sh ;; + *) echo "Cancelled by user."; exit 0 ;; + esac +else + echo "Not in WSL. Recommended flows:" + echo "- Run this from Windows PowerShell using WSL: wsl bash -ic 'cd /mnt/d/SANDBOX/mygh/learning_ai_devops_tools && bash -i ./install_clis_wsl.sh'" + echo "- On macOS or Linux, inspect install_clis_wsl.sh and run it in a bash login shell after review." + exit 0 +fi