ectool is the command-line client for CloudBees CD/RO (formerly CloudBees Flow and ElectricFlow). Each subcommand sends one API request to the CD/RO server. This page covers installing the CloudBees CD/RO tools package on Linux, logging in without leaving passwords in shell history, managing projects, running procedures and pipelines, and using ectool in scripts and job steps.
The ectool is a command line interface that provides operational control over the CloudBees CD/RO system. It supports a large collection of commands, each of which translates to a message sent to the CloudBees CD/RO server. For example, ectool getProjects returns information about all projects defined on the server.
Download URL - https://downloads.cloudbees.com/cloudbees-cd/
$ wget https://downloads.cloudbees.com/cloudbees-cd/Release_2023.10/2023.10.0.169425/linux/CloudBeesFlowTools-2023.10.0.169425.tar.gz
$ ls
$ tar -zxvf CloudBeesFlowTools-2023.10.0.169425.tar.gz
$ cd CloudBeesFlowTools-2023.10.0.169425
$ pwd
$ export PATH=/home/ubuntu/CloudBeesFlowTools-2023.10.0.169425/bin:$PATH
$ ls bin/
$ ectool --help
# To test ectool:
ectool --help
# To test ectool:
bin/ectool --helpCode language: PHP (php)
Example Commands
ectool --server 34.201.174.35 login "admin" "changeme"
ectool --server localhost --securePort 443 login admin changeme
ectool getVersions
ectool --server 34.201.174.35 login "admin" "changeme"
ectool createProject --help
ectool createProject raj1
ectool deleteProject --help
ectool deleteProject raju
Code language: CSS (css)
How ectool talks to the server
ectool does not do any work on the local machine. Every subcommand, such as getProjects, createProject or runProcedure, becomes a request to the CloudBees CD/RO server. The server checks your session and permissions and returns a response, which is XML by default. When you log in, ectool saves a session in a file in your home directory (~/.ecsession on Linux). Later commands reuse that session until it expires or you run ectool logout.
The help output in the gist above lists the global options. These are the ones you will use most:
| Option | Default | Use it when |
|---|---|---|
--server <host> | COMMANDER_SERVER, then the last server used, then localhost | You work with more than one server |
--secure <0|1> | 1 (HTTPS) | You almost never change it; keep HTTPS |
--securePort <port> | 8443 | The server sits behind a load balancer or ingress on 443 |
--format <xml|json> | xml | You want to pipe the output to jq |
--valueOf <path> | whole response | You only need one element of the response in a script |
--dryrun | off | You want to see the request without sending it |
--timeout <s> | 180 seconds | Long-running API calls time out |
Note: Global options go before the subcommand: ectool --server cd.example.com getProjects. If you put them after the subcommand, ectool treats them as arguments to that subcommand.
Install the tools and keep them on your PATH
The export PATH=... line in the steps above only lasts for the current shell. The commands below make the change permanent. They also avoid a hard-coded /home/ubuntu path, so they work for any user. Where you can, use a tools version that matches your server version. Browse the download site for the release you need.
VERSION=2023.10.0.169425
wget https://downloads.cloudbees.com/cloudbees-cd/Release_2023.10/${VERSION}/linux/CloudBeesFlowTools-${VERSION}.tar.gz
tar -zxf CloudBeesFlowTools-${VERSION}.tar.gz -C "$HOME"
# Make ectool available in every new shell
echo "export PATH=\$HOME/CloudBeesFlowTools-${VERSION}/bin:\$PATH" >> ~/.bashrc
source ~/.bashrc
which ectool
ectool --versionCode language: PHP (php)
Expected result: which prints the path to bin/ectool, and --version prints a line such as CloudBees CD Tool version 2023.10.0.169425. You only need bin/ectool --help if bin is not on your PATH, and then only from inside the extracted directory.
Log in without exposing the password
The examples above pass admin and changeme on the command line. That works, but the password ends up in shell history and is visible to other users in the process list. If you leave out the password, ectool prompts for it. Set the server once with an environment variable so you don't have to repeat it.
export COMMANDER_SERVER=cd.example.com
# Prompts for the password
ectool login admin
# Server published on 443 (for example a Kubernetes ingress)
ectool --securePort 443 login admin
# Confirm the connection and see the server version
ectool getVersions
# End the session when finished
ectool logoutCode language: PHP (php)
Note: changeme is the documented default admin password for many installations. Change it straight after installation, and don't publish a real server IP alongside working credentials.
Create, inspect and delete a project
The project commands above make a good first exercise. The sequence below creates a project, checks that it exists, and deletes the same project. Every subcommand accepts --help, which lists its required and optional arguments.
ectool createProject raj1 --description "ectool lab project"
# Full XML for one project
ectool getProject raj1
# All projects as JSON, pretty-printed
ectool --format json getProjects | jq .
# Delete the same project (this also deletes its procedures, steps and jobs)
ectool deleteProject raj1Code language: PHP (php)
If you run createProject with a name that already exists, the server returns an error instead of overwriting the project. If you run deleteProject with a name that doesn't exist, it fails with a "no such project" error. That is what happens in the original example, which creates raj1 and then deletes raju.
Note: deleteProject cannot be undone and removes all job history for the project. Run getProject first in scripts, or use --dryrun to see exactly what will be sent.
Run procedures and pipelines from the command line
ectool is mostly used to trigger automation from outside the CD/RO UI, for example from a Jenkins job, a cron entry or a shell script. runProcedure starts a procedure and prints the new job ID. You can then pass that ID to the job commands.
# Start a procedure with parameters and capture the job ID
JOB_ID=$(ectool runProcedure raj1 --procedureName Build \
--actualParameter branch=main --actualParameter env=dev)
echo "Started job $JOB_ID"
# Check progress: status is running or completed; outcome is success, warning or error
ectool getJobStatus "$JOB_ID"
ectool --valueOf //outcome getJobStatus "$JOB_ID"
# Start a pipeline
ectool runPipeline raj1 MyPipelineCode language: PHP (php)
Parameter names given to --actualParameter must match the formal parameters defined on the procedure. If a required parameter is missing, the server rejects the request before any job starts.
Use ectool inside job steps and scripts
When a step runs on a CloudBees CD/RO agent, the agent provides the job context and session. You can call ectool without logging in, and property paths such as /myJob and /myProject resolve to the current job and project. This is the usual way to pass values between steps.
# In step 1
ectool setProperty /myJob/buildNumber 42
# In a later step of the same job
BUILD=$(ectool getProperty /myJob/buildNumber)
echo "Deploying build $BUILD"Code language: PHP (php)
- ectool returns a non-zero exit code when a request fails. Use
set -eor check$?so that scripts stop on errors. - Use
--format jsonwithjqfor structured parsing, or--valueOfwhen you only need one element. - Use
--silentfor commands whose output you don't need, such assetProperty. - For unattended automation, use a dedicated service user with only the permissions it needs, not
admin. ThecreateUserAccessTokensubcommand can generate personal access tokens for authorised users.
Common errors and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
ectool: command not found | bin directory not on PATH, or the export was lost when the shell closed | Add the export to ~/.bashrc as shown above |
| Connection refused or timeout | Wrong host or port; the server is on 443 but ectool uses 8443 | Add --securePort 443 or the correct port; check firewall and security group rules |
NoCredentials or session errors | Never logged in, session expired, or --user points to another session | Run ectool login <user> again |
| Access denied on create or delete | The user doesn't have modify permission on the object or the server | Grant permissions through ACLs, or use an account that has them |
| "No such project" error | Typo in the name, or the project was already deleted | Run ectool getProjects and check the exact name |
Corrections to the original example
- The example creates
raj1but deletesraju. The delete fails because that project doesn't exist. Use the same name for both commands. - The
logincommand appears twice. One login is enough, because ectool saves the session and reuses it. - The password is passed on the command line. Leave it out so that ectool prompts for it and it stays out of shell history.
export PATHlasts only for the current shell. Add it to~/.bashrcto keepectoolavailable.- The duplicate
--helpchecks are confusing. Useectool --helpwhenbinis on PATH. Usebin/ectool --helponly from inside the extracted tools directory.
Frequently asked questions
What is ectool in CloudBees CD/RO?
ectool is the command-line client for CloudBees CD/RO. Each subcommand sends one API request to the server, so you can script almost anything the UI does, including creating projects and running procedures and pipelines.
Where does ectool store the login session?
On Linux, ectool stores session information in a file in your home directory, normally ~/.ecsession. Later commands reuse the session until it expires or you run ectool logout.
What port does ectool use by default?
By default, ectool uses HTTPS on port 8443. Add --securePort 443 if the server is published behind a load balancer or ingress on port 443.
How do I get JSON output from ectool?
Add the global option --format json before the subcommand, for example ectool --format json getProjects. You can then pipe the output to jq.
Do I need to log in when ectool runs inside a job step?
No. When a step runs on a CD/RO agent, ectool uses the job's own session and context, so commands such as ectool setProperty /myJob/name value work without a login.
Related tutorials
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services โ all in one place.
Explore Hospitals