A comprehensive Zsh plugin that works with both Laravel Valet (Official) on macOS and Valet Linux on Ubuntu/Debian. Provides intelligent autocompletion, helpful aliases, and utility functions to streamline your local development workflow.
All valet commands have smart completionvalet <TAB>
valet link <TAB> # Shows available options
valet secure <TAB> # Shows unsecured sites
valet unsecure <TAB> # Shows secured sites
git clone https://github.com/a909m/valet-zsh-plugin.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/valet
Add valet
to your plugins in ~/.zshrc
:
# Add to ~/.zshrc zinit load "a909m/valet-zsh-plugin" # Or with lazy loading for better performance zinit ice wait lucid has'valet' zinit load "a909m/valet-zsh-plugin"
# Add to ~/.zshrc antigen bundle a909m/valet-zsh-plugin antigen apply
# Add to ~/.zshrc zplug "a909m/valet-zsh-plugin", defer:2
git clone https://github.com/a909m/valet-zsh-plugin.git ~/.zsh/plugins/valet echo "source ~/.zsh/plugins/valet/valet.plugin.zsh" >> ~/.zshrc
Then reload your shell:
Alias Command Descriptionvs
valet-status
Show comprehensive Valet status vo
valet-open
Open current site in browser vlh
valet-link-here
Link current directory vsh
valet-secure-here
Secure current site with HTTPS vl
valet links
List all linked sites vp
valet paths
List all parked paths vlog
valet-logs
View service logs vinfo
valet-info
Show environment information
# Quick status check vs # Link current directory as 'myproject' vlh myproject # Open current site in browser vo # Secure current site vsh # View nginx error logs vlog nginx # View PHP-FPM logs vlog php # All valet commands have smart completion valet <TAB> valet link <TAB> # Shows available options valet secure <TAB> # Shows unsecured sites valet unsecure <TAB> # Shows secured sites
Displays a comprehensive overview of your Valet installation with OS-specific service detection:
macOS Output:
🚀 Valet Status (Laravel Valet (Official) on macOS):
Plugin Manager: oh-my-zsh
=============================================
✅ Valet is installed
✅ nginx is running
✅ dnsmasq is running
✅ php is running
🌐 Domain: .test
🔗 Linked sites: 5
📁 Parked paths: 2
🐘 PHP: PHP 8.2.0
Linux Output:
🚀 Valet Status (Valet Linux on Linux):
Plugin Manager: zinit
============================================
✅ Valet is installed
✅ nginx is running
✅ dnsmasq is running
✅ php8.1-fpm is running
🌐 Domain: .test
🔗 Linked sites: 5
📁 Parked paths: 2
🐘 PHP: PHP 8.1.2
Opens the current directory's site in your default browser. Automatically detects HTTP/HTTPS and handles different browsers across platforms (uses open
on macOS, xdg-open
on Linux).
Shows detailed environment information:
🔍 Valet Environment Information:
=================================
Operating System: macOS
Valet Version: Laravel Valet (Official)
Plugin Manager: oh-my-zsh
Plugin Directory: ~/.oh-my-zsh/custom/plugins/valet
Valet Binary: /usr/local/bin/valet
Valet Version Output: Laravel Valet 3.3.2
PHP Information:
PHP Binary: /opt/homebrew/bin/php
PHP Version: PHP 8.2.0 (cli)
Links the current directory to Valet. Optionally accepts a custom name:
vlh # Links as current directory name vlh custom-name # Links as 'custom-name'
View real-time logs for Valet services with OS-specific paths:
macOS:
vlog nginx # View Nginx logs from Homebrew paths vlog php # View PHP-FPM logs from Homebrew paths
Linux:
vlog nginx # View Nginx error logs from /var/log/nginx/ vlog php-fpm # View PHP-FPM logs (auto-detects active version)
# Disable loading message export VALET_PLUGIN_SILENT_LOAD=true # Enable auto-updates (if plugin is git-cloned) export VALET_PLUGIN_AUTO_UPDATE=true # Set default TLD for valet-open function export VALET_PLUGIN_DEFAULT_TLD=test🌍 Platform-Specific Features macOS (Laravel Valet Official)
brew services
)valet use
command for PHP version switchingopen
command for browser launchingvalet status
commandvalet db
)xdg-open
for browser launchingCustomize the plugin behavior with environment variables in your ~/.zshrc
:
# Disable loading message export VALET_PLUGIN_SILENT_LOAD=true # Enable auto-updates (if plugin is git-cloned) export VALET_PLUGIN_AUTO_UPDATE=true # Set default TLD for valet-open function export VALET_PLUGIN_DEFAULT_TLD=test
Extend the plugin by adding your own functions to ~/.zshrc
:
# Custom function to quickly restart all Valet services valet-restart-all() { echo "🔄 Restarting all Valet services..." valet restart echo "✅ All services restarted!" } # Quick database creation for current project (Linux only) valet-db-create() { if [[ "$VALET_OS" == "Linux" ]]; then local db_name=${1:-$(basename $PWD)} echo "🗄️ Creating database: $db_name" valet db create "$db_name" else echo "Database commands are only available on Valet Linux" fi } # Platform-specific PHP switching valet-switch-php() { local version=$1 if [[ "$VALET_OS" == "macOS" ]]; then valet use "$version" else valet php "$version" fi }
Add your own aliases:
alias vr='valet restart' alias vdb='valet db' alias vphp='valet php'
Check Valet Installation:
which valet valet --version # Check plugin detection vinfo
Verify Plugin Location:
# For Oh My Zsh ls -la ~/.oh-my-zsh/custom/plugins/valet/ # For manual installation ls -la ~/.zsh/plugins/valet/
Test Plugin Manually:
source path/to/valet.plugin.zsh
brew services list
valet use php@8.2
to specify versionsudo usermod -a -G adm $USER sudo usermod -a -G www-data $USER
Reload completion system:
rm ~/.zcompdump* exec zsh
Check if completion is registered:
Test completion manually:
# Type and press TAB valet <TAB> valet link <TAB>
If you encounter permission issues with logs:
# macOS (if using custom Homebrew installation) sudo chown -R $(whoami) /opt/homebrew/var/log/ sudo chown -R $(whoami) /usr/local/var/log/ # Linux sudo usermod -a -G adm $USER sudo usermod -a -G www-data $USER # Logout and login again for group changes to take effect
Contributions are welcome! Here's how you can help:
git checkout -b feature/amazing-feature
git commit -m 'Add amazing feature'
git push origin feature/amazing-feature
# Clone your fork git clone https://github.com/a909m/universal-valet-zsh-plugin.git cd universal-valet-zsh-plugin # Test the plugin on your platform zsh -c "source valet.plugin.zsh && valet-status" zsh -c "source valet.plugin.zsh && vinfo" # Run tests (if available) ./test-compatibility.sh
When adding new features:
valet-*
for functions)$VALET_OS
and $VALET_VERSION
) for platform-specific codeThis project is licensed under the MIT License - see the LICENSE file for details.
⭐ Star this repo if you find it useful!
Made with ❤️ for the Laravel community
Compatible with Laravel Valet (macOS) and Valet Linux
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4