Introduction
This manual covers personal command-line tools installed in ~/bin. Scripts fall into two categories: standalone tools with no external dependency, and mrk tools — symlinks into ~/mrk/scripts/ managed by the mrk machine configuration system.
scripts/lib.sh. See Section 3.1.Standalone Scripts
no external dependencyaudio-mode standalone
Pauses cloud sync services during recording sessions to prevent disk I/O noise and latency.
audio-mode on [--icloud] [--gdrive] [--all]
audio-mode off
audio-mode status
- on — Pauses Dropbox (always), plus iCloud and/or Google Drive with flags. Snapshots pre-state so
offonly restores what was actually running. - off — Restores services to their pre-
onstate. Only resumes services that were running beforeonwas called. - status — Shows current state of audio mode and each service.
- State persisted at
~/.audio_mode_state.json(JSON, managed via jq). - Activity logged to
~/Library/Logs/audio-mode.log.
zoom-mode standalone
Prepares the system for a Zoom recording session: keeps the WiFi AP alive, prevents sleep, stops active Time Machine backups, and delegates cloud sync pausing to audio-mode.
zoom-mode on
zoom-mode off
zoom-mode status
- on — Pings 8.8.8.8 every 30s in the background (prevents AP idle-timeout drops), runs
caffeinate -dto block display and system sleep, stops any active Time Machine backup, then callsaudio-mode on --all. - off — Kills the keepalive and caffeinate processes, then calls
audio-mode offto restore sync services. - status — Shows whether zoom-mode is active and delegates to
audio-mode status. - Background PIDs tracked at
~/.zoom_mode_pids. - Activity logged to
~/Library/Logs/zoom-mode.log.
nuke-mrk standalone
Removes all mrk artifacts for a fresh reinstall: ~/mrk, ~/.mrk, symlinks in ~/bin, and dotfile symlinks in $HOME.
nuke-mrk
- Prints reinstall instructions after completion.
snapshot standalone
Exports current app preferences as plists into ~/mrk/assets/preferences/.
snapshot [--brewfile] [--help]
- Without
--brewfile: exports plists only, prompts to commit if changes detected. - With
--brewfile: also runsbrew bundle dump(destructive — overwrites comments). Asks for confirmation. - Apps: AlDente, Amphetamine, BetterSnapTool, Descript, Fission, HandBrake, Helium, Ice, iTerm2, ScreenFlow
mrk Scripts
symlinked from ~/mrk/scripts/check-updates mrk
Silently checks for mrk repo updates (at most once every 7 days). Prompts to update if behind.
check-updates
- Only runs in interactive shells.
- Exits silently on network failure or if up to date.
- Timestamp cached in
~/.cache/mrk/.
doctor mrk
Verifies ~/bin is on PATH. With --fix, appends a conditional PATH export to ~/.zshrc.
doctor [check | --fix | fix]
check(default) — prints pass/fail and exits with status 0 or 1--fix/fix— idempotent: only writes to~/.zshrcif the line isn't already there. The exported line checks that~/binexists and isn't already in PATH before prepending it.
fix-exec mrk
Sets executable bits on all mrk scripts and ~/bin symlinks pointing into the repo. Idempotent.
fix-exec
generate-install-manifest mrk
Scans symlinks in ~/bin and $HOME that point into mrk, writes the list to ~/mrk/.install-manifest for the uninstaller.
generate-install-manifest
hardening.sh mrk
Applies opt-in macOS security hardening with automatic rollback script generation.
hardening.sh
~/.mrk/hardening-rollback.sh before any changes are applied.- Touch ID for sudo — adds
pam_tid.soto/etc/pam.d/sudo - Immediate password on wake — screensaver password delay → 0
- Firewall + stealth mode — enables macOS application firewall
hide_tm.sh mrk
Hides Time Machine backup volumes from the Finder sidebar.
hide_tm.sh [volume_name]
TM_VOLUMES="Vol1,Vol2" hide_tm.sh
- Default volume:
TimeMachine. - Accepts comma-separated list via env var or argument.
pull-prefs mrk
Clones or pulls the private mrk-prefs repo into ~/.mrk/preferences/. Auto-called by mrk post-install.
pull-prefs
snapshot-prefs mrk
Comprehensive preference export: plists for 15 apps plus Application Support files. Commits and pushes to the private mrk-prefs repo.
snapshot-prefs
- Apps: BetterSnapTool, Ice, iTerm2, Raycast, Stats, Loopback, SoundSource, Audio Hijack, Farrago, Piezo, Typora, Hot, Keka, TimeMachineEditor, MacWhisper
- App Support: Loopback (devices/routing), SoundSource (presets/sources)
status mrk
Interactive two-pane TUI health dashboard for the mrk installation. Also available as mrk-status.
status
mrk-status --help
- Left pane: nine checks with ✓/⚠/✗ status — dotfiles, tool symlinks, macOS defaults, security hardening, backups, shell, PATH, Homebrew, Brewfile packages
- Right pane: detail lines for the selected check, including the suggested fix command
- f — run the fix command for the selected check
- r — refresh all checks
- tab / ←→ — switch panes
sync mrk
Compares installed Homebrew packages against the Brewfile, presents an interactive picker for new packages, and inserts them alphabetically into the correct section.
sync [--dry-run | -n] [--commit | -c] [--prune | -p]
--dry-run— shows what would be added/removed without modifying--commit— auto-commits the Brewfile after updating--prune— removes Brewfile entries for packages no longer installed (interactive selection)- Uses mrk-picker or gum for interactive selection
sync-login-items mrk
Diffs system login items against those tracked in scripts/post-install. Presents an interactive picker to add new items or remove stale ones, then updates post-install, docs/manual.md, and docs/index.html in one pass.
sync-login-items [--dry-run | -n] [--commit | -c]
--dry-run— shows the diff and selected changes without writing any files--commit— auto-commits all changed files after updating with a descriptive message (login-items: add X; remove Y)- Uses
gumfor multi-select UI when available; falls back to y/N bulk prompts. - Login items are read from System Events via AppleScript. Paths are resolved automatically.
mrk-install mrk
Unified mrk installer. Runs setup, brew, and post-install phases. Entry point for a full bootstrap or targeted re-run.
mrk-install [phase] [options]
- Phases:
setup,brew,post-install, or omit for all - Options pass through to the selected phase
mrk-setup mrk
Phase 1: idempotent macOS bootstrap. Dotfile linking, ~/bin symlinks, shell config, backups.
mrk-setup [options]
mrk-brew mrk
Phase 2: Homebrew package and cask installation from the Brewfile.
mrk-brew [options]
mrk-post-install mrk
Phase 3: configure apps installed by Homebrew (post-install hooks, app-specific setup).
mrk-post-install
mrk-defaults mrk
Applies macOS defaults (Dock, Finder, keyboard, etc.) and generates a rollback script at ~/.mrk/defaults-rollback.sh.
mrk-defaults [--with-trackpad]
- Without flags: applies all defaults except trackpad gestures
--with-trackpad— also applies trackpad gesture settings
mrk-uninstall mrk
Conservative mrk uninstaller. Removes symlinks and mrk state. Does not uninstall Homebrew packages or undo defaults.
mrk-uninstall
Shared Library
scripts/lib.shSourced by scripts that need consistent logging, colors, and utilities.
| Function | Purpose |
|---|---|
ok() | Green checkmark success message |
warn() | Yellow warning (stderr) |
err() | Red error (stderr) |
info() | Blue info message |
debug() | Cyan debug (only when DEBUG=1) |
confirm() | Interactive y/N prompt (auto-confirms when YES=1) |
is_running | Check if a process matching a pattern is running |
require_cmd | Exit with error if any listed command is missing |
human_bytes | Convert bytes to human-readable (e.g. 1.5 G) |
safe_rm | Remove paths safely (refuses anything outside $HOME) |
YES=1 — auto-confirm all prompts ·
DRY_RUN=1 — safe_rm prints instead of deleting ·
DEBUG=1 — enables debug() output
Quick Reference
all commands| Command | What it does |
|---|---|
zoom-mode on | Enable Zoom recording mode (WiFi keepalive, no sleep, pause sync) |
zoom-mode off | Disable Zoom recording mode and restore all services |
audio-mode on --all | Pause all sync services for recording (without network/sleep tweaks) |
audio-mode off | Resume sync services |
snapshot | Export app prefs to mrk |
snapshot-prefs | Export + push prefs to private repo |
sync | Add new Homebrew packages to Brewfile |
sync-login-items | Diff & update tracked login items in post-install + docs |
status | Interactive TUI health dashboard (dotfiles, tools, Homebrew, etc.) |
nuke-mrk | Clean uninstall mrk for reinstall |
hardening.sh | Apply macOS security tweaks |
doctor --fix | Fix ~/bin PATH issues |
mrk-install | Full mrk bootstrap (all phases) |
mrk-setup | Phase 1: dotfiles, symlinks, shell |
mrk-brew | Phase 2: Homebrew packages |
mrk-defaults [--with-trackpad] | Apply macOS defaults (add trackpad gestures with flag) |
mrk-uninstall | Remove mrk symlinks and state (does not touch Homebrew or defaults) |