Skip to content

Instantly share code, notes, and snippets.

Forked from jhoff/
Created February 23, 2019 12:24
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Bash-only Laravel Artisan tab auto-complete

If you are an Oh-my-zsh user, see the Laravel 5 plugin

For the rest of us Bash users, all of the Laravel Artisan autocomplete solutions out there require installing a composer package to get a list of artisan commands. Turns out this isn't really necessary. Simply add the provided code in ~/.bash_profile ( or similarly sourced file ) and you'll get artisan command tab completes on any project on your system.

	COMMANDS=`php artisan --raw --no-ansi list | sed "s/[[:space:]].*//g"`
	return 0
complete -F _artisan art
complete -F _artisan artisan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment