A clean, modular bash configuration that provides essential functionality while remaining easy to extend and customize. Now with a built-in package manager and load manager for optimal performance!
- Modular Design: Configuration is split into logical modules for easy maintenance
- Essential Aliases: Common shortcuts for navigation, git, docker, and system commands
- Useful Functions: File extraction, backup, search, and utility functions
- Smart Prompt: Shows current directory and git branch (if available)
- Enhanced Completion: Tab completion for custom functions and common tools
- Cross-Platform: Works on Linux, macOS, and other Unix-like systems
- Easy Extension: Simple module system for adding new functionality
- 🎉 Package Manager: Install, manage, and discover custom bash packages from a registry
- ⚡ Load Manager: Control what gets loaded for optimal startup performance
- 📊 Performance Monitoring: Track startup time and optimize your configuration
-
Clone or download this configuration to your home directory:
git clone <repository-url> ~/.bashie cd ~/.bashie
-
Run the installer:
./install.sh
-
Restart your terminal or source the configuration:
source ~/.bashrc
.bashrc # Main configuration file
bash.d/ # Configuration modules directory
├── 01-environment.sh # Environment variables and basic settings
├── 02-aliases.sh # Command aliases
├── 03-prompt.sh # Prompt configuration
├── 04-functions.sh # Utility functions
├── 05-completion.sh # Command completion
├── 06-example-extension.sh # Example extension module
├── 07-package-manager.sh # Bash package manager
└── 08-load-manager.sh # Load manager for performance
tools/ # Development and management tools
├── create-package.sh # Package creation tool
├── deploy-registry.sh # Registry deployment tool
├── load-manager-ui.sh # Interactive load manager UI
└── performance-monitor.sh # Performance monitoring tool
examples/ # Example packages and registry
├── registry.json # Sample package registry
└── packages/ # Example packages
├── docker-utils.sh
└── git-workflow.sh
The bash configuration includes a powerful package manager that allows you to discover, install, and manage custom bash functionality from a centralized registry.
# Search for available packages
bp search docker
# Install a package
bp install docker-utils
# List installed packages
bp list
# Get package information
bp info git-workflow
# Update a package
bp update docker-utils
# Uninstall a package
bp uninstall docker-utils| Command | Description |
|---|---|
bp install <package> |
Install a package |
bp uninstall <package> |
Uninstall a package |
bp list [filter] |
List installed packages |
bp search <query> |
Search for packages |
bp update [package] |
Update registry or specific package |
bp info <package> |
Show package information |
bp help |
Show help |
The load manager provides fine-grained control over what gets loaded, allowing you to optimize startup performance and manage your bash environment efficiently.
# List all modules and packages
blm list
# Enable/disable modules
blm enable 06-example-extension
blm disable 07-package-manager
# Enable/disable packages
blm enable docker-utils
blm disable git-workflow
# Set module priorities
blm priority 02-aliases 1
# Create and use profiles
blm profile save minimal
blm profile load development| Command | Description |
|---|---|
| `blm enable <module | package>` |
| `blm disable <module | package>` |
blm list [filter] [all] |
List modules and packages |
| `blm status <module | package>` |
| `blm reload <module | package>` |
blm priority <module> <1-10> |
Set module priority |
blm profile <action> [name] |
Manage load profiles |
blm help |
Show help |
For easier management, use the interactive UI:
# Launch the interactive load manager
./tools/load-manager-ui.shThis provides a user-friendly interface for:
- Enabling/disabling modules and packages
- Setting priorities
- Managing profiles
- Quick actions for common configurations
Create different configurations for different use cases:
# Save current configuration as a profile
blm profile save minimal
# Save a development profile
blm profile save development
# Load a specific profile
blm profile load minimal
# List available profiles
blm profile listControl the loading order of modules (1 = highest priority, 10 = lowest):
# Set high priority for essential modules
blm priority 01-environment 1
blm priority 02-aliases 2
# Set lower priority for optional modules
blm priority 06-example-extension 8Monitor and optimize your bash configuration performance:
# Measure startup time
./tools/performance-monitor.sh startup 5
# Analyze module loading times
./tools/performance-monitor.sh modules
# Analyze package loading times
./tools/performance-monitor.sh packages
# Show memory usage
./tools/performance-monitor.sh memory
# Generate complete performance report
./tools/performance-monitor.sh report
# Get optimization suggestions
./tools/performance-monitor.sh optimize
# Run all analyses
./tools/performance-monitor.sh all- Disable unused modules: Use
blm disable <module>for modules you don't need - Use profiles: Create different profiles for different use cases
- Monitor regularly: Check performance with the monitoring tools
- Lazy loading: Consider lazy loading for heavy functions
- Priority management: Set appropriate priorities for modules
- UTF-8 locale configuration
- History settings (10,000 commands, ignore duplicates)
- PATH management for common directories
- Editor and pager preferences
- Navigation:
..,...,home,desk,docs,dl - Safety:
rm,cp,mvwith confirmation - Git:
gs,ga,gc,gp,gl,gd - System:
ports,meminfo,diskusage - Development:
py,pip,node,npm,d,dc
extract <file>- Extract various archive formatsbackup <file>- Create timestamped backupff <pattern>- Find files by namefd <pattern>- Find directories by namemkcd <dir>- Create directory and navigate to itup <n>- Go up n directoriesnewscript <name>- Create new executable scriptsysinfo- Show system informationweather [location]- Show weather (requires curl)note [text]- Quick note taking
- Tab completion for all custom functions
- Enhanced completion for git, docker, systemctl
- File and directory completion
# Install packages from the registry
bp install docker-utils
bp install git-workflow
# Create your own packages
./tools/create-package.sh-
Create a new file in the
bash.d/directory:touch bash.d/09-my-module.sh
-
Add your configuration:
# ============================================================================= # My Custom Module # ============================================================================= # Your aliases, functions, and settings here alias myalias='my command' myfunction() { echo "My custom function" }
-
Enable the module:
blm enable 09-my-module
Create ~/.bashrc.local for machine-specific settings that won't be tracked in version control:
# Machine-specific settings
export CUSTOM_VAR="value"
alias localalias="local command"# Run the interactive package creator
./tools/create-package.shThis will guide you through creating:
- Package metadata (name, description, version, etc.)
- Script, function, or alias files
- README documentation
- Package configuration
packages/my-package/
├── my-package.sh # Main package file
├── package.json # Package metadata
└── README.md # Documentation
# =============================================================================
# My Package
# =============================================================================
# Aliases
alias myalias='my command'
# Functions
myfunction() {
echo "My function"
}
# Environment variables
export MY_VAR="value"# =============================================================================
# My Function
# =============================================================================
myfunction() {
# Function logic here
echo "Function called"
}# =============================================================================
# My Alias
# =============================================================================
alias myalias='my_command_here'- Create your package using the package creator tool
- Test locally by sourcing the package file
- Add to registry by updating the registry JSON file
- Share with community by contributing to the registry
Edit bash.d/03-prompt.sh to modify your prompt:
# Simple prompt
PS1='\w\$ '
# Fancy prompt with colors
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ 'Create bash.d/09-languages.sh:
# Python aliases
alias py='python3'
alias pip='pip3'
alias venv='python3 -m venv'
# Node.js aliases
alias nr='npm run'
alias ni='npm install'
alias nid='npm install --save-dev'Create bash.d/10-projects.sh:
# Quick project navigation
alias projects='cd ~/Projects'
alias work='cd ~/Projects/work'
alias personal='cd ~/Projects/personal'
# Project management functions
deploy() {
echo "Deploying to production..."
# Your deployment logic here
}# Use the interactive UI for quick actions
./tools/load-manager-ui.sh
# Or use command line quick actions
blm quick minimal # Minimal configuration
blm quick development # Development configuration
blm quick production # Production configuration# Regular performance checks
./tools/performance-monitor.sh startup
./tools/performance-monitor.sh modules
./tools/performance-monitor.sh report
# Set up performance alerts
# Add to your crontab to monitor regularly
# 0 */6 * * * ~/.bashie/tools/performance-monitor.sh reportThe load manager uses a configuration file at ~/.bash-load-config:
# Format: module_name:enabled:priority
01-environment:1:1
02-aliases:1:2
03-prompt:1:3
04-functions:1:4
05-completion:1:5
06-example-extension:0:6
07-package-manager:1:7
08-load-manager:1:8- Module not loading: Check if it's enabled in
~/.bash-load-config - Priority conflicts: Use
blm priorityto set correct priorities - Profile not working: Verify profile exists with
blm profile list
- Package not found: Run
bp updateto refresh the registry - Installation fails: Check if dependencies are available
- Package not loading: Verify the package file exists and is executable
- Slow startup: Use
./tools/performance-monitor.sh startupto measure - High memory usage: Disable unused modules with
blm disable - Module conflicts: Check module priorities and dependencies
- Check file permissions:
chmod +x bash.d/*.sh - Verify syntax:
bash -n bash.d/your-module.sh - Check for errors:
source bash.d/your-module.sh
- Ensure bash-completion is installed
- Check if the completion function is properly registered
- Verify the function name matches the command
- Check terminal color support
- Verify escape sequences are properly formatted
- Test with a simple prompt first
- Create a package using
./tools/create-package.sh - Test thoroughly on different systems
- Document usage in the README
- Submit a pull request with your package
- Fork the repository
- Create a feature branch
- Add your improvements
- Test thoroughly
- Submit a pull request
- Performance improvements: Optimize module loading
- New profiles: Create useful default profiles
- UI enhancements: Improve the interactive interface
- Monitoring tools: Add new performance metrics
This configuration is provided as-is for personal use. Feel free to modify and distribute according to your needs.
This configuration draws inspiration from various bash configurations and best practices from the Unix/Linux community. The package manager concept is inspired by modern package managers like npm, pip, and cargo. The load manager is designed to address the common issue of slow bash startup times with heavily customized configurations.