Skip to main content

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

pip install "ikomia-cli[full]"

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>
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

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

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 saved with Python API or Ikomia STUDIO.

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
    • type: SERVERLESS, CLUSTER (CPU instances) or GPU (GPU instances)
ikcli project workflow deploy <project_name> <workflow_name> <provider> <region> <type> 
  • Delete a workflow
ikcli project workflow delete <project_name> <workflow_name>

Manage your deployments

  • List all deployments of a workflow
ikcli project deployment ls <project_name> <workflow_name>
  • Call deployment with image as input
ikcli project deployment run <project_name> <workflow_name> <image_file_path>
  • 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)

  • 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>