Skip to main content
As discussed in the development mode overview, to make Openlayer part of your pipeline, you must set up a way to push your artifacts to the Openlayer platform after each development cycle. This guide shows how to use the Openlayer CLI to push artifacts and retrieve test results.
To follow this guide, feel free to use one of the template projects from the Template gallery. We use the OpenAI in Python as an example.

Directory structure

Before you start, make sure that the directory you want to push to Openlayer adheres to one of the options below. Directory structure In the first option, besides the openlayer.json, there is a run script (openlayer_run.py). This option represents the scenario where Openlayer will use your script to get your model outputs for your datasets. On the other hand, option 2 illustrates the situation when you already provide your model’s outputs for your datasets. Refer to the Configuring output generation page for details.
Option 1 is more common. However, option 2 is suitable for users who don’t want to give Openlayer access to their source code and for users whose execution runtime is not supported by Openlayer.

Pushing to Openlayer

The quickest path is openlayer init. It signs you in, creates or links the Openlayer project, and offers to run your first push — so login and link are no longer separate steps:
1

Install the Openlayer CLI

Run the install command for your operating system.
2

Run openlayer init

Inside your directory, run:
Sign in when prompted, create or link an Openlayer project, then choose Development mode. init writes an openlayer.json seeded for your project type and offers to push your first commit for you. Refer to the init command reference for the full walkthrough.
3

Push after each change

Once the project is set up, every later development cycle is just:

Setting up step by step

If you would rather run each step yourself — or you are connecting a directory to a project that already exists — use the individual commands instead:
1

Login to Openlayer using the CLI

Inside your directory, run the command:
This asks for a profile name, then whether to sign in through your browser or with an API key. The API key path also asks for the Openlayer API URL (which should be kept as https://api.openlayer.com if you are using app.openlayer.com) and for your API key (which you can find here).
In CI, pass --api-key or set OPENLAYER_API_KEY and openlayer login skips the prompts entirely. Refer to the login command reference for more information.
2

Link to an Openlayer project

Then, run the command:
You must answer a few questions, such as whether to create a new project on Openlayer, the project directory, and others.
Refer to the link command reference for more information.
3

Push to the Openlayer project

Finally, run:
This command creates and pushes a new commit to your Openlayer project. It then waits for the evaluation of your tests to display the results:
Refer to the push command reference for more information.

Poll the results

After following the steps above, you should see a new commit in your Openlayer project. You can view the test results using the openlayer inspect CLI command:
If the push fails (status failed), you can check the logs on the Openlayer platform to debug the issue. Refer to the inspect command reference for more information.