Terminal aliases for faster and more convenient work with the terminal. Mainly focused on git and terraform work.
Using Oh-my-zsh:
- Clone this repository in oh-my-zsh's plugins directory:
git clone https://github.com/dvir-levy/terminal-aliases.git ~/.oh-my-zsh/custom/plugins/terminal-aliases
- Activate the plugin in ~/.zshrc
NOTE: add the plugin last in order so it could overwrite other aliases if any.
plugins=(
plugin1
plugin2
...
teminal-aliases
)
- Set the WORKSPACE_PATH environment variable to your own workspace directory that include your repos.
NOTE: The environment variable must be set before the plugins call in ~/.zshrc
export WORKSPACE_PATH=<MY_WORKSPACE>
The following script adds it to the beginning of ~/.zshrc. Make sure to change <MY_WORKSPACE> to your workspaces path.
echo "export WORKSPACE_PATH=<MY_WORKSPACE>" > ~/.zshrc.tmp
echo "" >> ~/.zshrc.tmp
cat ~/.zshrc >> ~/.zshrc.tmp
mv ~/.zshrc.tmp ~/.zshrc
echo "# terminal-aliases plugin" > ~/.zshrc.tmp
echo "" >> ~/.zshrc.tmp
cat ~/.zshrc >> ~/.zshrc.tmp
mv ~/.zshrc.tmp ~/.zshrc
NOTE: the folders structure should be single workspace with several repos in it. for example:
.my-workspace
├──repo1
├──repo2
├──repo3
├──terraform-repo1
└──terraform-repo2
- Run exec zsh to take changes into account:
exec zsh
Using zplug:
- Add this repo to
~/.zshrc
:
zplug "dvir-levy/terminal-aliases", as: plugin
![color picker](https://private-user-images.githubusercontent.com/79982395/293469974-a04d81c9-0742-4997-982e-1bb883846d86.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ2ODU0MjQsIm5iZiI6MTcyNDY4NTEyNCwicGF0aCI6Ii83OTk4MjM5NS8yOTM0Njk5NzQtYTA0ZDgxYzktMDc0Mi00OTk3LTk4MmUtMWJiODgzODQ2ZDg2LmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI2VDE1MTIwNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFjMjc0NThkYjY0YTRlMzVlYmViYWI1ZDNlMWM2YmQ0ZjlkNDZkODk3YmYyNzgzYTkxYzQ3Y2ZiYWNiMDQxZmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ADH7KsUPP49jxXTscF9bqDoHrBC51-_M5FXoaMTKzAo)
- git checkout to main/master and pull
gcm
- git status
gst
- Create new GitHub Pull Request
newpr my_new_pr_name SECURITY-357
NOTE: the branch should be main/master and commit changes should be made locally on master. the alias will makes sure to create new branch and pull request.
- 'git add' to all changes, 'git commit' with your custom comment and 'git push' - all together
gam "added debugging methods"
- change directory to a repo and show its content
repo1
- terraform apply
ta
- terraform init + terraform plan
tip
This repo is licensed under the terms of the MIT Open Source license and is available for free. Feel free to open pull request and help improve it