#!/usr/bin/env bash # =========================================================================== # Stage 07: Julian's uv Python Tools — Clone & Install # Clones all custom Python tool repos (from GitHub) into ~/Development/ # and installs them via 'uv tool install' (editable mode from local path). # =========================================================================== # These are Julian's own CLI tools — the ones installed on Pop via uv. # Each has a remote on github.com/julianprester/ (or re3-work/) and a # pyproject.toml defining the package. # # Tools without a public remote (oracle, panac, skill-eval, mondada) are # noted — you'll need to push them to GitHub or copy them manually. # # Order: tools that depend on other tools should come after. Most are # independent Python packages. # =========================================================================== # Ensure uv is in PATH export PATH="$HOME/.local/bin:$PATH" # ---- Define tool repos ---- # Format: "repo_name:github_org:has_pyproject" # repo_name = directory name under ~/Development/ # github_org = GitHub org (julianprester or re3-work) # has_pyproject = true if it has pyproject.toml and should be uv-installed TOOLS=( "porridge:julianprester:true" # Zoom meeting transcriber daemon "deepis:julianprester:true" # Literature discovery CLI "pi-persist:julianprester:true" # Memory persistence (mempi, pi-overview) "panac:julianprester:true" # Pandoc wrapper CLI "gromd:julianprester:true" # Gromd tool "kannwas:julianprester:true" # Kannwas tool "tb-api:julianprester:false" # Thunderbird REST API (not a Python pkg — Firefox addon) "hotkeys:julianprester:false" # Shell scripts for Wayland hotkeys (no install needed) "ocpa-repo:julianprester:true" # OpenCode pi agent Python package ) # =========================================================================== info "Cloning & installing Julian's Python tools..." mkdir -p "$HOME/Development" # ---- Clone and install each tool ---- for tool_entry in "${TOOLS[@]}"; do IFS=':' read -r name org has_pyproject <<< "$tool_entry" target_dir="$HOME/Development/$name" if [ -d "$target_dir" ]; then ok "Repo '$name' already cloned. Pulling latest..." git -C "$target_dir" pull --ff-only 2>/dev/null || warn "Could not pull $name." else info "Cloning $org/$name..." # Try SSH first (requires SSH keys loaded from Bitwarden) GIT_TERMINAL_PROMPT=0 git clone "git@github.com:${org}/${name}.git" "$target_dir" 2>/dev/null || { # Fallback to HTTPS for public repos (no auth needed) GIT_TERMINAL_PROMPT=0 git clone "https://github.com/${org}/${name}.git" "$target_dir" 2>/dev/null || { warn "Could not clone ${org}/${name}." warn " Load SSH keys from Bitwarden first, then run:" warn " git clone git@github.com:${org}/${name}.git ~/Development/$name" warn " Or set up a GitHub token for HTTPS authentication." continue } } ok "Cloned $org/$name → $target_dir" fi # Install via uv if it has pyproject.toml if [ "$has_pyproject" = "true" ] && [ -f "$target_dir/pyproject.toml" ]; then info "Installing '$name' via uv tool..." # Try editable install from local path; fall back to non-editable uv tool install --editable "$target_dir" 2>/dev/null || \ uv tool install "$target_dir" 2>/dev/null || \ warn "uv tool install failed for '$name'. Check pyproject.toml." ok "'$name' installed via uv." fi done # ---- Verify installations ---- echo "" info "Verifying uv tool installations..." uv tool list 2>/dev/null || warn "No uv tools installed." ok "Stage 07 complete: uv tools installed."