Skip to content

AliQ80/binmy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

binmy

A bash utility for creating symlinks to scripts in ~/.local/bin to make them globally accessible from anywhere in your terminal.

Features

  • 🔗 Create symlinks for any script to make it globally accessible
  • 🛣️ Automatically adds ~/.local/bin to your PATH if not present
  • 🏷️ Support for custom symlink names
  • 🗑️ Easy removal of existing symlinks
  • 🐚 Works with bash, zsh, and fish shells
  • ✅ Automatically makes scripts executable

Installation

  1. Download the binmy script
  2. Make it executable: chmod +x binmy
  3. Use it to install itself: ./binmy binmy

Now you can use binmy from anywhere!

Usage

Create a symlink

# Create symlink with the script's name (minus .sh extension)
binmy /path/to/script.sh

# Create symlink with a custom name
binmy /path/to/script.sh --as my-command

Remove a symlink

binmy -R symlink-name

Help

binmy
# Shows usage information

Examples

Make a backup script globally accessible

# You have a script at ~/scripts/backup.sh
binmy ~/scripts/backup.sh

# Now you can run it from anywhere
backup

Install with a custom name

# Install a script with a shorter, more convenient name
binmy ~/development/very-long-script-name.sh --as deploy

# Use the shorter name
deploy

Manage your scripts

# Install multiple scripts
binmy ~/bin/git-sync.sh
binmy ~/tools/server-monitor.py --as monitor

# Remove when no longer needed
binmy -R git-sync
binmy -R monitor

How It Works

  1. Symlink Creation: Creates a symbolic link in ~/.local/bin pointing to your script
  2. PATH Management: Automatically adds ~/.local/bin to your shell's PATH if not already present
  3. Executable Permissions: Ensures your script has execute permissions
  4. Name Processing: Strips .sh extensions from default symlink names for cleaner commands

Requirements

  • Bash shell
  • Standard Unix utilities (ln, mkdir, chmod, realpath)
  • Write access to your home directory

Supported Shells

  • Bash: Updates ~/.bashrc
  • Zsh: Updates ~/.zshrc
  • Fish: Uses fish_add_path command

For other shells, you'll need to manually add ~/.local/bin to your PATH.

Why binmy?

Instead of:

  • Copying scripts to system directories (requires sudo)
  • Adding multiple directories to PATH
  • Creating aliases for every script
  • Remembering full paths to your scripts

Use binmy to:

  • Keep scripts in their original locations
  • Access them globally with simple commands
  • Easily manage and remove them when needed
  • Maintain a clean, organized ~/.local/bin directory

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages