GitHub

I want to create and use my own list of custom aliases and functions


Oftentimes, you might want to create special files that group common commands or functions.

Let's say you have a folder called my_scripts.

During your normal work you interact with Docker and AWS, so you want to create separate aliases for common commands.

You can create a .docker_commands file, with possibly the following contents:

# get all containers
alias get-all-containers='docker ps'
    
# remove all containers and images
alias remove-all='docker system prune'

Notice you can add as many lines of comments to the file as you want.

You can then register the file:

bee -register $HOME/my_scripts/.docker_commands

You can do the same for AWS commands. In .aws_commands you might add these aliases:

# get the current aws version
alias aws-v='aws --version'
    
# where is the aws cli installed
alias aws-w='which aws'

and can also register the file:

bee -register $HOME/my_scripts/.aws_commands

From now on you can call on bee to help you search and run through all of them.

Note that you'll need to use the absolute path to these files. Using relative paths might cause unexpected behaviour.