Skip to main content
In this tutorial, you’ll learn how Kosli allows you to track a source code change from runtime environments. You’ll set up a docker environment, use Kosli to record build and deployment events, and track what artifacts are running in your runtime environment. This tutorial uses the docker Kosli environment type, but the same steps can be applied to other supported environment types.
As you go through the guide you can also check your progress from your browser.In the upper left corner there is a house icon. Next to it you can select which organization you want to view. Your personal organization has the same name as your GitHub login name, and is the organization you will be using in this guide.
Playground is an alternative version of this tutorial in which you embed the Kosli commands in a GitHub CI Workflow (in a clone of the playground repo) rather than running them directly from your terminal.

Prerequisites

To follow the tutorial, you will need to:

Steps

Step 1: Setup

Set the KOSLI_ORG and KOSLI_API_TOKEN environment variables:
You can check your Kosli set up by running:
which should return a list of flows or the message “No flows were found”. Clone our quickstart-docker repository:
Export the head commit in a variable (will be used in several of the commands below):

Step 2: Create a Kosli Flow

The Flow’s yml template-file exists in the git repository. Confirm this yml file exists by catting it:
You will see the following output, specifying the existence of an Artifact named nginx:
Create a Kosli Flow called quickstart-nginx using this yml template-file:
Confirm the Kosli Flow called quickstart-nginx was created:
which will produce the following output:
In the web interface you can select Flows on the left. It will show you that you have a quickstart-nginx Flow. If you select the Flow it will show that no Artifacts have been reported yet.

Step 3: Create a Kosli Trail

Create a Kosli Trail, in the quickstart-nginx Flow, whose name is the repository’s current git-commit:

Step 4: Attest an Artifact to Kosli

Typically, you would build an Artifact in your CI system, in response to a git-commit being pushed. The quickstart-docker repository contains a docker-compose.yml file that uses a public nginx docker image which you will be using as your Artifact in this tutorial instead. Now report the artifact to Kosli using the kosli attest artifact command. Note:
  • The --name flag has the value nginx which is the (only) artifact name defined in the kosli.yml file from step 2.
  • The --build-url and --commit-url flags have dummy values; in a real call these would be the CI and git hosting provider URLs respectively.
You can verify that you have reported the Artifact in your quickstart-nginx flow:

Step 5: Create a Kosli environment

Create a Kosli Environment called quickstart whose type is docker:
You can verify that the Kosli Environment was created:
If you refresh the Environments web page in your Kosli account, it will show you that you have a quickstart environment and that no snapshot reports have been received yet.

Step 6: Report what is running in your environment

First, run the artifact:
Confirm the container is running:
The output should include an entry similar to this:
Report all the docker containers running on your machine to Kosli:
You can confirm this has created an environment snapshot:
You can get a detailed view of all the docker containers included in the snapshot report:
The kosli snapshot docker command reports all the docker containers running in your environment, equivalent to the output from docker ps. This tutorial only shows the nginx container in the examples.
If you refresh the Environments web page in your Kosli account, you will see that there is now a timestamp for Last Change At column. Select the quickstart link on left for a detailed view of what is currently running.

Step 7: Search Kosli

Now that you have reported your Artifact and what’s running in your runtime environment, you can use the kosli search command to find everything Kosli knows about an Artifact or a git-commit. For example, you can give Kosli search the git-commit whose CI run built and deployed the Artifact:
Visit the Kosli Querying guide to learn more about the search command.
Last modified on March 10, 2026