Collection of simple shell functionalities to enhance your development workflow.
Quickly open VS Code in your project directories with smart tab completion.
- Opens VS Code in workspace directories under a configured base path
- Tab completion for available project folders
- Directory existence validation
- Compatible with both bash and zsh
- Optional terminal auto-close after launching VS Code
work [-c] <project-name> # -c flag keep terminal alive after openingExample:
work frontend # Opens VS Code in /path/to/your/projects/frontendUse TAB after typing work for directory autocompletion.
Automates the creation and initial setup of Laravel projects using Laravel Sail.
- Creates new Laravel project with Sail
- Starts Docker containers automatically
- Smart health checking for application readiness
- Runs initial database migrations
- Provides helpful feedback and progress indicators
- Maximum 60-second timeout for startup
sail-init <project-name>Example:
sail-init my-new-appThe script will:
- Create a new Laravel project
- Start Sail containers
- Wait for the application to be ready (health checks)
- Run database migrations
- Display useful Sail commands
Organizes files with the same base name and different extensions into a dedicated folder.
- Moves files with specified base name and extensions into a new directory
- Comprehensive error handling and input validation
- Detailed logging to both console and log file
- Compatible with both bash and zsh
- Production-level script with best practices
file-organizer <base_name> <extension1> [extension2] ...Example:
file-organizer myfile txt pdf doc # Creates myfile/ and moves myfile.txt, myfile.pdf, myfile.doc into itThe script will:
- Create a timestamped log file in /tmp
- Validate all inputs and file existence
- Create the target directory if needed
- Move matching files
- Clean up empty directories if no files were moved
- Provide detailed feedback of all operations
Automatically switches Node.js versions when changing directories based on .nvmrc files.
- Automatically detects
.nvmrcfiles in project directories - Switches Node.js version when changing directories
- Installs required Node.js version if not present
- Falls back to default version when leaving a project directory
- Compatible with zsh shell
- Integrates with nvm (Node Version Manager)
The functionality is automatic after installation. Simply:
cd your-project # Auto-switches to Node version in .nvmrc
cd .. # Auto-switches back to default Node versionRequirements:
- zsh shell
- nvm (Node Version Manager) installed and initialized
- Clone the repository to the shell utilities directory:
git clone https://github.com/yourusername/shell-utils.git "${HOME}/shell-utils"- For
work.sh, set your projects base path by editing the script or adding to your shell config:
export BASE_PATH="/path/to/your/projects"- Source the utilities and scripts in your shell configuration file:
# Add to ~/.bashrc or ~/.zshrc
source "${HOME}/shell-utils/src/utils.sh"
source "${HOME}/shell-utils/src/work.sh"
source "${HOME}/shell-utils/src/auto-nvm.sh"
...or
eval "source ${HOME}/shell-utils/src/{utils,auto-nvm,work,...}.sh"- Create the logs directory:
mkdir -p "${HOME}/.logs/shell-utils"- Reload your shell configuration:
source ~/.bashrc # or ~/.zshrc${HOME}/
├── shell-utils/
│ ├── utils.sh
│ ├── work.sh
│ ├── sail.sh
│ └── file-organizer.sh
└── .logs/
└── shell-utils/
└── [script logs]
Feel free to suggest improvements or add new utilities to enhance the collection.