Audit and optimize for CapableMind development

Brewfile: stripped to essential tools (~600MB freed), removed boost,
cmake, aerc, newsboat, fontforge, starship, and 24 auto-dependencies.
Added caffeine, ollama, fastfetch, ocrmypdf, tea, sshpass, vitetris.
Dropped 1password, iterm2, github-desktop, hazel, swiftbar, oversight.

Shell: fixed all stale references (fzf, zoxide, starship, old paths,
Homebrew node aliases). Updated project paths to ~/_Dev/. Added
CapableMind aliases (cm, bmf, bmf-health, bmf-status, bmf-logs).

Configs: removed iterm2, neofetch, swiftbar configs. Added capablemind
(launchd plists, MCP example, bmf-start script). Updated SSH config
with git.skemantix.com. Added CLAUDE.md to dotfiles.

Scripts: consolidated 3 backup scripts into 1 (backup-all-secrets.sh),
added pass store backup. Added setup-capablemind.sh for full environment
reconstruction. Updated symlinks.sh for new config structure.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
David F Glidden
2026-03-20 23:45:33 +01:00
co-authored by Claude Opus 4.6
parent e7bb361bd2
commit 066a47a26b
72 changed files with 785 additions and 2032 deletions
-1
View File
@@ -1 +0,0 @@
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
-7
View File
@@ -1,7 +0,0 @@
# Setup fzf
# ---------
if [[ ! "$PATH" == */Users/davidglidden/.fzf/bin* ]]; then
PATH="${PATH:+${PATH}:}/Users/davidglidden/.fzf/bin"
fi
eval "$(fzf --bash)"
-7
View File
@@ -1,7 +0,0 @@
# Setup fzf
# ---------
if [[ ! "$PATH" == */Users/davidglidden/.fzf/bin* ]]; then
PATH="${PATH:+${PATH}:}/Users/davidglidden/.fzf/bin"
fi
source <(fzf --zsh)
-2
View File
@@ -12,8 +12,6 @@ chisui/zsh-nix-shell # If using Nix at some point
# Git integration
olivierverdier/zsh-git-prompt # Lightweight git aliases/completions
# FZF integration (optional, only if you use fzf)
unixorn/fzf-zsh-plugin
# Completions (optional, only if you reinstall these tools)
# mullvad/mullvad-zsh-completions
-2
View File
@@ -12,8 +12,6 @@ chisui/zsh-nix-shell # If using Nix at some point
# Git integration
olivierverdier/zsh-git-prompt # Lightweight git aliases/completions
# FZF integration (optional, only if you use fzf)
unixorn/fzf-zsh-plugin
# Completions (optional, only if you reinstall these tools)
# mullvad/mullvad-zsh-completions
+9 -12
View File
@@ -114,20 +114,17 @@ zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*'
# TOOL INTEGRATIONS
# ═══════════════════════════════════════════════════════════════════════════════
# FZF integration
if [[ -f ~/.fzf.zsh ]]; then
source ~/.fzf.zsh
elif command -v fzf >/dev/null; then
# Manual key bindings if fzf is available but not set up
eval "$(fzf --zsh)" 2>/dev/null || true
fi
# (fzf and zoxide removed — not installed)
# Zoxide integration (smart cd)
if command -v zoxide >/dev/null; then
eval "$(zoxide init zsh)"
fi
# ═══════════════════════════════════════════════════════════════════════════════
# GNU COREUTILS (interactive-only PATH)
# ═══════════════════════════════════════════════════════════════════════════════
# Add this section to your .zshrc after the tool integrations section
# Prevent GMP and other formulae from breaking by keeping gnubin off build PATH.
# Only activate in interactive shells.
if [[ $- == *i* ]]; then
export PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"
fi
# ═══════════════════════════════════════════════════════════════════════════════
# NODE VERSION MANAGEMENT
+16 -14
View File
@@ -4,7 +4,7 @@
alias gs='git status'
alias kaicd='cd ~/Vault/08. Notes/Children/Kai'
alias kaicd='cd "$VAULT_PATH/08. Notes/Children/02. Kai"'
## II. File checksum verification ##
alias verify1='openssl sha1'
@@ -76,20 +76,16 @@ alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resource
# Access quicklook from terminal
alias ql="qlmanage -p "
## Animal Rationis Capax
# work session
alias arc="cd /Users/davidglidden/Documents/GitHub/davidglidden.github.io && claude 'Context initialization:
Please read these files in order:
1. CLAUDE.md - Project instructions and workflow triggers
2. docs/internal/collaboration-protocol.md - Our working relationship
3. docs/internal/project-memory.md - Complete development history
4. docs/chamber/workflow/MODE-1-UNIFIED.md - Current Chamber operations
5. docs/style-guide.md - Editorial guidelines and notation system
## CapableMind
alias cm="cd ~/_Dev/CapableMind-AI"
alias bmf="cd ~/_Dev/BetterMemories.io"
alias bmf-health="curl -s http://localhost:3011/health | python3 -m json.tool"
alias bmf-status="curl -s http://localhost:3011/health | python3 -c \"import sys,json;d=json.load(sys.stdin);cursors={k:v['cursor_position'] for k,v in d['modules'].items()};errors={k:v['error_count'] for k,v in d['modules'].items() if v['error_count']>0};print(f'Vector: {cursors[\\\"vector\\\"]} errors={d[\\\"modules\\\"][\\\"vector\\\"][\\\"error_count\\\"]}');print(f'Max cursor: {max(cursors.values())}');errors and print(f'Errors: {errors}')\""
alias bmf-logs="tail -50 ~/.capablemind/logs/bmf.stderr.log"
alias bmf-errors="grep -i 'error\|deferred\|circuit\|canary\|phase' ~/.capablemind/logs/bmf.stderr.log | tail -20"
After reading, confirm you understand the current state and are ready for today'\''s work.'"
# glimpse processing
alias glimpse='cd ~/animal-davidglidden-eu/tools/glimpse-processing && source venv/bin/activate && python glimpse_tool.py'
## Animal Rationis Capax
alias arc="cd ~/_Dev/animal-davidglidden-eu"
## Tetris
alias tetris='/opt/homebrew/opt/vitetris/bin/tetris'
@@ -97,3 +93,9 @@ alias tetris='/opt/homebrew/opt/vitetris/bin/tetris'
## Pass license management shortcuts
alias licenses='pass ls licenses/'
alias license='pass show licenses/'
## Obsidian Vault push to Gitea
alias gitvault='~/bin/obsidian_vault_sync.sh'
+7 -3
View File
@@ -25,8 +25,10 @@ export XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
# 📚 Vault and workspace paths
export VAULT_PATH="$HOME/Library/Mobile Documents/iCloud~md~obsidian/Documents/David, root-and-branch"
export CHAMBER_PATH="$HOME/animal-davidglidden-eu"
export WORK_PATH="$HOME/Documents/GitHub/davidglidden.github.io"
export CHAMBER_PATH="$HOME/_Dev/chamber-library"
export ARC_PATH="$HOME/_Dev/animal-davidglidden-eu"
export CAPABLEMIND_PATH="$HOME/_Dev/CapableMind-AI"
export BMF_PATH="$HOME/_Dev/BetterMemories.io"
export DOTFILES_PATH="$HOME/dotfiles"
# 🔧 Tool configurations
@@ -55,7 +57,9 @@ export GPG_TTY=$(tty)
# 🚀 Development context detection
detect_context() {
case "$PWD" in
"$WORK_PATH"*) export CURRENT_CONTEXT="work" ;;
"$BMF_PATH"*) export CURRENT_CONTEXT="capablemind" ;;
"$CAPABLEMIND_PATH"*) export CURRENT_CONTEXT="capablemind" ;;
"$ARC_PATH"*) export CURRENT_CONTEXT="arc" ;;
"$CHAMBER_PATH"*) export CURRENT_CONTEXT="chamber" ;;
"$VAULT_PATH"*) export CURRENT_CONTEXT="vault" ;;
"$DOTFILES_PATH"*) export CURRENT_CONTEXT="dotfiles" ;;
+130 -88
View File
@@ -20,7 +20,7 @@ wttr() {
}
## III. Updates (system, brew, etc) #######################
## Description: Performs system updates, Homebrew cleanup, fzf refresh, moon phase logging, and dotfile sync ###########################
## Description: Performs system updates, Homebrew cleanup, moon phase logging, and dotfile sync ###########################
function sysupdate() {
local start_time=$(date +%s)
@@ -58,10 +58,7 @@ function sysupdate() {
echo "⚠️ mas not installed - install with: brew install mas"
fi
echo "🔄 Refreshing fzf..."
if [ -d ~/.fzf ]; then
cd ~/.fzf && git pull && ./install --all && cd -
fi
# fzf removed — no longer installed
# Fix Zsh completion security warnings
echo "🔒 Checking Zsh completion security..."
@@ -101,11 +98,11 @@ function sysupdate() {
echo "🌙 Moon phase tracking disabled (missing curl or jq)"
fi
if [ -d "$HOME/.dotfiles" ]; then
if [ -d "$HOME/dotfiles" ]; then
echo "📝 Committing dotfile changes..."
cd ~/.dotfiles || return
cd ~/dotfiles || return
git add . && git commit -m "🔧 Auto-commit from sysupdate on $(date '+%Y-%m-%d %H:%M')" && git push
brew bundle dump --force --file="$HOME/.dotfiles/Brewfile"
brew bundle dump --force --file="$HOME/dotfiles/Brewfile"
cd - >/dev/null || return
fi
@@ -129,96 +126,76 @@ function quietupdate() {
sudo -vn 2>/dev/null || sudo -v
sudo softwareupdate -i -a >/dev/null
brew update >/dev/null && brew upgrade >/dev/null && brew cleanup >/dev/null && brew autoremove >/dev/null
[ -d ~/.fzf ] && cd ~/.fzf && git pull >/dev/null && ./install --all >/dev/null && cd - >/dev/null
[ -d "$HOME/.dotfiles" ] && cd ~/.dotfiles && git add . && git commit -m "auto sysupdate" && git push && brew bundle dump --force --file="$HOME/.dotfiles/Brewfile" && cd - >/dev/null
[ -d "$HOME/dotfiles" ] && cd ~/dotfiles && git add . && git commit -m "auto sysupdate" && git push && brew bundle dump --force --file="$HOME/dotfiles/Brewfile" && cd - >/dev/null
if [ -x "$HOME/.zsh/hooks/post-update" ]; then "$HOME/.zsh/hooks/post-update"; fi
osascript -e 'display notification "Quiet update complete!" with title "System Maintenance"'
}
# ═══════════════════════════════════════════════════════════════════════════════
# Man Page side-by-side viewer
# Modern, workspace-aware man page viewer
# - Kitty/tmux/iTerm split panes, syntax highlighting via bat
# - Optional qman integration for interactive TOC/search
# - Order-flexible + apropos search
# ═══════════════════════════════════════════════════════════════════════════════
# Detailed Kitty diagnostic
debug_kitty_launch() {
echo "=== Kitty Launch Debugging ==="
# Check basic remote control
echo "1. Testing basic remote control:"
kitty @ ls
echo " Exit code: $?"
# Test simple launch
echo -e "\n2. Testing simple window launch:"
kitty @ launch --type=window echo "Hello from new window"
echo " Exit code: $?"
# Test with bash -c
echo -e "\n3. Testing bash -c launch:"
kitty @ launch --type=window bash -c "echo 'Hello with bash -c'"
echo " Exit code: $?"
# Test overlay
echo -e "\n4. Testing overlay:"
kitty @ launch --type=overlay bash -c "echo 'Overlay test'; read -p 'Press enter to close'"
echo " Exit code: $?"
# Test with actual man command
echo -e "\n5. Testing with man command:"
kitty @ launch --type=window bash -c "man ls"
echo " Exit code: $?"
}
# Test the absolute simplest case
test_basic_split() {
echo "Testing basic split with sleep..."
kitty @ launch --location=vsplit sleep 5
echo "Exit code: $?"
}
# Beautiful man pages in resizable split pane
man() {
if [[ $# -eq 0 ]]; then
echo "Usage: man <command> [section]"
echo "Opens man page in resizable split pane (kitty/tmux) or new tab (iTerm)"
echo "Usage:"
echo " man <command> [section]"
echo " man [section] <command>"
echo " man ? <search-term> # apropos search"
return 1
fi
local cmd="$1"
local section="${2:-}"
# Verify man page exists
if ! /usr/bin/man -w ${section:+$section} "$cmd" >/dev/null 2>&1; then
echo "❌ No manual entry for '$cmd'${section:+ in section $section}"
return 1
# Apropos mode
if [[ "$1" == "?" ]]; then
shift
/usr/bin/man -k "$@"
return
fi
# Build the display command that stays open and adapts to terminal width
local display_cmd
local bat_path=$(which bat 2>/dev/null)
if [[ -n "$bat_path" ]]; then
# Use bat with terminal width detection and better wrapping
display_cmd="export PATH=\"$PATH\"; export MANWIDTH=\$(tput cols); /usr/bin/man ${section:+$section} '$cmd' 2>/dev/null | col -bx | '$bat_path' --language=man --style=grid --theme=Nord --paging=always --terminal-width=\$(tput cols) --wrap=auto; echo; echo 'Press any key to close...'; read -k1"
# Support both orders: man 2 open OR man open 2
local cmd section
if [[ "$1" =~ ^[0-9]+$ && -n "$2" ]]; then
section="$1"; cmd="$2"
else
# Fallback with responsive width
display_cmd="export MANWIDTH=\$(tput cols); MANPAGER='less -R' /usr/bin/man ${section:+$section} '$cmd'; echo; echo 'Press any key to close...'; read -k1"
cmd="$1"; section="${2:-}"
fi
# Handle different terminals - always use split/resizable approach
# Verify page exists
if ! /usr/bin/man -w ${section:+$section} -- "$cmd" >/dev/null 2>&1; then
echo "❌ No manual entry for '$cmd'${section:+ in section $section}"
echo "💡 Try: man ? $cmd"
return 1
fi
# Choose backend
local display_cmd
if command -v qman >/dev/null 2>&1; then
display_cmd="qman ${section:+$section }-- '$cmd'"
else
local bat_path; bat_path=$(command -v bat 2>/dev/null || true)
if [[ -n "$bat_path" ]]; then
display_cmd="export MANWIDTH=\$(tput cols); /usr/bin/man ${section:+$section} '$cmd' 2>/dev/null \
| col -bx \
| '$bat_path' --language=man --style=grid --theme=\${BAT_THEME:-Nord} \
--paging=always --terminal-width=\$(tput cols) --wrap=auto"
else
display_cmd="export MANWIDTH=\$(tput cols); MANPAGER='less -R' /usr/bin/man ${section:+$section} '$cmd'"
fi
fi
# Handle different terminal environments
if [[ -n "${KITTY_WINDOW_ID:-}" ]]; then
# Kitty: Create optimally-sized vertical split
# Left pane: ~100 chars for code, Right pane: ~64 chars for optimal reading
kitty @ launch \
--location=vsplit \
--title="📖 $cmd${section:+ ($section)}" \
--cwd=current \
--bias=60 \
zsh -c "$display_cmd" >/dev/null
--bias=${KITTY_BIAS:-60} \
zsh -lc "$display_cmd" >/dev/null
elif [[ -n "${TMUX:-}" ]]; then
# TMUX: Create resizable horizontal split (easier to read)
tmux split-window -v -l 40% "$display_cmd"
tmux split-window -v -l ${TMUX_HEIGHT:-40%} "$display_cmd"
elif [[ "${TERM_PROGRAM}" == "iTerm.app" ]]; then
# iTerm: Create new split pane
osascript -e "
tell application \"iTerm\"
tell current window
@@ -230,17 +207,13 @@ man() {
end tell
end tell
end tell
end tell
" >/dev/null 2>&1
end tell" >/dev/null 2>&1
else
# Fallback: run inline
echo "📖 Displaying man page inline:"
eval "$display_cmd"
fi
}
# batman is already aliased to man in aliases.zsh
# ═══════════════════════════════════════════════════════════════════════════════
# DOTFILES MANAGEMENT FUNCTIONS
# ═══════════════════════════════════════════════════════════════════════════════
@@ -297,12 +270,81 @@ backup-configs() {
echo " ✓ GPG configuration"
fi
# AWS credentials (if they exist)
if [[ -d ~/.aws ]]; then
cp -R ~/.aws "$backup_dir/" 2>/dev/null || true
echo " ✓ AWS configuration"
fi
echo "✅ Configs backed up to: $backup_dir"
}
# ═══════════════════════════════════════════════════════════════════════════════
# LICENSE MANAGEMENT FUNCTIONS FOR PASS
# ═══════════════════════════════════════════════════════════════════════════════
# License management: add a license entry with optional attached file
license-add() {
if [ $# -lt 1 ]; then
echo "Usage: license-add <product-name> [license-file-path]"
return 1
fi
local product="$1"
local entry="licenses/$product"
local dir="$HOME/.password-store/${entry}.gpg.d"
echo "→ Paste activation code or license metadata for '$product', then press Ctrl+D:"
pass insert -m "$entry" || return 1
if [ $# -eq 2 ]; then
local filepath="$2"
local filename="$(basename "$filepath")"
mkdir -p "$dir"
gpg -o "$dir/${filename}.gpg" -e -r "$(gpg --list-secret-keys --with-colons | awk -F: '/^uid:/ {print $10; exit}')" "$filepath"
echo "✔️ Encrypted license file saved as: $dir/${filename}.gpg"
else
echo "✔️ Code-only license entry created for '$product'."
fi
}
# Edit a license entry in the pass store
license-edit() {
if [ $# -ne 1 ]; then
echo "Usage: license-edit <product-name>"
return 1
fi
local product="$1"
pass edit "licenses/$product"
}
# List all stored licenses
license-list() {
pass ls licenses/ | sed 's/^licenses\///' | sort
}
# Show license details and attached files for a product
license-info() {
if [ $# -ne 1 ]; then
echo "Usage: license-info <product-name>"
return 1
fi
local product="$1"
local entry="licenses/$product"
local pass_file="$HOME/.password-store/${entry}.gpg"
local attach_dir="$HOME/.password-store/${entry}.gpg.d"
if [ ! -f "$pass_file" ]; then
echo "❌ No license entry found for '$product'"
return 1
fi
echo "🔐 License entry: $product"
echo "----------------------------------------"
pass show "$entry"
echo
if [ -d "$attach_dir" ]; then
echo "📎 Attached encrypted file(s):"
find "$attach_dir" -type f -name '*.gpg' -exec basename {} \;
else
echo "📎 No attached files."
fi
}
-2
View File
@@ -28,8 +28,6 @@ nvm() {
# Aliases for when you need to use nvm
alias nvm-load='unset -f nvm; [ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh"'
alias nvm-claude='nvm use 22.16.0'
alias node-homebrew='/opt/homebrew/bin/node'
alias npm-homebrew='/opt/homebrew/bin/npm'
# Quick check if we're in a project with .nvmrc
check_nvmrc() {
-1
View File
@@ -20,7 +20,6 @@ declare -a potential_paths=(
"/usr/local/bin" # Homebrew (Intel)
"/usr/local/sbin" # System binaries
"/opt/homebrew/opt/python@3.13/libexec/bin" # Python 3.13
"/opt/homebrew/opt/python@3.12/libexec/bin" # Python 3.12 (fallback)
"$HOME/.cargo/bin" # Rust binaries
"/opt/homebrew/opt/gnu-sed/libexec/gnubin" # GNU sed
"/opt/homebrew/opt/gnu-tar/libexec/gnubin" # GNU tar