Files
linux-provisioning/stages/07-uv-projects.sh
Julian Prester 3c6ca17a8b Redact personal data before publishing as public repo
- config/git/gitconfig: replace real name, email, SSH signing key, and
  self-hosted git credential URL with placeholder values

- stages/06-scripts.sh: remove hardcoded personal email from bw login;
  CLI prompts interactively

- config/shell/zshrc.local.example: replace personal server URLs
  (Nextcloud, LiteLLM proxy), university email address, institution-
  specific Canvas LMS URL, and identifying Canvas key prefix with
  generic example.com placeholders

- TODO.md: replace personal email and Nextcloud URL in code examples
  with generic placeholders

- stages/07-uv-projects.sh: remove private org name from comment
2026-06-07 15:20:56 +10:00

85 lines
3.6 KiB
Bash
Executable File

#!/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/ 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 or username
# 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."