🎯 Comprehensive refinement addressing durability and maintainability: **Modular Architecture:** - environment.zsh: Centralized environment variables with XDG compliance - paths.zsh: Intelligent PATH management with existence checking - aliases.zsh: Enhanced aliases with tool fallbacks and context awareness - functions.zsh: Sophisticated functions with error handling and recovery - .zshrc: Clean main config with graceful degradation **Key Improvements:** - ✅ Fixed PATH duplication and made portable - ✅ Added graceful dependency handling throughout - ✅ Enhanced vault/chamber/work context integration - ✅ Comprehensive error recovery in sysupdate() - ✅ Intelligent tool detection and fallbacks - ✅ Performance optimizations for different shell modes **Philosophy Applied:** - μέτρον (measure): Right amount of features without bloat - συμμετρία (proportion): Balanced modular structure - πρόσφορον (fitting): Portable, maintainable, testable **Testing:** - Syntax validation for all modules - Function loading verification - Isolated test environment - Ready for production deployment 🤖 Generated with Claude Code (https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
182 lines
9.4 KiB
Bash
182 lines
9.4 KiB
Bash
# ░█▀█░█░░░▀█▀░█▀█░█▀▀░█▀▀░█▀▀
|
|
# ░█▀█░█░░░░█░░█▀█░▀▀█░█▀▀░▀▀█
|
|
# ░▀░▀░▀▀▀░▀▀▀░▀░▀░▀▀▀░▀▀▀░▀▀▀
|
|
|
|
# Enhanced aliases with intelligent fallbacks and context awareness
|
|
|
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
# I. NAVIGATION & LISTING
|
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
|
|
# Enhanced navigation with consistent patterns
|
|
alias ..="cd .."
|
|
alias ...="cd ../.."
|
|
alias ....="cd ../../.."
|
|
alias .....="cd ../../../.."
|
|
alias -- -="cd -" # Go back to previous directory
|
|
|
|
# Context-aware directory shortcuts
|
|
alias dl="cd ~/Downloads"
|
|
alias dt="cd ~/Desktop"
|
|
alias docs="cd ~/Documents"
|
|
alias vault="cd '$VAULT_PATH'"
|
|
alias chamber="cd '$CHAMBER_PATH'"
|
|
alias work="cd '$WORK_PATH'"
|
|
alias dotfiles="cd '$DOTFILES_PATH'"
|
|
|
|
# Vault-specific navigation
|
|
alias daily="cd '$VAULT_PATH/01. Daily'"
|
|
alias notes="cd '$VAULT_PATH/08. Notes'"
|
|
alias projects="cd '$VAULT_PATH/06. Projects'"
|
|
alias templates="cd '$VAULT_PATH/98. Templates'"
|
|
|
|
# Enhanced listing with eza (fallback to ls)
|
|
if command -v eza >/dev/null 2>&1; then
|
|
alias ls='eza --color=auto --group-directories-first --icons'
|
|
alias ll='eza -lgh --git --time-style=relative'
|
|
alias la='eza -la --git --time-style=relative'
|
|
alias lt='eza --tree --level=2 --icons --git'
|
|
alias ltree='eza --tree --icons --git'
|
|
alias lx='eza -lgh --sort=extension --git'
|
|
alias lk='eza -lgh --sort=size --git'
|
|
alias lt='eza -lgh --sort=modified --git'
|
|
else
|
|
# Fallback to standard ls with colors
|
|
alias ls='ls --color=auto'
|
|
alias ll='ls -lh'
|
|
alias la='ls -lah'
|
|
alias lt='ls -lt'
|
|
fi
|
|
|
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
# II. GIT & VERSION CONTROL
|
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
|
|
alias gs='git status'
|
|
alias ga='git add'
|
|
alias gc='git commit'
|
|
alias gp='git push'
|
|
alias gl='git pull'
|
|
alias gd='git diff'
|
|
alias gb='git branch'
|
|
alias gco='git checkout'
|
|
alias glog='git log --oneline --graph --decorate'
|
|
|
|
# Enhanced git aliases
|
|
alias gss='git status --short'
|
|
alias gaa='git add --all'
|
|
alias gcm='git commit -m'
|
|
alias gcam='git commit -am'
|
|
alias gundo='git reset --soft HEAD~1'
|
|
alias gclean='git clean -fd'
|
|
|
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
# III. SEARCH & TEXT PROCESSING
|
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
|
|
# Enhanced search with ripgrep (fallback to grep)
|
|
if command -v rg >/dev/null 2>&1; then
|
|
alias grep='rg --smart-case --follow --color=always'
|
|
alias greph='rg --hidden --follow --color=always'
|
|
alias grepi='rg --ignore-case --follow --color=always'
|
|
else
|
|
alias grep='grep --color=auto'
|
|
alias grepi='grep -i --color=auto'
|
|
fi
|
|
|
|
# Enhanced cat with bat (fallback to cat)
|
|
if command -v bat >/dev/null 2>&1; then
|
|
alias cat='bat --style=auto'
|
|
alias ccat='bat --style=plain' # Plain cat equivalent
|
|
else
|
|
alias bat='cat'
|
|
fi
|
|
|
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
# IV. MEDIA & DOWNLOADS
|
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
|
|
# Download utilities
|
|
alias dl="curl -O"
|
|
alias yt="yt-dlp -S res,ext:mp4:m4a --recode mp4"
|
|
alias yta="yt-dlp -x --audio-format mp3"
|
|
|
|
# Quick media info
|
|
alias mediainfo='ffprobe -v quiet -print_format json -show_format -show_streams'
|
|
|
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
# V. SYSTEM MONITORING & NETWORK
|
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
|
|
# Network information
|
|
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
|
|
alias localip="ipconfig getifaddr en0"
|
|
alias ips="ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'"
|
|
|
|
# Speed and connectivity
|
|
alias speed="npx speed-cloudflare-cli"
|
|
alias ping="ping -c 5"
|
|
alias pingg="ping google.com"
|
|
|
|
# System monitoring
|
|
alias cpu="top -F -R -o cpu"
|
|
alias mem="top -F -R -o rsize"
|
|
alias ports="lsof -i -P | grep LISTEN"
|
|
|
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
# VI. MACOS SPECIFIC
|
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
|
|
# Finder and system
|
|
alias show="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
|
|
alias hide="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
|
|
alias ql="qlmanage -p" # Quick Look from terminal
|
|
alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"
|
|
|
|
# Spotlight control
|
|
alias spotoff="sudo mdutil -a -i off"
|
|
alias spoton="sudo mdutil -a -i on"
|
|
|
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
# VII. CHECKSUMS & SECURITY
|
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
|
|
alias verify1='openssl sha1'
|
|
alias verify256='openssl dgst -sha256'
|
|
alias verify512='openssl dgst -sha512'
|
|
|
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
# VIII. WORKFLOW SPECIFIC
|
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
|
|
# Work context (Animal Rationis Capax)
|
|
alias arc="cd '$WORK_PATH' && 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
|
|
|
|
After reading, confirm you understand the current state and are ready for today'\''s work.'"
|
|
|
|
# Glimpse processing
|
|
alias glimpse="cd '$CHAMBER_PATH/tools/glimpse-processing' && source venv/bin/activate && python glimpse_tool.py"
|
|
|
|
# Entertainment
|
|
alias tetris='/opt/homebrew/opt/vitetris/bin/tetris'
|
|
|
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
# IX. MAINTENANCE & UPDATES
|
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
|
|
# System maintenance (interactive confirmation)
|
|
alias update="read -q 'REPLY?Run full system update? (y/n) ' && echo && sysupdate || echo 'Aborted.'"
|
|
alias mrclean='sudo periodic daily weekly monthly'
|
|
|
|
# Comprehensive cleanup
|
|
alias cleanup='deep_clean' # References function in functions.zsh
|
|
|
|
# Quick dotfiles management
|
|
alias dotfiles-backup='$DOTFILES_PATH/bin/backup-dotfiles'
|
|
alias dotfiles-status='$DOTFILES_PATH/bin/check-app-configs' |