Scripts

Install

./bin/inject            # generate ~/.scripts.sh and source it into all rc files
./bin/inject --show     # preview what will be written
./bin/inject --uninstall  # uninstall

inject is idempotent — re-running won't duplicate entries. Restart your shell or source ~/.zshrc afterwards to call commands from any directory.

Feature Table

ScriptWhat it doesExample
checkworkAutomated build check + voice notificationcheckwork
cpdDeep overlay copy (default only adds/updates; -f deletes extra files in dest)cpd src/* dest/
kkKill processes by namekk nginx
kkpKill processes by portkkp 8080
nmacOS voice broadcast (say)n "build done"
loopLoop a command, tracking success/failureloop 10 curl url
merge_canaryMerge current branch → canary, stay on canarymerge_canary [--dry-run]
merge_developMerge current branch → develop, stay on developmerge_develop
merge_autoMerge current branch → remote default, stay on targetmerge_auto
merge_testMerge current branch → test, stay on testmerge_test
push_canaryMerge current branch → canary, push, switch backpush_canary [--stay]
push_develop / push_auto / push_testSame as above, target = develop / remote default / test
push_* (batch)Running push_* in a non-git dir auto-batches: scans subdirs for Git repos and pushes eachpush_canary [--dry-run]
switch_branchBatch switch branch (create from origin/master if missing)switch_branch <branch>
sync_masterBatch sync mastersync_master
sync_branchBatch sync current (or given) branch to origin/sync_branch [branch] [--force]
delete_branchDelete local branch (single/batch)delete_branch <name> [--force] [-y]
delete_branch_remoteDelete remote branch (single/batch)delete_branch_remote <name> [--remote <r>] [-y]
fetch_allBatch fetch all Git reposfetch_all
unsleepmacOS caffeinate anti-idleunsleep -t 3600
reindexReindex project (local-only, .gitignore)reindex
injectInject bin/ into shell PATHinject

Migration Notes (old names removed)

  • mergec / mergedev / mergem / mergetmerge_canary / merge_develop / merge_auto / merge_test
  • pushc / pushdev / pushm / pushtpush_canary / push_develop / push_auto / push_test
  • pushc_all is merged into push_*: running in a non-git dir auto-batches without confirmation; use --dry-run to preview.

Environment Variables

  • BATCH_CONCURRENCY: max concurrency for batch operations (push_* / switch_branch / sync_branch / sync_master), default 4. Example: BATCH_CONCURRENCY=8 push_canary.

Requirements

  • Python 3.10+ (thin entrypoints and core logic)
  • Git (merge_* / push_* / switch_branch / sync_master / fetch_all / delete_branch)
  • macOS (n uses say, unsleep uses caffeinate)
  • rich (output formatting, pip install rich)
  • pgrep / ps / lsof / kill (kk / kkp)