Style your CLI applications with Termwind


Termwind is like Tailwind CSS, it is for styling your PHP CLI applications.

Getting started with Termwind

Termwind enables developers to seamlessly integrate Tailwind-like CSS classes directly into their PHP code, facilitating stylish CLI outputs.

To get started with using Termwind run the following command;

composer require nunomaduro/termwind

After that create a cli.php file

This will give us an output like this;

ask() Method Usage

You can utilize the ask() function to present a question to the user. The return provided by this method will be the answer.

The output will be like this;

Add Custom Style With style() Method

The style() function allows users to incorporate custom styles and modify colors as needed.

In this example, we are creating a custom my-btn class.

The output will be like this;




Atakan Demircioğlu
Developers Keep Learning

Passionate about blogging and sharing insights on tech, web development, and beyond. Join me on this digital journey! 🚀