DEV Community

Oliver Davies
Oliver Davies

Posted on • Originally published at oliverdavies.uk on

Introducing Versa - the versatile CLI tool

Today, I started to build a new open-source project - Versa, the versatile command-line tool that standardises common commands across projects.

After watching a Twitch streamer building something similar in Rust, I decided to build my take on it and add features I'd need, such as support for local vs Docker-based commands and to run different commands for different projects.

For example, versa run would need to run different commands for Drupal and Sculpin projects, versa test should support different test frameworks for the same language - e.g. PHPUnit, Pest and ParaTest for PHP - and the commands will need to be different in Docker Compose-based projects.

Currently, this logic is within my Build Configs project but can be moved to Versa.

This reduces the complexity within that codebase and means I can open-source it as it's a separate project.

At the moment, I've added PHP as the only supported language but I will add JavaScript/TypeScript support so it supports projects like Fractal.

It's still in the prototype phase and includes some initial commands, but the interesting parts will be making it clever.

Instead of running versa run --type sculpin, I'd like to just do versa run and have it determine the type of project automatically.

versa test should be able to determine the testing framework automatically based on what's in the project's composer.json file instead of having to specify it.

Likewise, for JavaScript, versa install should be able to determine if npm, yarn or pnpm is used.

That'll be where the more complex code will be added and when I start doing test-driven development - maybe with Behat, which is also something I've been thinking about for Build Configs.

Interested? Take a look at the code.

P.S. Are you still using Drupal 7 and donโ€™t know whatโ€™s involved to upgrade to Drupal 10? Book a Drupal 7 upgrade consultation call or an upgrade roadmap.

Top comments (0)