A Go CLI tool that scans shell alias files for potential issues including:
- Shadowed system commands: Aliases that override existing system commands
- Duplicate definitions: Multiple definitions of the same alias name
- Unused aliases: Aliases that are never used (requires shell history analysis)
The repo also includes a small Node CLI wrapper so it can be published as an npm package and run with npx for one-off scans.
go install github.com/ryan258/alias-scanner@latestOr build from source:
git clone https://github.com/ryan258/alias-scanner.git
cd alias-scanner
go build -o alias-scannerOnce this repo is published to npm, you can run it without a persistent install:
npx alias-scanner scanOr point it at a specific file:
npx alias-scanner scan -f /path/to/aliases -vScan the default alias file (~/.bash_aliases):
./alias-scanner scan./alias-scanner scan -f /path/to/aliases./alias-scanner scan -vFound 3 issues:
[SHADOW] Line 5: alias 'grep' - shadows system command 'grep'
[DUPLICATE] Line 12: alias 'll' - defined 2 times
[INFO] Note: Unused alias detection requires shell history analysis (not implemented)
- Parses standard shell alias syntax (
alias name='command') - Detects aliases that shadow system commands in PATH
- Identifies duplicate alias definitions
- Verbose mode for additional information
- Cross-platform support (works on any system with Go)
- Unused alias detection requires shell history analysis (not implemented)
- Only supports basic alias syntax (no functions or complex quoting)
- Assumes standard shell alias file format
go test ./...
npm testgo build
npm packMIT