{"id":16926841,"url":"https://github.com/jessarcher/zsh-artisan","last_synced_at":"2025-04-04T07:08:52.075Z","repository":{"id":37829826,"uuid":"154782102","full_name":"jessarcher/zsh-artisan","owner":"jessarcher","description":"Laravel artisan plugin for zsh to help you to run artisan from anywhere in the project tree, with auto-completion, and it can automatically open files created by artisan!","archived":false,"fork":false,"pushed_at":"2024-07-22T10:00:22.000Z","size":59,"stargazers_count":618,"open_issues_count":14,"forks_count":39,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-10-14T20:31:45.363Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jessarcher.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-26T05:31:28.000Z","updated_at":"2024-10-13T21:07:03.000Z","dependencies_parsed_at":"2024-01-23T15:11:52.788Z","dependency_job_id":"f87ab5b0-caf2-4a2d-bd96-45c8ada59565","html_url":"https://github.com/jessarcher/zsh-artisan","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jessarcher%2Fzsh-artisan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jessarcher%2Fzsh-artisan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jessarcher%2Fzsh-artisan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jessarcher%2Fzsh-artisan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jessarcher","download_url":"https://codeload.github.com/jessarcher/zsh-artisan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247135144,"owners_count":20889421,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T20:31:50.403Z","updated_at":"2025-04-04T07:08:52.045Z","avatar_url":"https://github.com/jessarcher.png","language":"Shell","funding_links":[],"categories":["Plugins"],"sub_categories":["ZSH on Windows","Zinit (née zplugin)"],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://jessarcher.github.io/zsh-artisan/logo.svg?1\" alt=\"zsh-artisan - Enhanced Laravel integration for zsh\" width=\"400\"\u003e\n\u003c/p\u003e\n\nThis plugin adds an `artisan` shell command with the following features:\n\n* It will find and execute `artisan` from anywhere within the project file tree\n  (and you don't need to prefix it with `php` or `./`)\n* It provides auto-completion for `artisan` commands (that also work anywhere\n  within the project).\n* You can specify an editor to automatically open new files created by `artisan\n  make:*` commands\n* It automatically runs artisan commands using `sail` when appropriate.\n* It will run commands using `docker compose` (or `docker-compose`) if a known container name is found.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://jessarcher.github.io/zsh-artisan/demo.svg?1\"\u003e\n\u003c/p\u003e\n\n## Requirements\n\n* [Zsh](https://www.zsh.org/)\n* A Zsh package manager (e.g. [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh), [Antigen](https://github.com/zsh-users/antigen), or [zplug](https://github.com/zplug/zplug))\n* A [Laravel](https://laravel.com/) project\n\n## Installation\n\n### [Antigen](https://github.com/zsh-users/antigen)\n\nAdd the following bundle to your `.zshrc`:\n\n```zsh\nantigen bundle jessarcher/zsh-artisan\n```\n\n### [Fig](https://fig.io)\n\nFig adds apps, shortcuts, and autocomplete to your existing terminal.\n\nInstall `artisan` in just one click.\n\n\u003ca href=\"https://fig.io/plugins/other/zsh-artisan_jessarcher\" target=\"_blank\"\u003e\u003cimg src=\"https://fig.io/badges/install-with-fig.svg\" /\u003e\u003c/a\u003e\n\n### Oh-my-zsh\n\nFirst download the plugin to your oh-my-zsh custom plugin location:\n\n```zsh\ngit clone https://github.com/jessarcher/zsh-artisan.git ~/.oh-my-zsh/custom/plugins/artisan\n```\n\n\u003e Note that the repository name is prefixed with `zsh-`, however the plugin\n\u003e directory name should just be \"artisan\".\n\nThen enable the plugin in your `.zshrc` file. For example:\n\n```zsh\nplugins=(\n    artisan\n    composer\n    git\n)\n```\n\n### [zplug](https://github.com/zplug/zplug)\n\nAdd the following to your `.zshrc`:\n\n```zsh\nzplug \"jessarcher/zsh-artisan\"\n```\n\n## Configuration\n\nIf you wish to automatically open new files created by `artisan make:*` commands\nthen you will need to configure the `ARTISAN_OPEN_ON_MAKE_EDITOR` environment\nvariable. The best place for this is probably your `.zshrc` file. For example:\n\n```zsh\nARTISAN_OPEN_ON_MAKE_EDITOR=vim\n#ARTISAN_OPEN_ON_MAKE_EDITOR=subl   # Sublime Text\n#ARTISAN_OPEN_ON_MAKE_EDITOR=pstorm # PHPStorm\n#ARTISAN_OPEN_ON_MAKE_EDITOR=atom   # Atom (May require shell commands to be enabled)\n#ARTISAN_OPEN_ON_MAKE_EDITOR=code   # VSCode (May require shell commands to be enabled)\n```\n\n\u003e The author uses [mhinz/neovim-remote](https://github.com/mhinz/neovim-remote),\ncombined with a wrapper script, to automatically open files in an existing neovim\nsession within the same tmux session, and automatically switch to the correct\ntmux window (tab).\n\nNote that you will need to re-source your `.zshrc` or restart `zsh` to pick up\nthe changes.\n\n## Usage\n\nSimply use the command `artisan` from anywhere within the directory structure of\na Laravel project and it will search up the tree for the `artisan` command and\nexecute it. E.g:\n\n```zshrc\n$ pwd\n~/MyProject/tests/Feature\n\n$ artisan make:model MyAwesomeModel\nModel created successfully.\n```\n\nTab-completion will work anywhere that `artisan` can be found, and the available\ncommands are retrieved on-demand. This means that you will see any Artisan\ncommands that are available to you, including any custom commands that have\nbeen defined.\n\nIf you configured the `ARTISAN_OPEN_ON_MAKE_EDITOR` environment variable, any\nfiles created by `artisan make:*` commands should automatically be opened,\nincluding when multiple files are created (E.g. by `artisan make:model -m -c -r`)\n\nThe plugin does not create any aliases for you, but the author would like to\noffer some suggestions:\n\n```zsh\nalias a=\"artisan\"\nalias tinker=\"artisan tinker\"\nalias serve=\"artisan serve\"\n```\n\nMany more can be found at https://laravel-news.com/bash-aliases\n\n## Homestead Setup\n\nThe Zsh Artisan plugin can be installed automatically with any new or provisioned Laravel Homestead instance. \nIn the root of your Homestead project, add the following to your `after.sh` file. \n```bash\nARTISAN=/home/vagrant/.oh-my-zsh/custom/plugins/artisan\nif [ -d \"$ARTISAN\" ]; then\n  echo \"$ARTISAN exist\"\nelse\n  git clone https://github.com/jessarcher/zsh-artisan.git $ARTISAN\n  sed -i 's/plugins=(git)/plugins=(git composer artisan)/g' /home/vagrant/.zshrc\n  source /home/vagrant/.zshrc\nfi\n```\n*Note:* If you are re-provisioning your Homestead box, and already have other Zsh plugins defined in your Zsh config files, you wil need to adjust the `sed` command to includes those in the list. \n\n## License\n\nThis project is open-sourced software licensed under the MIT License - see the\n[LICENSE](LICENSE) file for details\n\n## Acknowledgements\n\n* [antonioribeiro/artisan-anywhere](https://github.com/antonioribeiro/artisan-anywhere)\n  for some of the initial artisan location logic\n* The `laravel5` plugin that comes with oh-my-zsh for the initial completion\n  logic\n* [ahuggins/open-on-make](https://github.com/ahuggins/open-on-make) for the\n  \"open on make\" functionality idea. Unfortunately, adding a dev dependency like\n  this isn't an option on some of the projects I work on.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjessarcher%2Fzsh-artisan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjessarcher%2Fzsh-artisan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjessarcher%2Fzsh-artisan/lists"}