rbam - Rust Bash Alias Manager
A fast, simple CLI tool to manage your bash aliases, perfect for SSH shortcuts and frequently used commands.
Why rbam?
- 🚀 Fast - Written in Rust for blazing speed
- 🎯 Simple - Intuitive commands to add, list, and execute aliases
- 🔧 Practical - Built for developers who SSH into multiple servers
- 📝 Clean - Manages your
.bash_aliasesfile automatically
Installation
From crates.io
From source
Quick Start
# Add your first alias
# Name: prod-server
# Command: ssh deploy@production.example.com
# List all aliases
# List with full commands
# Execute an alias
After adding aliases, reload your shell:
Usage
Add Alias
Interactive mode - prompts for name and command:
Example session:
Name: cdn-staging
Command: ssh -p 2222 deploy@cdn.staging.example.com
✓ Added alias: cdn-staging
To use immediately, run:
source ~/.bash_aliases
List Aliases
Show alias names only:
Output:
cdn-staging
prod-server
db-backup
Show full details:
Output:
alias cdn-staging='ssh -p 2222 deploy@cdn.staging.example.com'
alias prod-server='ssh deploy@production.example.com'
alias db-backup='ssh root@backup.example.com'
Execute Alias
Run a command from an alias without sourcing:
Useful for testing before sourcing your shell.
Common Use Cases
SSH Shortcuts
# Name: prod
# Command: ssh deploy@prod.example.com
# Name: staging
# Command: ssh deploy@staging.example.com -p 2222
Docker Commands
# Name: dps
# Command: docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
Git Shortcuts
# Name: gst
# Command: git status -sb
Directory Navigation
# Name: proj
# Command: cd ~/projects/myapp && ls
File Location
rbam manages your .bash_aliases file located at:
~/.bash_aliases
This file is automatically sourced by .bashrc on most systems.
Requirements
- Rust 1.70 or higher (for building from source)
- Bash shell
- Linux or macOS
Platform Support
- ✅ Linux
- ✅ macOS
- ⚠️ Windows (via Git Bash or WSL)
Configuration
rbam stores aliases in ~/.bash_aliases. No additional configuration needed.
Building from Source
# Clone the repository
# Run tests
# Build release
# Binary will be at
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Development Setup
- Fork the repository
- Clone your fork:
git clone https://github.com/yourusername/rbam - Create a branch:
git checkout -b feature/my-feature - Make changes and add tests
- Run tests:
cargo test - Format code:
cargo fmt - Check with clippy:
cargo clippy - Commit:
git commit -m "Add my feature" - Push:
git push origin feature/my-feature - Open a Pull Request
Roadmap
- Remove alias command
- Search/filter aliases
- Import/export aliases
- Shell completion (bash, zsh, fish)
- Edit alias interactively
- Backup and restore
- Windows PowerShell support
FAQ
Q: Where are my aliases stored?
A: In ~/.bash_aliases in your home directory.
Q: How do I remove an alias?
A: Currently, manually edit ~/.bash_aliases. Remove command coming soon!
Q: Do I need to restart my terminal?
A: No, just run source ~/.bash_aliases to reload.
Q: Can I use this with zsh?
A: Yes! Add source ~/.bash_aliases to your ~/.zshrc.
Q: What if I already have a .bash_aliases file? A: rbam appends to it, preserving existing aliases.
License
MIT License - see LICENSE file for details.
Author
Your Name - @yourhandle
Acknowledgments
- Built with Rust
- Inspired by the need for simpler SSH alias management
Star ⭐ this repo if you find it useful!