Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jgarc186's avatar

Building an Artisan clone using Shell

Good afternoon friends! I'm currently working for a company that has its own custom build framework, we are trying to migrate to laravel, but it is going to take us a long time before we get there. In the meantime we are starting to mimic a lot of the ways that Laravel does things, one thing that we are trying to figure out is to create a clone of artisan using PowerShell scripting (We are an MS shop), any guide, tutorials, or recommendations on how to implement such clone? Thank you for your time and attention!

0 likes
10 replies
azbx's avatar

The easiest thing is to look at how artisan works and then build up from there.

How it works is it registers an auto leader to get composter packages then creates and runs a variable

named $terminal.

2 likes
Snapey's avatar

just run artisan?

If you install laravel alongside your other project, you can run artisan commands. What that actually means is huge scope, from as simple as clearing cache, publishing stubs through to running queue jobs. You need to think about what might be useful to you in this process

2 likes
azbx's avatar

@Snapey exactly. But it seems that they want the easiness of laravel rewritten in PowerShell.

2 likes
jgarc186's avatar

@aeothegod Yes sir, my team is buying into the idea of implementing Laravel but it is going to take us a while to get there in the meantime have a custom solution as we do the migration etc.

1 like
jgarc186's avatar

@Snapey We can implement it in PHP, I just find Shell to be straight to the point and since we are an MS shop PowerShell is what we use on a day-to-day basis in our servers, etc.

1 like
martinbean's avatar

@jgarc186 I don’t understand. You say that migrating to Laravel is taking a long time, so one of your ideas is to spend time creating a clone in something completely different instead of just using Artisan?

How is spending time writing something from scratch going to help you move to Laravel faster? It’s going to make the migration slower if you’re now spending your time re-creating features in another language in the meantime.

1 like
jgarc186's avatar

@martinbean that's a fair point, but the question I guess I am finding myself is how can I integrate Artisan to our custom framework? There is not a package for Artisan outside the Laravel ecosystem that can be plugin into our current system, is there? We don't have to have all the functionalities that Artisan provides, but creating controllers, models, etc from the command line or PowerShell is extremely convenient, and I think it will generate more buying into accelerating the idea of fully migrating to Laravel.

1 like
martinbean's avatar

@jgarc186 I don’t really understand the problem. Artisan is a utility, written in PHP. You can invoke it in any command line prompt. How do you think Laravel developers on Windows work?

1 like
jgarc186's avatar

@martinbean Yes I agree with you, I currently use artisan commands for my own personal Laravel projects using my windows machine. But at work we don't use Laravel, we have our own custom framework and we would like to migrate it to Laravel, but this is going to take us a long time to get there (too much spaghetti code to untangle and technical debt). In the meantime I would like to write something small, not too complex in PowerShell or PHP or whatever, that can give us a small functionality of Artisan (example, creating Models, Controllers etc) or just bring a composer package that has the bare minimum of what Artisan has to offer, that way I feel like it would bring more curiosity within my team to keep learning Laravel and be more intentional about the migration.

1 like

Please or to participate in this conversation.