Webware-console (Improving laminas-cli/mezzio-tooling DX)

(Full disclosure, I used an LLM to help prototype the proof of concept)

So mezzio-tooling is awesome, but my short-term memory is not the best in the world so I find myself constantly bouncing back and forth between the docs (or the commands code) to track down what options can be used with which commands. So, I asked myself - what if mezzio-tooling had a Menu?

I’m currently working on a set of components that will build on top of mezzio and one of them is a user manager and acl manager that needs database tables initialized just after composer installs them so I was working on providing cli commands and wanted a way to present a developer (mostly myself) with an easy-to-use cli command to build the required table and their user.

So, to make a long story short I used PSL and built a TUI in front of laminas-cli/mezzio-tooling which provides a Menu command.

It marks which arguments are required and validates that all required options are present and it reads the help text for the currently selected argument/option and presents it in the footer as you navigate through each one. It works but its super simple at the moment.. I built it for personal use but was curious if anyone else thinks something like this would be useful?

Currently it works for what I need in development and it works with the few laminas commands I’ve tested it with. Not tried it with mezzio commands yet since I need to check if mezzio-tooling can be installed with the component versions I am using.

1 Like

An overhaul to make it easier and better to use is absolutely essential, as is, of course, the addition of further commands.
So the questions you’ve asked are spot on, and the results so far look good! Would you be interested in directly developing mezzio-tooling further?

1 Like

Possibly, is there any project tracking for mezzio-tooling? I only ask because sometimes I’ve found that the tracking is not always with the repo :slight_smile: So figured I would ask. Just curious if there is any direction, hard plans etc for it so far?

Well, to build what I have built there would take a lot of work (without using PSL) since I used PSL terminal to build the TUI. PSL has a min php version of 8.4 which makes it out of reach for a while (iirc about 26 months).

Symfony console, as far as I am aware, does not provide everything that is required to build the TUI. The TUI menu is what provides the arrow navigation and surfaces the help messages in the footer row you see in the screenshots. PSL also does some heavy lifting to provide support for windows. I know very little about scripting for windows terminal / power shell / whatever they call it these days.

With that said, putting in the work now to expand the mezzio-tooling commands available to a future TUI would be well worth the time.

I will continue developing the TUI and when mezzio’s min php version comes up enough to support it then if the code is determined to be good enough, I will transfer it to Mezzio and continue developing it.

Between now and then I will get more involved with mezzio-tooling as time allows because I really believe there is real value to be gained there in terms of helping mezzio adoption.

The menu is excellent and exactly what I’d expect as a user. :+1:
I’ll take a closer look at the repository for that.

Similar but approaches it in a slightly different way.

Opt-in wrapping for 3rd party commands · Issue #25 · laminas/laminas-cli

And, after testing webware-console on windows there’s a few things that has to be addressed.

The proof of concept can be found here.
webinertia/webware-console: Webware Console — TUI app providing a menu and better help for Webware and Mezzio CLI commands