Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to custom style the output of the WP-CLI messages #166

Open
1 task done
dingo-d opened this issue Jul 5, 2022 · 3 comments
Open
1 task done

Option to custom style the output of the WP-CLI messages #166

dingo-d opened this issue Jul 5, 2022 · 3 comments

Comments

@dingo-d
Copy link

dingo-d commented Jul 5, 2022

Feature Request

Describe your use case and the problem you are facing

A lot of modern tooling (especially in Laravel space) have really pretty looking CLI outputs (mostly thanks to https://github.com/nunomaduro/termwind).

Using Termwind would be great, and could probably be used with WP-CLI, if it wasn't locked to PHP 8.

So the alternative is to have the output of the WP-CLI a bit more customizable. Increasing line height, making some other modifications to the output, etc.

Some styling is possible now, but that's not much.

Describe the solution you'd like

Currently, for instance, the WP_CLI::success method only has one parameter $message. Other commands such as error, line or log could have a second optional parameter $style where these parameters could be added as an array of items:

WP_CLI::success($message,
  [
    'color' => '#FEFEFE',
    'background' => 'green',
    'line-height' => '1.5',
    'style' => 'italic',
    'weight' => 'bold'
  ]
);
@danielbachhuber
Copy link
Member

I think I'd much prefer adopting Termwind, vs. inventing our own version 😁

This might be a good candidate for a WP-CLI v3.0

@dingo-d
Copy link
Author

dingo-d commented Jul 20, 2022

So WP-CLI v3.0 would then be locked to PHP 8? 😅

@danielbachhuber
Copy link
Member

So WP-CLI v3.0 would then be locked to PHP 8? 😅

Probably not going to happen but one can wish 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants