Aliases & Navigation
Aliases provide instant navigation to any worktree from anywhere in your filesystem.
The Navigation Problem
| Approach | Problem |
|---|---|
| Bash aliases | Must edit file, source it, update all terminals |
| Shell functions | Same manual update process |
| Symlinks | Clutter, maintenance overhead |
wa Aliases
# Set an alias for the current worktree
wa set wt --alias=myproj
# Get path by alias (for scripting)
wa get wa --alias=myproj
# List all aliases
wa ls wa --aliases
Fuzzy Matching
Aliases support fuzzy matching using Jaro distance. You don’t need to type the exact alias:
# All of these find "casemgr":
wa get wa --alias=casemgr
wa get wa --alias=casemg
wa get wa --alias=casem
Shell Helper Functions
The installer sets up shell functions in ~/.config/wa/. Source them in your shell profile:
source ~/.config/wa/workarea-functions.sh # Core wa functions
source ~/.config/wa/git-helpers.sh # Git shortcuts
source ~/.config/wa/project-functions.sh # Project navigation examples
Core wa Functions
| Function | Description |
|---|---|
cdwa <alias> |
Navigate to worktree by alias (activates it) |
codewa <alias> |
Navigate to worktree and launch VS Code |
home |
Navigate to current worktree’s root directory |
main |
Checkout the main branch |
aliases |
List all worktree aliases |
Git Helper Functions
| Function | Description |
|---|---|
recent |
Show 15 most recent branches |
status |
Git status |
log |
One-line git log |
pull / push |
Git pull / push |
stash / stash_list / stash_pop |
Stash shortcuts |
gitsync <branch> |
Stash, rebase, pull, push |
Building Your Own Project Functions
The key pattern for project navigation functions:
# Navigate to a subdirectory within the active worktree
myapp() {
cd $(wa get wt --worktree)/apps/myapp || return
}
# Use the worktree name as context (e.g., for ticket systems)
ticket() {
open-ticket $1 $(basename $(wa get wt --worktree)) || return
}
See ~/.config/wa/project-functions.sh for more examples after installation.
Alias Commands Reference
| Command | Description |
|---|---|
wa set wt --alias=name |
Set alias for current worktree |
wa get wa --alias=name |
Get worktree path by alias |
wa get wa --alias=name --activate |
Get path and set as active worktree |
wa ls wa --aliases |
List all aliases and their paths |