Scripts for windows / mac / linux, and also documentation for me.
Feel free to send a PR!
Clone the repo to e.g. ~/bin:
git clone https://github.com/darthwalsh/bin.git
# OR
git clone git@github.com:darthwalsh/bin.git
After cloning, install dependencies:
mise install
$modules = @('Pester', 'posh-git', 'powershell-yaml', 'PowerShellForGitHub')
foreach ($module in $modules) {
if (Get-Module -ListAvailable -Name $module) {
Write-Host "✓ $module is already installed" -ForegroundColor Green
} else {
Write-Host "Installing $module..." -ForegroundColor Cyan
Install-Module $module -Scope CurrentUser -Force
}
}MAYBE instead use [tasks.setup-pwsh] run = "pwsh -Command \"Install-Module ModuleName\""
This will:
- Install required dependencies (
uv,oh-my-posh) - Provide instructions for configuring your shell profile
Then follow the manual setup instructions below to complete configuration.
ssh $NAME 'git clone --depth 1 https://github.com/darthwalsh/bin.git ~/.dw-bin 2>/dev/null || git -C ~/.dw-bin pull && export PATH="$HOME/.dw-bin:$HOME/.dw-bin/lnx:$PATH" && source ~/.dw-bin/bash_aliases && exec bash -i'
# Start a new docker container from image with a volume mount
docker run --rm -it -v ~/code/bin:/usr/local/bin/.dw-bin $IMAGE bash -i -c 'export PATH="/usr/local/bin/.dw-bin:$PATH" && source /usr/local/bin/.dw-bin/bash_aliases && exec bash -i'
# Existing docker with git
docker exec -it -u 0 $NAME bash -lc 'git clone --depth 1 https://github.com/darthwalsh/bin.git /usr/local/bin/.dw-bin 2>/dev/null || git -C /usr/local/bin/.dw-bin pull && source /usr/local/bin/.dw-bin/bash_aliases && exec bash -i'
# Or without git, manually copy from host
docker cp ~/code/bin "${NAME}:/usr/local/bin/.dw-bin" && docker exec -it -u 0 "${NAME}" bash -ic 'export PATH="/usr/local/bin/.dw-bin:$PATH" &&
source /usr/local/bin/.dw-bin/bash_aliases && exec bash -i'Add this to ~/.bashrc or ~/.zshrc
source ~/bin/bash_aliases
PATH=~/bin:$PATH
Then, for OS specific-scripts add ones of these lines:
PATH=~/bin/lnx:$PATH
PATH=~/bin/mac:$PATH
Edit the file $PROFILE to start with one of these lines:
. ~/bin/lnx/Microsoft.PowerShell_profile.ps1
. ~/bin/mac/Microsoft.PowerShell_profile.ps1
. ~/bin/win/Microsoft.PowerShell_profile.ps1Optionally, install:
Install-Module posh-git -Scope CurrentUserThere are some old commands from cmd are in Dropbox... but that's not supported here.
Some scripts like gpx.py use /// script; dependencies= inline script metadata and should be run with pipx or uv.
Then format and lint with
pipx run ruff check --fix && pipx run ruff format
When fixing, Ruff's lint hook must be placed before formatter
The scripts are not well tested, but see tests/README.md for instructions on running tests.
Tests use Pester (PowerShell testing framework) and can be run on Linux, macOS, and Windows. See the testing documentation for installation prerequisites and usage instructions.