small bash scripts to help my workflow day to day
- bash (...)
- fzf (...)
- jq (https://jqlang.org/download/)
- git (used only for git helpers)
-
For faster start time :
"C:/Program Files/Git/bin/bash.exe" --noprofile -i -
For faster ssh rendering : Use the powershell ssh implementation. Rendering is much faster
alias ssh='/c/Windows/System32/OpenSSH/ssh.exe'
Make the default sheel bash. Because zsh is not compatible with bash
# Source - https://stackoverflow.com/a
# Posted by larsks
# Retrieved 2026-01-23, License - CC BY-SA 3.0
exec bashUtilities for managing and navigating frequently used projects.
Projects are stored in:
~/bash_projects.json
Example:
{
"viridem": "/var/www/viridem",
"website": "/var/www/website",
"api": "/home/user/projects/api"
}Interactive project selector.
op- Displays all registered projects through
fzf. - Changes the current shell directory to the selected project.
opSelect:
viridem
Result:
cd /var/www/viridemOpen a project and launch Neovim.
opv- Select a project.
- Change to the project directory.
- Launch:
nvim .Register a project.
add_project <name>
add_project <name> <path>Add the current directory:
add_project viridemAdd a specific directory:
add_project api /home/user/projects/apiResult:
✓ Project 'api' → /home/user/projects/api
- Automatically creates
~/bash_projects.jsonif missing. - Paths are normalized to absolute paths.
- Requires
jq.
Remove a registered project.
remove_project <name>remove_project apiResult:
🗑️ Removed project 'api'
- Requires
jq. - Automatically refreshes the in-memory project list.
Interactive project removal.
opr- Select a project from
fzf. - Confirm deletion.
- Remove the project entry from
~/bash_projects.json.
Example:
Delete project 'api'?
[y/N]
Display all registered projects.
list_projectsviridem -> /var/www/viridem
website -> /var/www/website
api -> /home/user/projects/api
Reload projects from disk.
refresh_projects🔄 Reloading projects...
✅ Projects reloaded (12 entries)
Useful after manually editing:
~/bash_projects.json
Navigate directly to a project by name.
go_to_project <name>go_to_project viridemResult:
cd /var/www/viridemUsed for adding and removing projects.
Ubuntu/Debian:
sudo apt install jqFedora:
sudo dnf install jqmacOS:
brew install jqUsed for interactive project selection.
Ubuntu/Debian:
sudo apt install fzfmacOS:
brew install fzfAdd your current project:
add_project viridemJump to a project:
opOpen a project in Neovim:
opvRemove a project:
oprA collection of Git helper functions for branch creation, checkout, pulling, stash management, and repository cleanup.
Create a Git branch from a Jira ticket number or Jira URL.
create_branch_from_ticket <ticket-number>
create_branch_from_ticket <jira-url>
create_branch_from_ticket -p <prefix> <ticket-number>
create_branch_from_ticket --prefix <prefix> <ticket-number>
create_branch_from_ticket -n <branch-name>
create_branch_from_ticket --name <branch-name>Create a branch from ticket 12345 using the default prefix (BSP):
create_branch_from_ticket 12345Result:
feature/BSP-12345
Create a branch using a custom prefix:
create_branch_from_ticket -p ABC 12345Result:
feature/ABC-12345
Create a branch from a Jira URL:
create_branch_from_ticket https://jira.company.com/browse/BSP-12345Create a branch without any ticket prefix:
create_branch_from_ticket -n my-custom-branch-
Fetches remote branches.
-
Detects existing branches containing the ticket number.
-
Allows:
- Switching to an existing branch.
- Creating a new branch.
-
Prompts for a base branch.
- Prefers
release/*andhotfix/*branches.
- Prefers
-
Prompts for branch type:
featurebugfix
-
Optionally adds a suffix.
-
Creates and checks out the branch.
-
Offers to restore any stashed changes.
feature/BSP-12345
feature/BSP-12345-v1
bugfix/BSP-12345-fix-validation
Interactive branch checkout.
git_checkout- Fetches local and remote branches.
- Displays all available branches through
fzf. - Checks out the selected branch.
gcInteractive stash restoration helper.
apply_stashAllows you to:
- Show stash summary
- Show detailed patch
- Apply stash
- Skip stash restoration
Show stash?
├─ yes
│ ├─ Show details?
│ └─ Apply stash?
├─ apply
└─ skip
Shortcut for opening the stash recovery workflow.
git_stash_showDelete local branches whose remote counterparts no longer exist.
gcleangit fetch -p
git branch -vv \
| grep ': gone]' \
| awk '{print $1}' \
| xargs git branch -DBefore:
feature/BSP-1001
feature/BSP-1002
feature/BSP-1003
After remote cleanup:
gcleanDeleted:
feature/BSP-1002
feature/BSP-1003
For a README, I'd keep this one short since it's a single-purpose utility.
Helpers for creating Bitbucket pull requests directly from the command line.
Alias for pra.
prCreate a Bitbucket Pull Request URL for the current branch.
pra-
Prompts for the destination branch.
-
Detects:
- Current Git repository
- Repository owner/workspace
- Repository name
- Current branch
-
Builds a Bitbucket Pull Request URL.
-
Opens the URL in your browser.
Current branch:
feature/BSP-12345-fix-validation
Selected destination branch:
release/2026.06
Generated URL:
https://bitbucket.org/company/my-repo/pull-requests/new?source=feature/BSP-12345-fix-validation&dest=release/2026.06
The browser opens directly on Bitbucket's Create Pull Request page with the source and destination branches already populated.
The repository must have an origin remote configured:
git remote -vExample:
origin git@bitbucket.org:company/my-repo.git
or
origin https://bitbucket.org/company/my-repo.git
This command relies on:
git_select_base_branchto choose the target branch for the pull request.
# Create a feature branch
create_branch_from_ticket 12345
# Work on your changes
git add .
git commit
# Push branch
git push -u origin HEAD
# Create pull request
pr- No need to manually navigate to Bitbucket.
- Automatically detects the current branch.
- Reduces mistakes when selecting source/destination branches.
- Integrates with the branch-selection workflow already used by other Git utilities.
- Add spinner program
- add spinner for thing taht take time. like fetching
- Add protection
- Git (if not installed.)
- ... jq