{"id":20451452,"url":"https://github.com/drsdavidsoft/artisan-root","last_synced_at":"2026-04-16T21:01:35.681Z","repository":{"id":103728543,"uuid":"574492942","full_name":"DRSDavidSoft/artisan-root","owner":"DRSDavidSoft","description":"🚀 Run artisan commands from any subdirectory in your Laravel project!","archived":false,"fork":false,"pushed_at":"2023-05-11T16:27:26.000Z","size":47,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-15T22:41:29.391Z","etag":null,"topics":["artisan","cli-utility","laravel","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DRSDavidSoft.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":"2022-12-05T12:41:03.000Z","updated_at":"2023-05-11T15:59:37.000Z","dependencies_parsed_at":"2023-07-13T03:30:32.372Z","dependency_job_id":null,"html_url":"https://github.com/DRSDavidSoft/artisan-root","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/DRSDavidSoft%2Fartisan-root","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DRSDavidSoft%2Fartisan-root/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DRSDavidSoft%2Fartisan-root/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DRSDavidSoft%2Fartisan-root/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DRSDavidSoft","download_url":"https://codeload.github.com/DRSDavidSoft/artisan-root/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242004209,"owners_count":20056417,"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":["artisan","cli-utility","laravel","php"],"created_at":"2024-11-15T10:58:50.445Z","updated_at":"2026-04-16T21:01:35.580Z","avatar_url":"https://github.com/DRSDavidSoft.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Artisan Root CLI\n----\n\n🚀 A handy CLI tool that lets you run Laravel's `artisan` command from any subdirectory of your project.\n\nNo more `cd`-ing back and forth. Just type `artisan` and enjoy the magic.\n\nWorks on Windows and Linux. Easy to install and use.\n\n## Description\n\nIf you are a Laravel developer, you know how often you need to run `artisan` commands to manage your project. Whether it's migrating your database, clearing your cache, or generating new files, `artisan` is your best friend.\n\nHowever, sometimes you may find yourself in a subdirectory of your project, such as `app/Http/Controllers` or `resources/views`, and you need to run an `artisan` command.  To do that, you need to be in the project's root directory.  This is inconvenient as sometimes you'll need to run artisan from a different folder.\n\nIn cases like this, either:  \n- You can `cd` back to the project root directory, run the command, and then `cd` back to where you were.\n- You can type the full path to the `artisan` file in the project root directory, such as `../../artisan`.\n\nBoth options are boring and time-consuming.  Wouldn't it be nice if you could just type `artisan` from anywhere in your project and have it work as expected?\n\nThat's where Artisan Root CLI comes in. It's a simple CLI script that finds and executes the `artisan` file in the project root directory for you. No matter where you are in your project, you can run any `artisan` command with ease.\n\n## Installation\n\nTo install simply download the script and place it in a folder that is in your system's PATH. Then, you can run any artisan command from any subdirectory of your Laravel project.\n\n### Windows\nOpen a Terminal with Administrator privileges, then:\n\n1. `mkdir C:\\ProgramData\\ArtisanRoot \u0026 cd C:\\ProgramData\\ArtisanRoot`\n2. `git clone https://github.com/DRSDavidSoft/artisan-root.git .`\n3. `systempropertiesadvanced.exe` → \u003ckbd\u003eEnvironment Variables...\u003c/kbd\u003e\n - Under **System Variables**, select `Path` and click on \u003ckbd\u003eEdit...\u003c/kbd\u003e\n - Click on \u003ckbd\u003eNew\u003c/kbd\u003e and enter: `C:\\ProgramData\\ArtisanRoot`\n - Click on \u003ckbd\u003eOK\u003c/kbd\u003e three times to save the changes.\n\n### Linux\nClone this repository to `/usr/local` and then create a symbolic link to the script in `/usr/local/bin`.\n\n1. `sudo git clone https://github.com/DRSDavidSoft/artisan-root.git /usr/local/artisan-root`\n2. `sudo ln -s /usr/local/artisan-root/artisan /usr/local/bin/artisan`\n\n## Usage\n\nTo use Artisan Root CLI, simply type `artisan` followed by any arguments or options that you would normally pass to the Laravel's `artisan` command.\n\nFor example:\n\n- To migrate your database: `artisan migrate`\n- To clear your cache: `artisan cache:clear`\n- To generate a new controller: `artisan make:controller PostController`\n\nYou can also use the `-h` or `--help` option to see all the available commands and options: `artisan -h`\n\n\u003cimg src=\"docs/demo.png\" width=\"340\" height=\"140\" /\u003e\n\nIf you run `artisan` in a folder that is not a Laravel project, the script will try to find the nearest parent folder that contains an `artisan` file. If it fails to find one, it will display an error message.\n\nFor example, if you run `artisan` in `/home/user/Documents`, but your Laravel project is in `/home/user/Projects/blog`, the script will look for an `artisan` file in these folders in order:\n\n- /home/user/Documents\n- /home/user\n- /home\n- /\n\nIf none of these folders contain an `artisan` file, the script will stop and show this message:\n\n**Exception:** Can not find artisan in the current directory structure.\n\n## Compatibility\n\nArtisan Root CLI works with any version of Laravel or **PHP 8** that supports the `artisan` command.\n\nIt requires PHP 8 or higher to run, as it uses some PHP 8 features such as `str_starts_with`.\n\nIf you are using an older version of PHP, you can either upgrade your PHP version or modify the script to use alternative functions.\n\n## Alternatives\n- **[artisan-anywhere](https://github.com/antonioribeiro/artisan-anywhere)**: A bash version of the same tool, by @antonioribeiro\n- [A small gist script](https://gist.github.com/jhoff/8fbe4116d74931751ecc9e8203dfb7c4?permalink_comment_id=4445619#gistcomment-4445619), by @sfinktah\n\n## License\nArtisan Root CLI is licensed under the GPL-3.0 license.\n\nCopyright © 2022-2023 by David Refoua \u003cDavid@Refoua.me\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrsdavidsoft%2Fartisan-root","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrsdavidsoft%2Fartisan-root","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrsdavidsoft%2Fartisan-root/lists"}