ubolt
v1.3.0
Published
A command line app for managing command line aliases per directory
Readme
ubolt
A simple command alias utility that helps manage global user aliases along with per-directory aliases.
To install:
npm install -g uboltUser configuration
For user level commands, create a .ubolt.yaml file in your home directory. In the file, add an entry for any global command alias you want.
For example:
status:
command: git status
description: Perform a git status
pull:
command: git pull
description: Perform a git pullNow you can execute these commands anywhere by simply:
ubolt status
ubolt pullCreating aliases for these commands isn't that useful, but when you have a really long command line like when using docker, this becomes really helpful!
Local configuration
What makes ubolt more awesome is setting up local command aliases. Unlike the aliases you set in the shell, having directory level aliases lets you put
project specific commands that will only show up when executing ubolt while that directory is your current directory. For example:
ubolt-info:
command: npm info ubolt
description: Display npm information for uboltNow only when you are in this directory you can execute:
ubolt ubolt-infoGlobal alias
I suggest you setup an alias for ubolt itself to something very short. If you are using zsh, then you can create an alias like this in your .zshrc:
alias u=uboltThen the commands are even less verbose:
u status
u pull
u ubolt-infoAlias discovery
If you just type in ubolt, or give it an alias not found, it will display all the user & local aliases it can find, based on your current directory.
Multiple commands
If you want an alias to execute multiple commands, just use commands: instead of command: in your yaml. For example:
master:
commands:
- git checkout master
- git pull
description: Return to master and pull latestNote that if one of the commands fails, the execution will stop.
Command line arguments
You can pass arguments to the commands by just including them after ubolt alias. Inside your .ubolt.yaml file just put $1, $2, etc. to have the arguments replaced. These
arguments always start with $1. For example here would be how you specify the argument in your .ubolt.yaml:
files:
command: ls $1And to pass it when executing:
ubolt files -laNaming
I wanted to make a very fast alias command executor, so why not name it after the worlds fastest man?
