Create your FREE Codefresh account and start making pipelines fast. Create Account

Introducing the Codefresh CLI

5 min read

Today we’re releasing a new CLI (Command Line Interface) tool to give engineers even more options for how they access and use Codefresh. In addition to exposing the features already available in Codefresh, the CLI unlocks a number of advanced features such as running parallel pipelines, waiting for pipelines to reach a desired state, searching all connected image registries and more! Here’s how to get started and try some of the features.

The CLI exposes the Codefresh API both for your local machine and inside of Codefresh pipelines. 

Installing Codefresh CLI Locally and Authenticating

Install the command line

You can download the latest executable from the project’s GitHub, under “Releases”.
Alternatively, you can get it using npm/yarn package managers:

With NPM:  npm install -g codefresh
With Yarn:  yarn global add codefresh

For the pros among you, we even provide shell completions:

Linux:  /usr/local/bin/codefresh completion >> ~/.bashrc
OS X:  /usr/local/bin/codefresh completion >> ~/.bash_profile


First create an API key by going to your User settings, under “API keys”, and generating a new API key.

Then authenticate by running  codefresh auth create-context --api-key {API_KEY}.

Using CLI in Codefresh Pipelines

If you use the Codefresh CLI in a pipeline step, it will be already configured, authenticated, and ready for use. No additional authentication is required!

As example, in this custom pipeline step we can use the CLI to fetch the Helm registry url and load it into a variable for use in later steps.

Codefresh CLI Examples

You can now get info on possible commands by running  codefresh --help , which will output something like this:

As you can see, Codefresh follows a {verb} {noun} syntax and additional information about each command is available by running

Get and Run Pipelines

Lets see all our pipelines.

Now we can run pipelines using their ID and specifying the repo branch you’re working from.

Get images and add annotations

Since you can add multiple Docker registries to Codefresh, you can access all of them and manipulate annotations.

Lets add some annotations and information to these images so it’ll show up in the UI.

This will then show up in the UI. You can read the image annotations documentation here.

Running Matrix Pipelines

Matrix pipelines allow you to use a single pipeline to trigger tens of workflows with different variables. For example, lets say you were building different docker images for node.js where you watch to swap Dockerfiles but keep the same pipeline. First we’d create a variables file containing our different variables. You can use json, or yaml. I’ll name this variables file  node-releases.yml

Then we’ll run our matrix pipeline specifying that we want to wait until all of these workflows have completed before moving on.

Many more options

There are many many more commands and options for you to play with. The best thing about the CLI is that it’s self-documented. Just add --help whenever you’re in doubt. Feel free to explore the CLI and discover more things to do with it!


The Codefresh CLI opens up a lot of possibilities for working with pipelines and images. Since Codefresh is multi-tenancy by default, you can even switch contexts between accounts as needed! We’re excited to see what you build. To try it out, just create a free account, and follow the instructions at the top of this post.

Important Links


Report Issues

Follow the Github project

Dan Garfield

Dan Garfield

Dan is the Co-Founder and Chief Open Source Officer at Codefresh. His work in open source includes being an Argo Maintainer, and co-chair of the GitOps Working Group. As a technology leader with a background in full-stack engineering, evangelism, and communications, he led Codefresh's go-to-market strategy and now leads open source strategy. You can follow him at

Leave a Reply

* All fields are required. Your email address will not be published.