Shell Integration
dotbins creates shell scripts that add binaries to your PATH and apply your custom tool configurations.
After running dotbins sync or dotbins init, shell integration scripts are created in ~/.dotbins/shell/ for various shells (Bash, Zsh, Fish, Nushell, and PowerShell)
What's in the Shell Scripts?
The generated shell scripts do two main things:
- Add binaries to PATH - Makes tool binaries available for your platform/architecture
- Apply your tool-specific shell_code - Sets up aliases, completions, and initializations
For example, with this configuration:
fzf:
repo: junegunn/fzf
shell_code: |
source <(fzf --zsh)
bat:
repo: sharkdp/bat
shell_code: |
alias bat="bat --paging=never"
alias cat="bat --plain --paging=never"
The generated zsh.sh will include:
#!/usr/bin/env zsh
# dotbins - Add platform-specific binaries to PATH
_os=$(uname -s | tr '[:upper:]' '[:lower:]')
[[ "$_os" == "darwin" ]] && _os="macos"
_arch=$(uname -m)
[[ "$_arch" == "x86_64" ]] && _arch="amd64"
[[ "$_arch" == "aarch64" || "$_arch" == "arm64" ]] && _arch="arm64"
export PATH="$HOME/.dotbins/$_os/$_arch/bin:$PATH"
# Tool-specific configurations
# Configuration for fzf
if command -v fzf >/dev/null 2>&1; then
source <(fzf --zsh)
fi
# Configuration for bat
if command -v bat >/dev/null 2>&1; then
alias bat="bat --paging=never"
alias cat="bat --plain --paging=never"
fi
Shell Startup Integration
Add this line to your shell's startup file to integrate dotbins: