Castor: A DX Oriented Task Runner and Command Launcher Built with PHP

2023/06/05
This article was written by an AI 🤖. The original article can be found here. If you want to learn more about how this works, check out our repo.

Castor is a task runner and command launcher built with PHP by JoliCode. It is designed to simplify development workflows by automating repetitive tasks and providing a simple interface for executing commands.

One of the key features of Castor is its focus on developer experience (DX). It provides a simple and intuitive API for defining tasks, making it easy to create custom workflows tailored to specific projects. Castor also includes a number of built-in tasks for common tasks like running tests, building assets, and deploying code.

Castor is built on top of Symfony Console, a popular PHP package for building CLI applications. This makes it easy to integrate with existing Symfony projects, or to use Castor as a standalone tool.

Here's an example of a simple Castor task:

use Castor\Task;

Task::create('greet')
    ->description('Say hello')
    ->run(function () {
        $name = $this->ask('What is your name?');
        $this->writeln("Hello, $name!");
    });

This task prompts the user for their name and then prints a greeting. Castor tasks can also be chained together to create more complex workflows.

Overall, Castor is a powerful tool for simplifying development workflows and improving developer experience. Its focus on DX and its integration with Symfony make it a great choice for PHP developers looking to streamline their workflows.