LiveRebel CLI Documentation
Hi! This page is outdated, please check out our newer and better CLI reference, here it is!
In this article I want to introduce the Command Line Interface (CLI) of LiveRebel Command Center to you. Mainly I will be focusing on how to use CLI to upload a new version of an application, verify that LiveRebel supports the new version and also update the running application.
LiveRebel download archive comes with utilities that are available from the bin folder. To access the CLI we will work with the lr-cli.sh script (Windows equivalent is lr-cli.cmd). With this tool you can manage most of the LiveRebel functionality from the command line.
To run the CLI tool you will either need the username and password of a user in the LiveRebel Command Center or a security token for a user. To find out the token of your user navigate to your profile page (in LiveRebel Command Center in the top right there is your username that you can click) and your security token is displayed there. See the screenshots for more details.
Access your profile from the top right

Your authentication token on profile page
With the CLI script and your authentication token or username/password combination you are able to manage the following aspects of your LiveRebel Command Center.
- List all managed applications
- Upload new application version
- Compare application versions
- Update your running application to a new version
List All Managed Applications
LiveRebel manages applications that have been configured with a liverebel.xml file and they are visible from the web interface. You can access the same information from the commandline. You can also find out which versions are available in the LiveRebel Command Center and also which version is the active version deployed to your cluster.
./lr-cli.sh -token ad7af931-3cf6-4000-967d-925dcfc44955 -url localhost:9001 apps Application: RebelChat Versions: 1.0, 1.2 Active: 1.2 URL: http://192.168.1.31:8080/rebel-chat Application: org.jvnet.hudson.main:hudson-war Versions: 1.220 Active:
Here you can see that there are two applications . First application is RebelChat with two versions of which 1.2 is the active one. The second application is org.jvnet.hudson.main:hudson-war with one version available and the empty active status means that it has not been deployed to any of the servers.
Upload New Application Version
The upload command will upload a new application archive to LiveRebel Command Center. This will not update your running applications but instead will only transfer the archive to the Command Center. You can activate this version later on. In our example we are uploading RebelChat version 1.1 WAR archive.
./lr-cli.sh -token ad7af931-3cf6-4000-967d-925dcfc44955 -url localhost:9001 upload -file rebel-chat-1.1.war Sending file (452980 bytes)... File uploaded and new version created: Application: RebelChat Version: 1.1
Mind you that that your archives might be quite large and the server far from your own box so this process might take some time. It will depend on your upload speed.
Compare Application Versions
Now that you have couple of versions of your application available on the LiveRebel Command Center we can start comparing them to find out if the update is supported by LiveRebel or not. We’ll start off with a diff from 1.0 to 1.1. This update is compatible with warnings which means that the developer needs to confirm that update does not break anything.
./lr-cli.sh -token ad7af931-3cf6-4000-967d-925dcfc44955 -url localhost:9001 diff -app RebelChat -from 1.0 -to 1.1 Compatibility: compatible with warnings CHANGED WEB-INF/classes/com/demoapp/chat/bus/ChatClient.class - INFO Changed class CHANGED WEB-INF/classes/com/demoapp/chat/web/ChatServlet.class - INFO Changed class
The next example is from version 1.1 to 1.2. This update is fully supported by LiveRebel.
./lr-cli.sh -token ad7af931-3cf6-4000-967d-925dcfc44955 -url localhost:9001 diff -app RebelChat -from 1.1 -to 1.2 Compatibility: compatible
The output of this command has 3 different states, Compatible, Compatible with warnings and Incompatible.
Update your running application to a new version
Now that you have multiple versions of the application at LiveRebel Command Center, lets run some updates to actually update your running updates. The following command will update RebelChat from version to version 1.2. Be sure the check the compatibility beforehand.
./lr-cli.sh -token ad7af931-3cf6-4000-967d-925dcfc44955 -url localhost:9001 update -app RebelChat -ver 1.2 Version 1.2 activated.
The current update via commandline does not support pausing nor setting the timeout. This is something that will be implemented by version 1.0.2.
Where to go from here?
- LiveRebel Scripts on BitBucket
- Using LiveRebel from Hudson/Jenkins
- Ask a question about CLI in our Forum
Toomas Römer is the co-founder and product lead of ZeroTurnaround. Once a Linux junkie, he was fooled by Apple into proprietory OS and devices. He is a big fan of JUGs, OSS communities and beer. He blogs at dow.ngra.de, tweets from @toomasr and also runs the non-profit chesspastebin.com website. In his spare time he crashes Lexuses while test driving them, plays chess, Go and Starcraft. Looks can fool you; he will probably beat you in Squash. You can connect with Toomas on LinkedIn.
