Never worry about missing dependencies again!
BashBuddy automatically detects your system, checks for required commands, and installs missing packages across any platform.
Features β’ Installation β’ Usage β’ Documentation
|
|
|
|
| Platform | Package Managers | Status |
|---|---|---|
| π§ Linux | apt, dnf, yum, pacman | β Full Support |
| π macOS | Homebrew (brew) | β Full Support |
| πͺ Windows | Chocolatey, Scoop, MSYS2 | β Full Support |
| π§ WSL | apt (Ubuntu/Debian) | β Full Support |
| π§ Cygwin | Auto-detection | β Supported |
BashBuddy provides three scripts tailored for different use cases:
| Script | Purpose | Use Case |
|---|---|---|
bashbuddy.sh |
ποΈ Main Skeleton | Template for your own projects. Copy and customize the dependency list for your needs. |
full_sample.sh |
π― Working Example | Full-featured implementation with extended package mappings. Use as a reference or standalone tool. |
sim_sample.sh |
π Educational Demo | Safe simulation that shows how mappings work without installing anything. |
For detailed usage instructions, advanced features, and best practices, visit our:
π Wiki Page β Comprehensive guides and tutorials
# 1. Clone the repository
git clone https://github.com/shadowdevnotreal/Bash-buddy.git
# 2. Navigate to the directory
cd Bash-buddy
# 3. Make scripts executable
chmod +x *.shcurl -fsSL https://raw.githubusercontent.com/shadowdevnotreal/Bash-buddy/main/full_sample.sh | bashThe skeleton script is designed to be copied into your own projects and customized:
# Run with default dependencies (curl, wget, tar)
./bashbuddy.shTo customize for your project:
- Open
bashbuddy.shin your editor - Modify the
command_to_packagearray on line 21:
declare -A command_to_package=(
[git]="git"
[docker]="docker"
[python3]="python3"
# Add your dependencies here
)- Update the
required_commandsarray in themain()function (line 209)
The full sample accepts commands as arguments and installs them:
# Check and install specific tools
./full_sample.sh git nvim htop
# Check multiple dependencies at once
./full_sample.sh curl wget docker nodejs python3Example Output:
BashBuddy - Checking dependencies...
Detected WSL (Windows Subsystem for Linux)
Missing commands: nvim htop
Do you want to proceed with the installation? (y/N) y
Updating package index...
Attempting to install 'neovim' for command 'nvim'...
β Successfully installed all missing packages!
All required commands are now available.
Safe demonstration without installing anything:
./sim_sample.shThis displays how command-to-package mappings work without making system changes.
#!/bin/bash
# your-awesome-script.sh
# Source BashBuddy at the start of your script
source ./bashbuddy.sh
# Your script logic here - all dependencies guaranteed!
curl https://api.example.com/data | jq '.results'# .github/workflows/build.yml
- name: Install dependencies
run: ./full_sample.sh make gcc docker# Setup script for your team
./full_sample.sh git node python3 dockerWe love contributions! Here's how you can help:
- π Report bugs β Open an issue with details
- π‘ Suggest features β We're always looking for ideas
- π Improve docs β Help others understand BashBuddy better
- π§ Submit PRs β Add support for new package managers
- Fork the repository
- Create a feature branch
git checkout -b feature/AmazingFeature
- Commit your changes
git commit -m 'Add AmazingFeature' - Push to your branch
git push origin feature/AmazingFeature
- Open a Pull Request
Script fails with "Unsupported package manager"
Make sure you have a supported package manager installed:
- Linux:
apt,dnf,yum, orpacman - macOS: Install Homebrew from https://brew.sh
- Windows: Install Chocolatey (https://chocolatey.org) or Scoop (https://scoop.sh)
Permission denied errors
Make sure the scripts are executable:
chmod +x bashbuddy.sh full_sample.sh sim_sample.shWSL not detected correctly
If you're on WSL but detection fails, check that /proc/version exists and contains "microsoft" or "WSL":
cat /proc/versionPackage installation fails
Common causes:
- Update your package manager index first (e.g.,
sudo apt update) - Check your internet connection
- Verify you have sudo permissions (for Linux package managers)
- Check if the package name is correct for your distro
Q: Can I use this in production scripts? A: Absolutely! BashBuddy uses strict error handling and is designed for production use.
Q: Does it require root/sudo access? A: Only for installing packages with system package managers (apt, dnf, yum, pacman). Homebrew, Scoop, and user-level installs don't require sudo.
Q: Can I add custom package sources/PPAs?
A: Yes! Extend the install_packages() function to add custom repositories before installation.
Q: What if a command has different package names across distros?
A: Use the get_package_name() function pattern from full_sample.sh to map commands to distro-specific packages.
This project is open source and available under the MIT License.
If BashBuddy helped you, consider:
- β Starring this repository
- π¦ Sharing with your network
- β Buying me a coffee (button at the top)
Made with β€οΈ for the open source community
Report Bug β’ Request Feature β’ Wiki

