---
title: "CLI - Commands reference"
description: "- a working ovhai CLI (see this guide for more information)"
url: https://docs.us.ovhcloud.com/en/public-cloud/ai-machine-learning/cli-overview
lang: en
---
> For AI agents: the complete documentation index is available at https://docs.us.ovhcloud.com/en/llms.txt, the full documentation bundle is available at https://docs.us.ovhcloud.com/en/llms-full.txt.

# CLI - Commands reference

**Learn how to use the ovhai CLI.**

 

## Requirements

- a working `ovhai` CLI (see [this guide](https://docs.us.ovhcloud.com/en/public-cloud/ai-machine-learning/cli-install-client.md) for more information)

 

## Instructions

### Run a job

To submit a job, you need a **docker image** and (optionally) some **data**.

First, let's submit a simple job, a public Ubuntu image that executes a command `echo`:

```console
ovhai job run ubuntu --gpu 1 -- echo "Hello from my first job"
```

**Note:**

- Add the flag `--help` to get more information about a command.
- You can increase the number of GPUs with the flag `--gpu <x>` or choose to use CPUs with the flag `--cpu <x>`.

You can then list your current and old jobs with:

```console
ovhai job list
```

**Note:**

- Add the flag `--watch` to watch changes live.
- Most commands handle the flag `--output <format>` if you want a different output (JSON or YAML).

You should see the job you just ran; you need its `ID` to get more information about it.

To see information about a job, use the following command:

```console
ovhai job get <job-id>
```

To see its logs live, use the following command:

```console
ovhai job logs <job-id> --follow
```

You should see the output of the `echo` command:

> Hello from my first job

 

### Use data in your job

You can upload data to the Object Storage and mount that data when you run a job. If you mount that data with read/write it will be saved to the Object Storage when the job ends.

Let's upload some data and use it in a job that will produce more data.

```console
ovhai bucket object upload <container>@<region> some-file.txt
```

**Note:**

- If you already used the Swift CLI, the commands are similar.

Now that you have some data in a container, you can mount it when you run a job with the flag `--volume`.

```console
ovhai job run <image> --volume <container>@<region>:/data:rw
```

**Note:**

- You can use the flag `--volume` more than one time if you want to mount more containers.
- Mounted containers with write access are only synchronized when the job is terminated.

You can list and download data you uploaded or generated by a job with:

```console
ovhai bucket object list <container>@<region>
ovhai bucket object download <container>@<region> --prefix /some-file
```

 

### Synchronize data while a job is running

You can synchronize data to the Object Storage while a job is running with:

```console
ovhai job push-data <job-id>
```

You can see the progress with:

```console
ovhai job get <job-id>
```

 

### Execute commands inside a running job

You can execute commands (like `bash`) while a job is running.

```console
ovhai job exec -it <id> -- bash
```

This way you can interact with a running job.

 

### Run a job with ssh access

You can create a job with SSH access:

```console
ovhai job run -s ~/.ssh/id_ed25519.pub ovhcom/ai-training-fastai
```

Multiple `-s` arguments can be used to provide multiple SSH public keys.

Once the job is in `RUNNING` state, you can retrieve the `sshUrl` with:

```console
ovhai job get <job-id>

---
Id:         0d916855-1cd4-4b66-8803-b4782bc13902
Spec:
  Command:              
  Default Http Port:    8080
  Env Vars:             ~
  Image:                ovhcom/ai-training-fastai
  Labels:
    ovh/id:   0d916855-1cd4-4b66-8803-b4782bc13902
    ovh/type: job
  Name:                 AS-CLI-Test
  Resources:
    Cpu:               1
    Ephemeral Storage: 40.0 GiB
    Flavor:            ai1-1-cpu
    Gpu:               0
    Gpu Brand:         ~
    Gpu Memory:        ~
    Gpu Model:         ~
    Memory:            4.0 GiB
    Private Network:   0 bps
    Public Network:    500.0 Mbps
  Shutdown:             ~
  Ssh Public Keys:
  - ssh-ed25519 AAAAC3NzaC1someKey
  Timeout:              0
  Timeout Auto Restart: false
  Unsecure Http:        false
  Volumes:              ~
  Grpc Port:            0
Status:
  Data Sync:            ~
  Duration:             42s
  External Ip:          147.XXX.XXX.XXX
  History:
    DATE                  STATE
    26-02-25 20:23:55     QUEUED
    26-02-25 20:23:55     INITIALIZING
    26-02-25 20:23:55     PENDING
    26-02-25 20:23:56     RUNNING
  Info:
    Message:   Job is running
  Info Url:             https://ui.us-east-va.ai.cloud.ovh.us/job/0d916855-1cd4-4b66-8803-b4782bc13902
  Ip:                   10.42.155.122
  Monitoring Url:       https://monitoring.us-east-va.ai.cloud.ovh.us/d/job?var-job=0d916855-1cd4-4b66-8803-b4782bc13902&from=1740601375518
  Ssh Url:              ssh://0d916855-1cd4-4b66-8803-b4782bc13902@us-east-va.ai.cloud.ovh.us
  State:                RUNNING
  Url:                  https://0d916855-1cd4-4b66-8803-b4782bc13902.job.us-east-va.ai.cloud.ovh.us
  Volumes:              ~
  Grpc Address:         0d916855-1cd4-4b66-8803-b4782bc13902.job-grpc.us-east-va.ai.cloud.ovh.us:443
Updated At: 26-02-25 20:24:02
User:       user-xxx
```

Then you can connect to it with a terminal:

```console
ssh 0d916855-1cd4-4b66-8803-b4782bc13902@us-east-va.ai.cloud.ovh.us -i ~/.ssh/id_ed25519
```

 

### Manage registries

You can list available registries with:

```console
ovhai registry list
```

By default, you have access to public registries and a shared registry scoped to your project.

**Warning:**

**NOTE:** This shared registry can help you perform your tests, but should not be used in production, as we reserve the right to delete its content if deemed necessary. The images pushed to this registry are for AI Tools workloads only and will not be accessible for external uses.

This is why it can be interesting to add and manage other registries. To add a private registry, use:

```console
ovhai registry add <url>
```

You will be asked to type your credentials.

More information about adding and managing public and private registries can be found [here](https://docs.us.ovhcloud.com/en/public-cloud/ai-machine-learning/manage-registries.md).

 

## Go further

Browse all the [AI & Machine Learning guides](https://docs.us.ovhcloud.com/en/public-cloud/ai-machine-learning/landing-page-ai-machine-learning.md).

Browse the rest of the [OVHcloud US documentation](https://docs.us.ovhcloud.com/en/index.md) for guides on our other products and services.

Learn more about [AI & Machine Learning](https://us.ovhcloud.com/public-cloud/ai-machine-learning/) on the OVHcloud US website.

If you need training or technical assistance to implement our solutions, contact your sales representative or click on [this link](https://us.ovhcloud.com/professional-services/) to get a quote and ask our Professional Services experts for a custom analysis of your project.
