Skip to content

M4ikel79/dash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

dash - Enhanced Bash Framework

A self-contained, powerful bash enhancement framework with integrated tools and smart dependency management.

✨ Features

  • πŸš€ Enhanced Line Editing - ble.sh for readline replacement with syntax highlighting
  • πŸ” Smart Completions - argc-completions for rich command completions
  • πŸ“¦ Bundled Dependencies - Auto-installs GitHub tools, no manual setup needed
  • 🎨 Starship Prompt - Beautiful cross-shell prompt (configurable)
  • πŸ”§ Development Tools - Integrated mise, usage-cli, carapace support
  • πŸ“ Command Hooks - Pre/post command execution hooks with bash-preexec
  • ⚑ Performance - Lazy loading and optimized startup time
  • πŸ› οΈ Package Management - Built-in basher support for bash packages
  • πŸ”„ Auto-Update - Keep everything up-to-date with dash-update
  • πŸ₯ Health Checks - Comprehensive diagnostics with dash-doctor

πŸ“‹ Requirements

Essential

  • bash >= 4.0
  • git
  • curl

Recommended

  • starship - Beautiful prompt
  • fzf - Fuzzy finder
  • zoxide - Smart directory jumper
  • atuin - Shell history
  • nvim - Text editor

Optional

  • bat - Syntax-highlighted cat
  • rg (ripgrep) - Fast grep
  • fd - Fast find
  • mise - Runtime manager
  • usage - Command usage generator
  • carapace - Multi-shell completer

πŸš€ Quick Start

Installation

# Clone dash to ~/.dash
git clone https://github.com/M4ikel79/dash ~/.dash

# Run setup
~/.dash/bin/dash-setup

# Reload your shell
source ~/.bashrc

What Gets Installed

The setup script will:

  1. βœ… Clone bundled libraries (ble.sh, bash-preexec, argc-completions, bash-it, basher)
  2. βœ… Check for external dependencies
  3. βœ… Configure your ~/.bashrc
  4. βœ… Set up directory structure
  5. βœ… Create cache files

πŸ“ Directory Structure

~/.dash/
β”œβ”€β”€ bin/                      # Executable scripts
β”‚   β”œβ”€β”€ dash-setup           # Initial setup
β”‚   β”œβ”€β”€ dash-check           # Dependency checker
β”‚   β”œβ”€β”€ dash-update          # Update manager
β”‚   └── dash-doctor          # Health diagnostics
β”œβ”€β”€ lib/                      # Bundled libraries (auto-installed)
β”‚   β”œβ”€β”€ ble.sh/              # Enhanced readline
β”‚   β”œβ”€β”€ bash-preexec/        # Command hooks
β”‚   β”œβ”€β”€ argc-completions/    # Completions
β”‚   β”œβ”€β”€ bash-it/             # Bash framework
β”‚   └── basher/              # Package manager
β”œβ”€β”€ config/                   # Configuration files
β”‚   β”œβ”€β”€ env                  # Environment variables
β”‚   β”œβ”€β”€ bash_aliases         # Aliases
β”‚   β”œβ”€β”€ integrations.sh      # Tool integrations
β”‚   β”œβ”€β”€ hooks.sh             # Command hooks
β”‚   └── blerc                # ble.sh configuration
β”œβ”€β”€ functions/                # Custom functions
β”‚   └── core.sh              # Core utilities
β”œβ”€β”€ completion/               # Custom completions
β”‚   └── custom.sh            # Completion definitions
β”œβ”€β”€ cache/                    # Runtime cache
β”‚   β”œβ”€β”€ dash.log             # Logs
β”‚   β”œβ”€β”€ .versions            # Version tracking
β”‚   └── .installed           # Installation state
β”œβ”€β”€ loader.sh                 # Main entry point
└── README.md                 # This file

πŸ”§ Configuration

Your ~/.bashrc

dash uses a minimal loader approach. Your ~/.bashrc should look like:

# ~/.bashrc - Your personal bash configuration

# Your custom settings go here
export EDITOR=nvim
export VISUAL=nvim

# Load dash framework (must be at the end)
[[ -f ~/.dash/loader.sh ]] && source ~/.dash/loader.sh

Customizing dash

  • Aliases: Edit ~/.dash/config/bash_aliases
  • Environment: Edit ~/.dash/config/env
  • Functions: Add to ~/.dash/functions/core.sh
  • Hooks: Edit ~/.dash/config/hooks.sh
  • ble.sh: Edit ~/.dash/config/blerc

πŸ“¦ Commands

Core Commands

dash-setup      # Run initial setup
dash-check      # Check dependencies and installation
dash-update     # Update dash and dependencies
dash-doctor     # Run health checks and diagnostics

Update Options

dash-update              # Update bundled libraries only
dash-update --all        # Update everything (libs + system + cargo)
dash-update --system     # Update system packages
dash-update --cargo      # Update Cargo packages

Utility Functions

# File operations
extract <file>           # Extract any archive
mkcd <dir>               # Create and cd into directory
backup <file>            # Backup file with timestamp

# Process management
killp <name>             # Find and kill process
topcpu [n]               # Show top N CPU-using processes
topmem [n]               # Show top N memory-using processes

# Network
myip                     # Get external IP
localip                  # Get local IP addresses
port_check <host> <port> # Check if port is open
whatslistening <port>    # Show what's listening on port

# Git helpers
gclone <url>             # Clone and cd into repo
glog                     # Pretty git log
gst                      # Git status short
gca <msg>                # Commit all with message

# Development
serve [port]             # Start HTTP server (default: 8000)
json <file|string>       # Pretty print JSON
genpass [length]         # Generate random password
genuuid                  # Generate UUID

# System
sysinfo                  # Show system information
diskusage                # Show disk usage of current dir
up [n]                   # Go up N directories

# dash framework
dash-reload              # Reload dash configuration
dash-edit                # Edit dash in $EDITOR
dash-logs [n]            # Show last N log lines
dash-clear-logs          # Clear dash logs

🎨 Integrated Tools

starship (Prompt)

# Install
cargo install starship

# Create config
starship preset nerd-font-symbols -o ~/.config/starship.toml

fzf (Fuzzy Finder)

# Install
sudo pacman -S fzf  # Arch
cargo install fzf   # Cargo

# Keybindings (auto-loaded by dash)
Ctrl-R    # Search history
Ctrl-T    # Search files
Alt-C     # cd into directory

zoxide (Smart cd)

# Install
cargo install zoxide

# Usage
cd ~/projects/myapp    # First visit
cd myapp               # Jump directly later

atuin (History)

# Install
cargo install atuin

# Usage
Ctrl-R    # Search history (enhanced)

usage-cli (Command Usage)

# Install
cargo install usage-cli

# Provides automatic completions for many tools

πŸ” Troubleshooting

Check Installation

dash-check

Run Diagnostics

dash-doctor

Common Issues

ble.sh not working

# Reinstall ble.sh
cd ~/.dash/lib/ble.sh
make clean && make install PREFIX=~/.dash/lib/ble.sh

Completions not working

# Check argc-completions
ls ~/.dash/lib/argc-completions/completions

# Reload shell
source ~/.bashrc

Slow startup

# Enable debug mode
export DASH_DEBUG=1
source ~/.bashrc

# Check logs
dash-logs

πŸ”„ Updating

Update dash

cd ~/.dash
git pull
dash-update

Update Everything

dash-update --all

πŸ—‘οΈ Uninstallation

# Backup your .bashrc first!
cp ~/.bashrc ~/.bashrc.backup

# Remove dash loader from .bashrc
sed -i '/dash\/loader.sh/d' ~/.bashrc

# Remove dash directory
rm -rf ~/.dash

# Reload shell
source ~/.bashrc

🀝 Contributing

Contributions welcome! To add custom functions or configurations:

  1. Add functions to ~/.dash/functions/core.sh
  2. Add aliases to ~/.dash/config/bash_aliases
  3. Add completions to ~/.dash/completion/custom.sh

πŸ“ License

MIT License - See LICENSE file for details

πŸ™ Credits

dash integrates these amazing projects:

About

A self-contained, powerful bash enhancement framework.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages