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 opening
Example:
work frontend # Opens VS Code in /path/to/your/projects/frontend
Use 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-app
The 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 it
The 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
- 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/utils.sh"
source "${HOME}/shell-utils/work.sh"
source "${HOME}/shell-utils/sail.sh"
source "${HOME}/shell-utils/file-organizer.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.