Personal Systems Branch / ~/bin Toolkit
TECHNICAL MANUAL / ~/bin Command Reference
BIN-1 / PAGES: N/A
SYSTEM: macOS / zsh
SOURCE REPO: sevmorris/mrk
0.

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.

Note
All scripts are bash. Common behavior (logging, prompts, safe deletion) is provided by the shared library at scripts/lib.sh. See Section 3.1.
1.

Standalone Scripts

no external dependency
1.1

audio-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 off only restores what was actually running.
  • off — Restores services to their pre-on state. Only resumes services that were running before on was 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.
1.2

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 -d to block display and system sleep, stops any active Time Machine backup, then calls audio-mode on --all.
  • off — Kills the keepalive and caffeinate processes, then calls audio-mode off to 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.
1.3

nuke-mrk standalone

Removes all mrk artifacts for a fresh reinstall: ~/mrk, ~/.mrk, symlinks in ~/bin, and dotfile symlinks in $HOME.

nuke-mrk
Caution
Destructive operation. Interactive — confirms before deleting. Does not uninstall Homebrew packages or undo macOS defaults.
  • Prints reinstall instructions after completion.
1.4

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 runs brew bundle dump (destructive — overwrites comments). Asks for confirmation.
  • Apps: AlDente, Amphetamine, BetterSnapTool, Descript, Fission, HandBrake, Helium, Ice, iTerm2, ScreenFlow
2.

mrk Scripts

symlinked from ~/mrk/scripts/
Note
Symlinked from ~/mrk/scripts/ during make install. Part of the mrk machine configuration system.
2.1

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/.
2.2

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 ~/.zshrc if the line isn't already there. The exported line checks that ~/bin exists and isn't already in PATH before prepending it.
2.3

fix-exec mrk

Sets executable bits on all mrk scripts and ~/bin symlinks pointing into the repo. Idempotent.

fix-exec
2.4

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
2.5

hardening.sh mrk

Applies opt-in macOS security hardening with automatic rollback script generation.

hardening.sh
Warning
Modifies system files. A rollback script is generated at ~/.mrk/hardening-rollback.sh before any changes are applied.
  • Touch ID for sudo — adds pam_tid.so to /etc/pam.d/sudo
  • Immediate password on wake — screensaver password delay → 0
  • Firewall + stealth mode — enables macOS application firewall
2.6

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.
2.7

pull-prefs mrk

Clones or pulls the private mrk-prefs repo into ~/.mrk/preferences/. Auto-called by mrk post-install.

pull-prefs
2.8

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)
2.9

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
2.10

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
2.11

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 gum for 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.
2.12

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
2.13

mrk-setup mrk

Phase 1: idempotent macOS bootstrap. Dotfile linking, ~/bin symlinks, shell config, backups.

mrk-setup [options]
2.14

mrk-brew mrk

Phase 2: Homebrew package and cask installation from the Brewfile.

mrk-brew [options]
2.15

mrk-post-install mrk

Phase 3: configure apps installed by Homebrew (post-install hooks, app-specific setup).

mrk-post-install
2.16

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
2.17

mrk-uninstall mrk

Conservative mrk uninstaller. Removes symlinks and mrk state. Does not uninstall Homebrew packages or undo defaults.

mrk-uninstall
3.1

Shared Library

scripts/lib.sh

Sourced by scripts that need consistent logging, colors, and utilities.

Table 3.1-1. lib.sh Function Reference
FunctionPurpose
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_runningCheck if a process matching a pattern is running
require_cmdExit with error if any listed command is missing
human_bytesConvert bytes to human-readable (e.g. 1.5 G)
safe_rmRemove paths safely (refuses anything outside $HOME)
Note — Environment Variables
YES=1 — auto-confirm all prompts  ·  DRY_RUN=1 — safe_rm prints instead of deleting  ·  DEBUG=1 — enables debug() output
3.2

Quick Reference

all commands
Table 3.2-1. Command Summary
CommandWhat it does
zoom-mode onEnable Zoom recording mode (WiFi keepalive, no sleep, pause sync)
zoom-mode offDisable Zoom recording mode and restore all services
audio-mode on --allPause all sync services for recording (without network/sleep tweaks)
audio-mode offResume sync services
snapshotExport app prefs to mrk
snapshot-prefsExport + push prefs to private repo
syncAdd new Homebrew packages to Brewfile
sync-login-itemsDiff & update tracked login items in post-install + docs
statusInteractive TUI health dashboard (dotfiles, tools, Homebrew, etc.)
nuke-mrkClean uninstall mrk for reinstall
hardening.shApply macOS security tweaks
doctor --fixFix ~/bin PATH issues
mrk-installFull mrk bootstrap (all phases)
mrk-setupPhase 1: dotfiles, symlinks, shell
mrk-brewPhase 2: Homebrew packages
mrk-defaults [--with-trackpad]Apply macOS defaults (add trackpad gestures with flag)
mrk-uninstallRemove mrk symlinks and state (does not touch Homebrew or defaults)