Never forget your shell shortcuts again. Get context-aware reminders based on your current directory.
You built dozens of shell aliases. purn to grab Pulumi resource URNs. kgp instead of kubectl get pods. Each one saved keystrokes.
Then you forgot they existed.
Your brain reaches for the long commands under pressure, not the shortcuts you created later.
Display relevant shortcuts based on your current directory. Git repo? Show git aliases. Pulumi project? Show Pulumi helpers. Kubernetes context? Show kubectl shortcuts.
cd ~/my-pulumi-project/
💡 Quick shortcuts available:
Git: ga (add) | gc (commit) | gco (checkout) | gp (push)
Pulumi: purn <n> | pdelete <n> | pprotected | pfind <term>
K8s: kg (get) | kgp (pods) | kd (describe)
Type 'halias' for complete list, 'halias-off' to disablecurl -fsSL https://raw.githubusercontent.com/rajeshkio/context-aware-shell-aliases/main/install.sh | bashClone the repo, customize the scripts, then install:
git clone https://github.com/rajeshkio/context-aware-shell-aliases.git
cd context-aware-shell-aliases
# Edit scripts/sample_aliases.sh to add your own shortcuts
# Edit scripts/alias_reminder.sh to customize detection
./install-local.shSmart Context Detection
- Git repositories
- Kubernetes clusters (kubectl)
- Pulumi projects
- Docker projects
- Terraform configs
- Node.js projects
Configurable Reminders
- Always (on every context change)
- Daily (once per day)
- Never (manual with
haliascommand)
Zero Performance Impact
- ~16ms overhead per directory change
- Intelligent caching for network mounts
- Early exit when context unchanged
Platform Support
- bash 4.0+
- zsh 5.0+
- macOS and Linux
After installation, reminders appear automatically when you change directories:
cd my-terraform-project/
💡 Quick shortcuts available:
Git: ga (add) | gc (commit) | gco (checkout) | gp (push)
Terraform: tf (terraform) | tfa (apply) | tfp (plan)halias # Show all available shortcuts
halias git # Show git shortcuts only
halias k8s # Show Kubernetes shortcuts
halias pulumi # Show Pulumi shortcuts
halias-off # Disable reminders
halias-on # Re-enable remindersga→ git addgc→ git commitgco→ git checkoutgp→ git pushgs→ git status
k→ kubectlkg→ kubectl getkgp→ kubectl get podskd→ kubectl describe
p→ pulumipup→ pulumi uppurn <n>→ Get resource URNpdelete <n>→ Remove from statepfind <term>→ Search resources
dps→ docker ps -adlogs→ docker logs -fdstop→ Stop all containersdclean→ System prune
tf→ terraformtfa→ terraform applytfp→ terraform plan
Edit scripts/alias_reminder.sh to detect new contexts:
# Check for your custom context
if [ -f "your-marker-file" ]; then
aliases_to_show+=("YourTool: cmd1 (desc) | cmd2 (desc)")
context_found=true
fiUpdate your shell integration in ~/.bashrc or ~/.zshrc:
if [ -f "your-marker-file" ]; then
current_context="${current_context}yourtool,"
fiEdit scripts/sample_aliases.sh:
# Your custom aliases
alias mycommand='your-long-command --with-flags'Then reinstall:
./install-local.shBenchmarked on three systems:
2019 MacBook Pro (SSD):
- Overhead: 1.6ms per cd
Linux Workstation (NVMe):
- Overhead: 1.4ms per cd
Network-Mounted Home:
- Overhead: 16ms per cd
Detection runs in parallel with your actual directory change, making it imperceptible during normal use.
Three components make this system:
-
Detection Script (
~/.alias_reminder.sh): Checks for git repos, Pulumi configs, kubectl access, etc. -
Help System (
~/.alias_help.sh): Provides thehaliascommand and toggle functions. -
Shell Integration: Overrides
cdto run detection when context changes.
The system tracks your last context to prevent spam. Moving between subdirectories in the same project won't trigger new reminders.
Run either installer with the --uninstall flag:
./install.sh --uninstall
# or
./install-local.sh --uninstallThis removes:
~/.alias_reminder.sh~/.alias_help.sh- Integration from your shell config
Your custom aliases remain in your shell config for manual removal if desired.
Tracked over three months:
Before:
- Used full command 147 times
- Used alias 12 times
- Adoption: 8%
After:
- Used full command 23 times
- Used alias 139 times
- Adoption: 86%
Time saved: ~45 minutes weekly (39 hours yearly).
The bigger win is reduced cognitive load. No more thinking "what was that jq filter?" or "which kubectl command do I need?" The reminder appears exactly when you need it.
Contributions welcome! Areas for improvement:
- Additional context detection (Go projects, Rust, etc.)
- More sample aliases for common tools
- Fish shell support
- Performance optimizations
- Better docs
MIT
Built out of frustration with forgetting my own shortcuts. If you've ever typed the same 60-character command that your 10-character alias replaces, this is for you.