# Cycloid CLI
If you are a user of Cycloid and want to push automation a little bit further by playing with our Cycloid API (opens new window), the Cycloid CLI (cy) (opens new window) is here for you.
Here at Cycloid, our DevOps team is using it almost every day to perform routine tasks, technical demonstrations for new customers, or even to send events to the Cycloid console.
The Cycloid CLI (cy) is one of our Open Source projects. If you want to contribute to it, you can check out the code on our Github cycloid-cli (opens new window) repository.
# Requirements
In order to use the Cycloid CLI you will first need to create an API KEY.
# Use Cycloid CLI
# Locally
If you are looking to use the Cycloid CLI locally, follow the Installation (opens new window) section on our Github repository, after that you will be ready to go.
# In a pipeline
The first step to properly use the Cycloid CLI in a pipeline is to provide the API KEY
in a secure way using Cycloid credentials.
1) Create a credential to store our API KEY
Let's create a credential using custom
type as the following:
Save the path and key of our new credential for the next step custom_cycloid-api-key.key
(you can read more about using Cycloid credentials in a pipeline here.)
2) Configure the pipeline
Using the CLI in a pipeline is made easy by our Open Source Cycloid toolkit (opens new window) docker image.
As part of the main tools used by our customers, this docker image contains also the Cycloid CLI. To use it inside a pipeline you can, for example, define the following task
inside your Pipeline configuration:
task: using-cli
config:
platform: linux
image_resource:
type: docker-image
source:
repository: cycloid/cycloid-toolkit
tag: latest
run:
path: /bin/sh
args:
- -ec
- |
/usr/bin/cy login --org "${CYCLOID_ORGANIZATION}" --api-key "${CYCLOID_API_KEY}"
# list all my projects
/usr/bin/cy login --org "${CYCLOID_ORGANIZATION}" project list
params:
CYCLOID_API_KEY: ((custom_cycloid-api-key.key))
CYCLOID_ORGANIZATION: "myorg"
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19