liferay
- Liferay Client Extension Control CLI
Tool for performing Liferay Client Extension related operations from the command line.
Manuall Installation
curl
Manuall Installation On MacOS using - Download the binary using curl
- Apple Silicon
curl -fsSL https://github.com/liferay/liferay-cli/releases/latest/download/liferay-darwin-arm64 -O
- Intel
curl -fsSL https://github.com/liferay/liferay-cli/releases/latest/download/liferay-darwin-amd64 -O
- Apple Silicon
- Validate the binary (optional)
Download the checksum file
Validate the binary against the checksum file
curl -fsSL https://github.com/liferay/liferay-cli/releases/latest/download/checksums.txt -o checksum.txt
- Apple Silicon
shasum -c <(grep liferay-darwin-arm64 checksum.txt)
- Intel
shasum -c <(grep liferay-darwin-amd64 checksum.txt)
If the check fails,<binary>: OK
shasum
exits with nonzero status and prints output similar to:<binary>: FAILED shasum: WARNING: 1 computed checksum did NOT match
- Apple Silicon
- Make the binary executable.
chmod +x ./liferay-*
- Move the binary to a file location on your system
PATH
and rename it toliferay
for convenience.Make suresudo mv ./liferay-* /usr/local/bin/liferay sudo chown root: /usr/local/bin/liferay
/usr/local/bin
is in yourPATH
environment variable. - Test to ensure the version you installed is up-to-date:
liferay --version
curl
Manuall Installation On Linux using - Download the binary using curl
curl -fsSL https://github.com/liferay/liferay-cli/releases/latest/download/liferay-linux-amd64 -O
- Validate the binary (optional)
Download the checksum file
Validate the binary against the checksum file
curl -fsSL https://github.com/liferay/liferay-cli/releases/latest/download/checksums.txt -o checksum.txt
If valid, the output is:shasum -c <(grep liferay-linux-amd64 checksum.txt)
If the check fails,<binary>: OK
shasum
exits with nonzero status and prints output similar to:<binary>: FAILED shasum: WARNING: 1 computed checksum did NOT match
- Make the binary executable.
chmod +x ./liferay-linux-amd64
- Move the binary to a file location on your system
PATH
and rename it toliferay
for convenience.Make suresudo mv ./liferay-linux-amd64 /usr/local/bin/liferay sudo chown root: /usr/local/bin/liferay
/usr/local/bin
is in yourPATH
environment variable. - Test to ensure the version you installed is up-to-date:
liferay --version
curl
Manuall Installation On Windows using - Download the binary using curl
- ARM
curl.exe -fsSL "https://github.com/liferay/liferay-cli/releases/latest/download/liferay-windows-arm64.exe" -O
- Intel
curl.exe -fsSL "https://github.com/liferay/liferay-cli/releases/latest/download/liferay-windows-amd64.exe" -O
- ARM
- Validate the binary (optional)
Download the checksum file
Validate the binary against the checksum file
curl -fsSL https://github.com/liferay/liferay-cli/releases/latest/download/checksums.txt -o checksum.txt
- Using Command Prompt to manually compare
CertUtil
's output to the checksum file downloaded:- ARM
CertUtil -hashfile liferay-windows-arm64.exe SHA256 findstr liferay-windows-arm64.exe checksum.txt
- Intel
CertUtil -hashfile liferay-windows-amd64.exe SHA256 findstr liferay-windows-amd64.exe checksum.txt
- ARM
- Using Command Prompt to manually compare
- Rename it to
liferay
for convenience and move the binary to a location which can be added to your systemPATH
.- ARM
ren "liferay-windows-arm64.exe" "liferay.exe" & move /Y "liferay.exe" "%USERPROFILE%\AppData\Local\Programs\Common"
- Intel
ren "liferay-windows-amd64.exe" "liferay.exe" & move /Y "liferay.exe" "%USERPROFILE%\AppData\Local\Programs\Common"
- ARM
- Add
%USERPROFILE%\AppData\Local\Programs\Common
to yourPATH
system variable.- Press the Windows ⊞ key and type
env
. - In the result pane select Edit the system environment variables to open the System Properites widget.
- Click |Environment Variables...| button.
- Under User variables for
%user%
click thePath
entry and select |Edit|. - Click |New| and paste
%USERPROFILE%\AppData\Local\Programs\Common
- Click |OK| and close all the windows.
- Logout and back in.
- Press the Windows ⊞ key and type
- Test to ensure the version you installed is up-to-date open a terminal and execute:
liferay --version
Automated Installation
install.sh
script
Installation on Mac or Linux using the - Execute:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/liferay/liferay-cli/HEAD/install.sh)"
- Test to ensure the version you installed is up-to-date open a terminal and execute:
liferay --version
Run Prerequisits
- Docker (Desktop)
- the
liferay
platform specific binary
Onboarding steps
- create a new directory (say the path of that directory is stored in
${client_extension_dir}
) - execute
liferay ext start -d ${client_extension_dir} -b
- LIVE CODING IS NOW ACTIVE!
- Open the Tilt UI (http://localhost:10350/r/(all)/overview)
ext start
A basic workflow after - From the Tilt UI click the
dxp.lfr.dev
resource in the left menu - Once DXP is started click the
dxp.lfr.dev
link found near the top of the page - Login (
test@dxp.lfr.dev
/test
) - Create an Object Definition (see Creating and Managing Objects)
- Add an Action on the Object definition (see Defining Object Actions)
- use groovy as a placeholder
- In your
${client_extension_dir}
create an Object defintion client extension project:liferay ext create --name=? --type=?
- Export the Object definition JSON file from DXP into the Object defintion client extension project
src
directory - In your
${client_extension_dir}
create an Object action client extension project:liferay ext create --name=? --type=?
- Update the Object definition JSON in the Object defintion client extension project with the object action ID (e.g.
"objectActionExecutorKey": "function#<object-action-id>"
)
How to customize the DXP Image used in localdev
- Run
LOCALDEV_RESOURCES_DIR=$(liferay config get localdev.resources.dir)
to obtain the path where localdev resources are synced - Edit
${LOCALDEV_RESOURCES_DIR}/docker/images/localdev-server/workspace/gradle.properties
file to set the the docker image or product key. - If localdev runtime is already started
- Run
liferay ext refresh
- Run
- If localdev runtime is not already started
- Run
liferay ext start
- Run
Getting productive with Tilt
- show logs
- refreshing resources
- disabling resources
- status bars
- ...
Cleanup liferay/cli
- linux/mac:
rm -rf ~/.lcect*
- windows:
del /q /s %USERPROFILE%\.liferay/cli.yaml rd /q /s %USERPROFILE%\.liferay/cli