Turn shell aliases into real executable scripts so non-interactive shells and agents can use them.
Works by reading alias definitions from your shell rc file(s) and generating small wrapper scripts with the same names.
bun
cd /Users/iannuttall/dev/repos/alias-scriptsbun installbun run alias-scripts -- generatenpm
cd /Users/iannuttall/dev/repos/alias-scriptsnpm installnpm run alias-scripts -- generateShow help
bun run alias-scripts -- --helpBy default, aliases are read only from the shell's rc file (~/.zshrc, ~/.bashrc, or ~/.config/fish/config.fish). Sourced files are not parsed unless you pass them via --rc.
Generate scripts (default command)
bun run alias-scripts -- generateChoose output directory
bun run alias-scripts -- generate --out ~/.local/binList aliases (from rc file)
bun run alias-scripts -- listReport shell + PATH + conflicts (rc aliases only)
bun run alias-scripts -- reportClean generated scripts
bun run alias-scripts -- cleanGenerate scripts and disable aliases in your rc file
bun run alias-scripts -- generate --disable-aliasesList backups
bun run alias-scripts -- backupsRestore latest backup
bun run alias-scripts -- restoreRestore by id
bun run alias-scripts -- restore --id 20260107-120102-abcdRestore uses the latest backup by default. Use --id to pick a specific one.
Pick a shell explicitly
bun run alias-scripts -- generate --shell zshAllow shadowing existing commands
bun run alias-scripts -- generate --allow-shadowOverwrite existing files in output dir
bun run alias-scripts -- generate --forcePick a specific rc file
bun run alias-scripts -- generate --disable-aliases --rc ~/.zshrcMultiple rc files
bun run alias-scripts -- generate --disable-aliases --rc ~/.zshrc,~/.zprofileBackup directory
bun run alias-scripts -- generate --backup-dir ~/.config/alias-scripts/backupsRestore to a different output dir
bun run alias-scripts -- restore --out ~/tmp/alias-scriptsDry run
bun run alias-scripts -- generate --dry-runFilter by name
bun run alias-scripts -- generate --include "g*,c*" --exclude "gs"JSON output
bun run alias-scripts -- report --jsonMake sure your output directory is on PATH for non-interactive shells.
Backups are created whenever an existing file would be overwritten (when using --force).
If you use --disable-aliases, the tool comments out matching alias lines and creates a backup so you can restore.
Aliases are only disabled for scripts that were created in this run or already exist as generated scripts in the output directory.
Check PATH in a non-interactive login shell
zsh -lc 'echo $PATH'Default output directory
echo ~/.local/binDefault backup directory
echo ~/.config/alias-scripts/backups- Aliases that rely on interactive-only state may behave differently.
cdinside a generated script will not change your current shell directory.- If an alias uses shell-specific syntax, the generated script runs under the same shell to preserve behavior.
MIT