Personal shell functions, aliases, and scripts for macOS 14+ and Linux (EndeavourOS/Arch). Clean, minimal, and automated setup for new machines.
- Local LLM server (Linux): systemd units that run Ternary Bonsai 2 27B in llama-server on one consumer GPU, plus
bonsai-cc-proxy. The proxy adapts Claude Code and OMP requests to the model and gates admission to the server's shared KV cache, so two large sessions cannot crash it. It has 58 tests. - Background jobs that report their own failures: an hourly git auto-pull with retries, and a heartbeat that reports failed services even when their timers still look active.
- Safe setup: one idempotent
install.shwith--dry-run, plusdotfiles-doctorandvalidate-setup.shto check a machine. - Tested: 37 test suites across the scripts, the background jobs and the proxy (see Validation).
How a coding agent reaches the local model:
flowchart LR
CC["Claude Code"] --> P
OMP["OMP"] --> P
subgraph host["one consumer GPU"]
P["bonsai-cc-proxy<br/>fixes message order<br/>KV admission control<br/>503 in game mode"]
P --> L["llama-server<br/>Bonsai 2 27B<br/>200k-token KV pool"]
end
# Prerequisite (fresh Mac only)
xcode-select --install
git clone https://github.com/bartech-lab/dotfiles.git ~/dotfiles
cd ~/dotfiles
./install.sh
source ~/.zshrc# Prerequisites (fresh system only)
sudo pacman -S git zsh
chsh -s /usr/bin/zsh
# Log out and back in for the shell change, then:
git clone https://github.com/bartech-lab/dotfiles.git ~/dotfiles
cd ~/dotfiles
./install.sh
source ~/.zshrc
# Optional: customize your prompt
p10k configureThe installer is idempotent and safe to re-run.
On macOS it also enables daily Homebrew autoupdate for formulae. On Linux it enables systemd timers for automatic git syncing, heartbeat monitoring, SSD TRIM, and mirror list refresh.
Global Git ignore rules are managed from config/git/gitignore_global and linked to ~/.gitignore_global by ./install.sh.
Included defaults:
- OS files:
.DS_Store,._*,Thumbs.db - Editor temp files:
*~,*.swp,*.swo - Python bytecode:
__pycache__/,*.pyc - Local AI/tool directories:
.agent-browser/,.llm/,.opencode/,.playwright-mcp/, plus.skill-lock.json - Local-only notes:
*.local.md
Agent instruction files (AGENTS.md, CLAUDE.md) and agent directories (.claude/,
.agents/, .codex/, .mcp.json) are deliberately absent: repositories track some of
them, and a global ignore over a tracked path hides new files from git status and makes
git add refuse them without -f. Ignore those per repository in .git/info/exclude.
To apply or refresh the symlink manually:
./install.shAfter installation, verify everything is working:
~/dotfiles/scripts/validate-setup.shFor shell changes, inspect each file's shebang first: run
shellcheck --severity=warning only on Bash/POSIX sh files, and use
zsh -n for zsh files (including .sh files whose shebang selects zsh).
dotfiles-test runs every suite, about 90 s. A push runs it too, through .githooks/pre-push, because this repository has no CI.
Keep the relevant bash -n/sh -n and integration tests, such as:
bash -n path/to/changed-bash-file.sh
sh -n path/to/changed-posix-file.sh
zsh -n path/to/changed-zsh-file.zsh
bash ~/dotfiles/scripts/tests/test-git-autoswitch.sh
bash ~/dotfiles/scripts/tests/test-git-local-patch.sh
bash ~/dotfiles/scripts/tests/test-claude-account.sh
bash ~/dotfiles/scripts/tests/test-install-ntfy.sh
bash ~/dotfiles/git-auto-pull/tests/test.sh
bash ~/dotfiles/scripts/gitlab-stats/tests/test.shThis checks:
- System requirements (macOS version, Command Line Tools)
- Homebrew and critical packages
- Homebrew autoupdate status (
com.user.brewautoupdate) - Dotfiles structure and symlinks
- Shell integration
- Powerlevel10k and gitstatus setup
- Console output compatibility (see Shell startup)
# Preview changes before installing
./install.sh --dry-run
# Diagnose your environment
dotfiles-doctor| Command | Replacement | Why |
|---|---|---|
ls, ll, lt |
eza |
Icons, git status, tree view |
grep |
rg (ripgrep) |
Fast search, smart defaults |
find |
fd |
Simpler syntax, fast file discovery |
sed (simple edits) |
sd |
More intuitive find/replace |
| JSON parsing | jq |
Deterministic machine-readable transforms |
| YAML parsing | yq |
Structured YAML queries and edits |
top |
btm (bottom) |
Visual system monitor |
du |
dust |
Visual disk usage |
df |
duf |
Colorful disk free |
optimize-images [path]- Batch optimize JPEG/PNGdng-to-jpg [path] [quality]- Convert DNG raw files to JPEGvideo-to-gif <input>- Convert videos to GIFvideo-remux [path] [--subdir]- Lossless container conversionvideo-encode-cpu/gpu [path] [--subdir]- H.265 encodingvideo-encode-av1 [path] [--subdir]- AV1 encoding (NVIDIA NVENC)
tfg [--codex] [cycles]- Run Tokens for Good research cycles until 90% usage, Claude by default (setup)gaming [on|off|status]- Free the GPU for a game and restore after, Linux only, Meta+Shift+G (gaming-mode)extract <archive>- Universal archive extractorarchive [name] [--dry-run] [-gzip]- Create reproducible archivesrepo-check- Pre-archive sanity checkerdotfiles-doctor- Environment health checkgitlab-stats [options]- GitLab merge request statisticsdiscord-openasar-apply [flags]- Apply OpenAsar and the theme CSS, then smoke-test Discord (opt-in)discord-openasar-recover [--launch] [backup]- Restore Discord's stock app.asar from a backupdiscord-openasar-status- Show the current OpenAsar statefilen-fix-sync-retry [--check]- Patch Filen sync to retry failed tasks after 60 s instead of halting until a manual resume;filen-patches/setup.shreapplies it after Filen updates (see Functions Reference)agent-skills-sync [name ...]- Mirror skills from the Claude-synced skill bundle into ~/.agents/skills, which Codex and OMP both read
git-cleanup- Clean merged branchesgit-open- Open repo in browsergit-autoswitch- Wrapsgit pushto switch back to the default branch after pushing a feature branch. Installed as a zsh function and asgitshims inscripts/shimsand~/.local/bin(see Functions Reference)git local-patch- Keeps local-only edits on tracked files out of commits without breakinggit pull, using a clean/smudge filter (see Functions Reference)- WezTerm configuration - Pro theme, Meslo 11 font, persistent local tabs, and direct tab shortcuts
macos-defaults- Apply comprehensive system preferences (Dock, Finder, Screenshots/Screen Recording, Keyboard, UI)macos-defaults-export- Export current macOS settings to a backup scriptmacos-disable-notification-sounds- Turn off notification sounds across apps, skipping locked entriescpwd- Copy current path to clipboard
Automatic background syncing for git repositories.
setup.sh- One-time setup for new machines- Runs every hour
- Configurable per-machine repos with different main branches
- Logs run summaries and updates to
pull.log, and failures toerror.log - Retries failed Linux runs after 60 seconds, with three starts per 45-minute window
See Git Auto-Pull README for setup details.
Optional lightweight monitor for user LaunchAgents.
launchd-heartbeat/setup.sh- One-time setup- Runs every hour
- Logs configured service status and reports failed Linux services, even when their timers remain active
See LaunchAgent Heartbeat README for setup details.
Moving to a new Mac? Use the migration scripts:
# On old machine - backs up SSH keys, npm packages, Ghostty config, and ALL macOS defaults
SSH_ARCHIVE_PASSWORD='<password>' ~/dotfiles/scripts/migrate-backup.sh
# On new machine - restores everything including comprehensive macOS system preferences
SSH_ARCHIVE_PASSWORD='<password>' ~/dotfiles/scripts/migrate-restore.sh ~/migration-backup.tar.gzWhat gets backed up:
- SSH keys (encrypted with
SSH_ARCHIVE_PASSWORD) - Global npm packages list
- Ghostty terminal configuration
- Comprehensive macOS system preferences (Dock, Finder, Screenshots, Keyboard, Trackpad, UI settings)
- List of installed App Store apps
The macOS defaults backup includes 30+ settings covering Dock behavior, Finder visibility options, screenshot preferences, keyboard repeat rates, typing auto-corrections, window animations, and more.
See Installation Guide for details.
- ๐ฅ Installation Guide - Setup, prerequisites, troubleshooting
- ๐๏ธ Architecture - How it works, file structure, extending
- ๐ Functions Reference - Complete command reference
- ๐ฌ Media Processing - Video/image optimization
- ๐ ๏ธ Development Utilities - Archives, diagnostics, helpers
- ๐ฌ Discord OpenAsar - Persistent OpenAsar + minimal CSS setup
- macOS 14+ (Sonoma and later) or Linux (EndeavourOS/Arch)
- zsh (auto-installed by
./install.shon Linux, pre-installed on macOS) - ShellCheck (installed by
Brewfileon macOS orlinux/pkglist/pacman.txton Linux) - Homebrew (auto-installed by
./install.shon macOS)
Personal dotfiles - feel free to use as inspiration for your own setup.