# CLI

We provide you multiple ways to interact with the SCALE platform, via the web interface, Ikomia STUDIO, or from your terminal using our command-line interface (CLI).

The CLI is a powerful tool that allows you to manage your projects, algorithms and deployments. It is also the easiest way to push your workflows to the SCALE platform.

## Installation[​](#installation "Direct link to Installation")

```
pip install "ikomia-cli[full]"
```

## Sign in to your Ikomia account[​](#sign-in-to-your-ikomia-account "Direct link to Sign in to your Ikomia account")

To be able to access your projects and deployments, you need to sign in to your Ikomia account. You can do this by running the following command:

```
ikcli login
```

You will be prompted to enter your username and password. Once you are logged in, the CLI will ask you to export your access token to your environment variables.

```
export IKOMIA_TOKEN=<your_access_token>
```

warning

Currently, **the CLI only supports username and password authentication**. If you are using a third-party authentication provider, you can directly generate a token from the web interface and export it to your environment variables using the `IKOMIA_TOKEN` variable.

tip

By default, your access token will be valid for 1 hour. However, **you can generate a new token with a longer expiration time** using the `--token-ttl` option.

```
ikcli login --token-ttl 86400 # duration in seconds, here that corresponds to 24 hours
```

## Manage your projects[​](#manage-your-projects "Direct link to Manage your projects")

* List your projects

```
ikcli project ls
```

* Create new project

```
ikcli project add <project_name>
```

* Delete project

```
ikcli project delete <project_name>
```

* Push a workflow to a project

```
ikcli project push <project_name> <workflow_file_path>
```

Workflow files are in JSON format and can be exported from Python API or Ikomia STUDIO.

## Manage your workflows[​](#manage-your-workflows "Direct link to Manage your workflows")

* List all workflows of a project

```
ikcli project workflow ls <project_name>
```

* Deploy a workflow

  <!-- -->

  * provider: AWS or GCP

  * region:

    <!-- -->

    * AWS: FRANCE, GERMANY or IRELAND
    * GCP: NETHERLANDS or US\_CENTRAL

  * type: SERVERLESS, CLUSTER (CPU instances) or GPU (GPU instances)

```
ikcli project workflow deploy <project_name> <workflow_name> <provider> <region> <type>
```

warning

We recommend using the web interface for deploying workflows for latest features and improvements.

* Delete a workflow

```
ikcli project workflow delete <project_name> <workflow_name>
```

## Manage your deployments[​](#manage-your-deployments "Direct link to Manage your deployments")

* List all deployments of a workflow

```
ikcli project deployment ls <project_name> <workflow_name>
```

* Get deployment logs

```
ikcli project deployment logs <project_name> <workflow_name>
```

* Get deployment usage
  <!-- -->
  * period: 'day' (current day), 'yesterday', 'week' (current week), 'last\_week', 'month' (current calendar month) or 'last\_month'

```
ikcli project deployment usage <project_name> <workflow_name> --period <period>
```

* Delete a deployment

```
ikcli project deployment delete <project_name> <workflow_name>
```

## Manage your algorithms (private HUB)[​](#manage-your-algorithms-private-hub "Direct link to Manage your algorithms (private HUB)")

* List algorithms in your private HUB

```
ikcli algo ls
```

* Push an algorithm to your private HUB

Private algorithms belong to a workspace. It can be your personal workspace (same name as your user name) or a organization workspace (same name as your organization name). You can use the CLI to retrieve your available workspaces:

```
ikcli namespace ls
```

To push your algorithm, it must be a valid one so that it is loaded successfully with Python API or STUDIO. You can use the CLI to retrieve the list of valid algorithms:

```
ikcli algo local ls
```

You're ready to push your algorithm:

```
ikcli algo add <workspace> <algo_name>
```

* Update an algorithm

```
ikcli algo update <algo_name>
```

* Delete an algorithm

```
ikcli algo delete <algo_name>
```
