Shared collection of CLI utilities — bash scripts, git subcommands, python tools, whatever's useful. Works on Linux, macOS, and Windows.
| OS | Requirement |
|---|---|
| Linux | bash (preinstalled) |
| macOS | bash (preinstalled — 3.2+, or install newer via brew install bash) |
| Windows | Git for Windows (bundles bash + git) |
git clone <this-repo> ~/projects/toolbox
cd ~/projects/toolbox
./install.shDetects your shell (bash, zsh, fish) and offers to add bin/ to your PATH.
git clone <this-repo> ~\projects\toolbox
cd ~\projects\toolbox
.\install.ps1Generates .cmd wrappers (reads shebangs to pick the right interpreter — bash, python3, node, etc.), then adds bin/ to your user PATH.
New tools added to bin/ are available immediately on Linux/macOS. On Windows, re-run .\install.ps1 after adding new tools to generate their .cmd wrappers.
Deletes local branches whose remote tracking branch has been deleted — the typical state after a squash merge on GitHub.
git cleanup-branches # delete stale branches
git cleanup-branches --dry-run # preview what would be deletedProtected branches (main, master, develop) are never deleted.
- Add an executable to
bin/ - Run
./lint.shto check bash scripts - Update this README
- Commit and push — teammates get it on
git pull
- Add a shebang:
#!/usr/bin/env bash,#!/usr/bin/env python3, etc. - Name git subcommands
git-<command>— git finds them on PATH automatically - Skip file extensions for a cleaner CLI
- Include
--helpsupport
macOS ships bash 3.2 (Apple won't ship GPLv3). All bash scripts must work on 3.2. Avoid:
- Associative arrays (
declare -A) — bash 4.0+ mapfile/readarray— bash 4.0+${var,,}/${var^^}case conversion — bash 4.0+|&pipe shorthand — bash 4.0+- Negative array indices (
${arr[-1]}) — bash 4.2+ coproc— bash 4.0+
Run ./lint.sh before committing — it uses ShellCheck to catch issues.
For anything too complex for bash, use Python — it's truly cross-platform and needs no compatibility workarounds.
- Line endings:
.gitattributesenforces LF for scripts. Do not change this — CRLF breaks bash. - Windows wrappers:
install.ps1generates.cmdfiles inbin/(gitignored). It reads shebangs to route to the correct interpreter. - Python tools: Work natively everywhere. Use
#!/usr/bin/env python3and skip the.pyextension. - Linting:
./lint.shruns ShellCheck on all bash scripts. Install withapt install shellcheck,brew install shellcheck, orscoop install shellcheck.