Intelligent alias discovery for PowerShell, inspired by the oh-my-zsh alias-finder plugin.
PSAliasFinder helps you discover and use shorter aliases for PowerShell commands, improving your terminal productivity. It automatically suggests aliases when you type long commands and provides tools to search for available aliases.
- π Intelligent Alias Search - Find aliases for any PowerShell command
- π― Smart Filtering - Only suggests aliases that save significant typing
- β‘ Automatic Suggestions - Get alias recommendations as you type
- π¨ PSReadLine Integration - Seamless integration with PowerShell prompt
- π§ Flexible Configuration - Enable/disable automatic suggestions easily
- π Multiple Search Modes - Exact, longer, cheaper search options
Install-Module -Name PSAliasFinder -Scope CurrentUser
- Download the latest release from GitHub
- Extract to your PowerShell modules directory:
- Windows:
$env:USERPROFILE\Documents\PowerShell\Modules\PSAliasFinder
- Linux/macOS:
~/.local/share/powershell/Modules/PSAliasFinder
- Windows:
Import-Module PSAliasFinder
# Find aliases for a command
Find-Alias Get-ChildItem
# Output: gci -> Get-ChildItem
# ls -> Get-ChildItem
# dir -> Get-ChildItem
# Using the short alias
af Get-Process
# Output: gps -> Get-Process
# ps -> Get-Process
# Enable automatic alias detection
Set-AliasFinderHook -Enable
# Now when you type long commands, you'll get suggestions:
# PS> Get-ChildItem
#
# Found existing alias for "Get-ChildItem". You should use: "gci", "ls", "dir"
Add this to your PowerShell profile ($PROFILE
) to enable automatically:
Import-Module PSAliasFinder
Set-AliasFinderHook -Enable
Or configure with options:
Import-Module PSAliasFinder
$global:PSAliasFinderConfig = @{ AutoLoad = $true }
# Find aliases for Get-ChildItem
Find-Alias Get-ChildItem
# Using the 'af' shorthand
af Get-Process
# Search with exact match only
af Get-ChildItem -Exact
# Include longer aliases (contains the command)
af Process -Longer
# Only show aliases shorter than the command
af Get-ChildItem -Cheaper
# Bypass intelligent filtering (show all matches)
af ls -Force
# Suppress output, only return results
$aliases = af Get-Process -Quiet
# Enable automatic suggestions
Set-AliasFinderHook -Enable
# Disable automatic suggestions
Set-AliasFinderHook -Disable
# Configure with AutoLoad
Set-AliasFinderConfig -AutoLoad
PSAliasFinder uses intelligent filtering to avoid noise:
- β Command length check - Only suggests for commands β₯8 characters
- β Complexity check - Skips commands with multiple pipes or many arguments
- β Savings check - Only suggests aliases that save β₯4 characters
- β AST parsing - Accurately counts pipes using PowerShell's Abstract Syntax Tree
This ensures you only see helpful suggestions, not clutter.
Search for aliases matching a command.
Syntax:
Find-Alias [-Command] <String[]> [-Exact] [-Longer] [-Cheaper] [-Quiet] [-Force]
Parameters:
-Command
- The command to search (required)-Exact
- Find only exact matches-Longer
- Include aliases longer than the command-Cheaper
- Only show aliases shorter than the command-Quiet
- Suppress console output-Force
- Bypass intelligent filtering
Aliases: af
, alias-finder
Enable or disable automatic alias suggestions.
Syntax:
Set-AliasFinderHook [-Enable] [-Disable]
Parameters:
-Enable
- Activate automatic suggestions-Disable
- Deactivate automatic suggestions
Configure module behavior.
Syntax:
Set-AliasFinderConfig [-AutoLoad]
Parameters:
-AutoLoad
- Enable automatic suggestions on module import
- PowerShell 5.1 or higher
- PSReadLine module (for automatic suggestions feature)
Feature | oh-my-zsh | PSAliasFinder |
---|---|---|
Find aliases | β | β |
Exact/Longer/Cheaper modes | β | β |
Automatic suggestions | β | β |
Intelligent filtering | β | β |
AST-based pipe counting | β | β |
Complexity validation | β | β |
Quiet mode | β | β |
Force mode (show all) | β | β |
PSAliasFinder extends the original concept with PowerShell-specific enhancements and smarter filtering.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by the oh-my-zsh alias-finder plugin
- Built for the PowerShell community
- π Report issues on GitHub Issues
- π¬ Discuss on GitHub Discussions
- β Star the project if you find it helpful!
Made with β€οΈ for PowerShell users