Skip to content

bbcoder-gh/rbam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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_aliases file automatically

Installation

From crates.io

cargo install rbam

From source

git clone https://github.com/yourusername/rbam
cd rbam
cargo install --path .

Quick Start

# Add your first alias
rbam add
# Name: prod-server
# Command: ssh deploy@production.example.com

# List all aliases
rbam list

# List with full commands
rbam list --full

# Execute an alias
rbam exec prod-server

After adding aliases, reload your shell:

source ~/.bash_aliases

Usage

Add Alias

Interactive mode - prompts for name and command:

rbam add

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:

rbam list

Output:

cdn-staging
prod-server
db-backup

Show full details:

rbam list --full

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:

rbam exec cdn-staging

Useful for testing before sourcing your shell.

Common Use Cases

SSH Shortcuts

rbam add
# Name: prod
# Command: ssh deploy@prod.example.com

rbam add
# Name: staging
# Command: ssh deploy@staging.example.com -p 2222

Docker Commands

rbam add
# Name: dps
# Command: docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"

Git Shortcuts

rbam add
# Name: gst
# Command: git status -sb

Directory Navigation

rbam add
# 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
git clone https://github.com/yourusername/rbam
cd rbam

# Run tests
cargo test

# Build release
cargo build --release

# Binary will be at
./target/release/rbam

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Development Setup

  1. Fork the repository
  2. Clone your fork: git clone https://github.com/yourusername/rbam
  3. Create a branch: git checkout -b feature/my-feature
  4. Make changes and add tests
  5. Run tests: cargo test
  6. Format code: cargo fmt
  7. Check with clippy: cargo clippy
  8. Commit: git commit -m "Add my feature"
  9. Push: git push origin feature/my-feature
  10. 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!

About

Rust Bash Alias Manager

Resources

License

Unknown, Unlicense licenses found

Licenses found

Unknown
LICENSE
Unlicense
UNLICENSE

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages