Coder Social home page Coder Social logo

aliasman's Introduction

Love your aliases again! ๐Ÿฅธ

A cross-shell (POSIX-compliant) alias manager for bash, zsh, and fish

aliasman gc 'git commit -m'

What's an alias?

An alias is just shorthand for a shell function.

Take a long command like this:

git commit -m "feat: new feature"

And turn it into a short command, like this:

gc "feat: new feature"

(that would be aliasman gc 'git commit -m')

Install

Mac, Linux via webi (https://webinstall.dev/aliasman):

curl -sS https://webi.sh/aliasman | sh
source ~/.config/envman/PATH.env

GitHub Releases:

# pick version
my_version="v1.0.0"

# download and unpack
curl -o "aliasman-${my_version}.tar.gz" \
    -fL "https://github.com/BeyondCodeBootcamp/aliasman/archive/refs/tags/${my_version}.tar.gz"
tar xvf "aliasman-${my_version}.tar.gz"

# install to somewhere in your PATH
mkdir -p ~/bin
mv ./aliasman-*/aliasman ~/bin/

Usage

USAGE

    # Set alias
    aliasman [--] <aliasname> <command> [flags, opts, args, pipes, etc]

    # Check alias
    aliasman [--] <aliasname>

    # Delete alias
    aliasman -d [--] <aliasname>

    aliasman help
    aliasman version

EXAMPLES

    aliasman curl curlie
    aliasman ls lsd -F
    aliasman la lsd -AF
    aliasman ll lsd -lAhF
    aliasman tree lsd -F --tree
    aliasman xrnd xxd -l24 -ps /dev/urandom

FILES

    ~/.bashrc
    ~/.config/envman/alias.env
    ~/.config/envman/load.sh
    ~/.config/envman/load.fish
    ~/.config/fish/config.fish
    ~/.profile
    ~/.zshrc

NOTES

    You may use single quotes around the alias definition, like so:

        # generate 24 random bytes, url-safe base64-encoded
        aliasman rnd 'xxd -l24 -ps /dev/urandom |
                          xxd -r -ps |
                          base64 |
                          tr -d = |
                          tr + - |
                          tr / _'

    However, the use of single quotes as part of flags, options, and arguments
    is not yet supported. Neither are newlines.

Imagine the possibilities!

  1. What if you could quickly create a command, ll,
    that does the work of ls -lAhF!?
  2. Set an alias to do just that!
    aliasman ll 'ls -lAhF'
  3. Reload your alias config (or open a new terminal)
    source ~/.config/envman/alias.env
  4. Use it!
    ll
    drwxr-xr-x aj wheel 416 B  Thu Feb  9 02:08:39 2023 ๐Ÿ“‚ .git/
    .rwxr-xr-x aj staff 6.2 KB Thu Feb  9 01:36:30 2023 ๐Ÿ’ป aliasman*
    .rw-r--r-- aj wheel  16 KB Wed Feb  8 21:51:06 2023 ๐Ÿ”‘ LICENSE
    .rw-r--r-- aj wheel 1.4 KB Thu Feb  9 01:47:13 2023 ๐Ÿ“„ README.md
    

Common Aliases

Use aliases to make other tools you find around webi even more convenient โšก๏ธ (and powerful ๐Ÿ’ช).

aliasman curl 'curlie'

aliasman diffy 'diff -y --suppress-common-lines'

aliasman gc 'git commit -m'
aliasman gri 'git rebase -i'

aliasman la 'lsd -AF'
aliasman ll 'lsd -lAhF'
aliasman ls 'lsd -F'

aliasman rgi 'rg -i'

aliasman tree 'lsd -F --tree --group-dirs=last'

# random password generator
aliasman rnd 'xxd -l24 -ps /dev/urandom'

aliasman's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.