Liferay CLI
Liferay CLI - lfr
- is an unofficial tool written in Go that helps you create & manage Liferay projects.
Why?
I needed a subject to play with Go. Writing a CLI tool is fun - especially with Cobra - and I wanted to explore how to distribute it using GitHub Actions (and GoReleaser).
Also, I get sometimes frustrated by Blade and wanted to focus on providing:
- Better performances (cf. benchmarks)
- Better support for Maven
- Shorter commands
- More consistent commands names and ordering
- Details after any command execution
- Shell completion
Getting Started
This tool is still in alpha
, so checkout the release page to download the binary for your distribution.
Examples:
Get a completion script for your shell:
lfr completion bash
bash, zsh, fish and powershell are supported.
Create a Liferay workspace:
lfr create workspace my-liferay-workspace
# or
lfr create ws my-liferay-workspace
Run a Gradle or Maven task:
# Gradle
lfr exec build
# Maven
lfr exec clean install
Start Liferay and follow the logs:
lfr start
lfr logs -f
Benchmarks
Using Hyperfine.
Create Workspace
Command |
Mean [s] |
Min [s] |
Max [s] |
Relative |
blade init -v 7.4 liferay-workspace |
1.837 ± 0.300 |
1.665 |
2.668 |
19.94 ± 5.69 |
lfr create ws liferay-workspace |
0.092 ± 0.022 |
0.076 |
0.178 |
1.00 |
Create MVC Portlet
Command |
Mean [s] |
Min [s] |
Max [s] |
Relative |
blade create -t mvc-portlet my-mvc-portlet |
1.608 ± 0.021 |
1.570 |
1.647 |
59.70 ± 112.37 |
lfr create mvc my-mvc-portlet |
0.027 ± 0.051 |
0.015 |
0.345 |
1.00 |
Create Service Builder
Command |
Mean [s] |
Min [s] |
Max [s] |
Relative |
blade create -t service-builder my-service-builder |
1.628 ± 0.057 |
1.573 |
1.772 |
82.00 ± 134.01 |
lfr create sb my-service-builder |
0.020 ± 0.032 |
0.014 |
0.332 |
1.00 |
License
MIT