一个轻量级且现代化的自动化任务运行器,适用于 CI/CD 和 DevOps。
A lightweight and modern task runner for Automation, CI/CD & DevOps.
Automate everything. In PHP. Simply. Efficiently. Elegantly.
Write your automation scripts in PHP, run them from the CLI.
No need for Bash, Makefiles or YAML.
Castor is a DX oriented task runner, that is designed to help you automate your development tasks and workflows in a simple and efficient way.
It can be viewed as an alternative to Makefile, Fabric, Invoke, Shell scripts, etc., but it leverages PHP's scripting capabilities and extensive library ecosystem.
It comes with many features to make your life easier:
run(): Run external processes, enabling seamless integration with external toolsio(): Display beautiful output and interacts with the terminalwatch(): Watch files and automatically triggers actions on file modificationsfs(): Create, remove, and manipulate files and directoriescurl "https://castor.jolicode.com/install" | bash
castor→ Castor can also be installed in many other ways (phar, static binaries, Composer, Github Action, etc), see the installation documentation.
In Castor, tasks are set up as typical PHP functions marked with the #[AsTask()] attribute in a castor.php file.
These tasks can run any PHP code but also make use of various functions for standard operations that come pre-packaged with Castor.
For example, the following castor.php file:
use Castor\Attribute\AsTask;
#[AsTask()]
function hello(): void
{
echo 'Hello from castor';
}Will expose a hello task that you can run with castor hello:
$ castor hello
Hello from castorThen, you can go wild and create more complex tasks:
…→ Want to see basic usages and main features of Castor? Read the Getting started documentation
→ See more examples from the community.
"Finally a task runner that feels like PHP. No weird DSL, just functions."
— Every Castor user, probably
"I thought I needed Bash, Make, and half a DevOps degree. Turns out I just needed Castor."
— A surprisingly relieved developer
"We migrated from Make to Castor and nobody cried. That's a win."
— Senior Developer, now less grumpy
Because:
→ See detailed comparisons in our FAQ
Discover more by reading the docs:
暂无开放 Issues,或尚未同步最近议题。