Supervisely
About SuperviselyEcosystemContact usSlack
  • 💻Supervisely Developer Portal
  • 🎉Getting Started
    • Installation
    • Basics of authentication
    • Intro to Python SDK
    • Environment variables
    • Supervisely annotation format
      • Project Structure
      • Project Meta: Classes, Tags, Settings
      • Objects
      • Tags
      • Image Annotation
      • Video Annotation
      • Point Clouds Annotation
      • Point Cloud Episode Annotation
      • Volumes Annotation
    • Python SDK tutorials
      • Images
        • Images
        • Image and object tags
        • Spatial labels on images
        • Keypoints (skeletons)
        • Multispectral images
        • Multiview images
        • Advanced: Optimized Import
        • Advanced: Export
      • Videos
        • Videos
        • Video and object tags
        • Spatial labels on videos
      • Point Clouds
        • Point Clouds (LiDAR)
        • Point Cloud Episodes and object tags
        • 3D point cloud object segmentation based on sensor fusion and 2D mask guidance
        • 3D segmentation masks projection on 2D photo context image
      • Volumes
        • Volumes (DICOM)
        • Spatial labels on volumes
      • Common
        • Iterate over a project
        • Iterate over a local project
        • Progress Bar tqdm
        • Cloning projects for development
    • Command Line Interface (CLI)
      • Enterprise CLI Tool
        • Instance administration
        • Workflow automation
      • Supervisely SDK CLI
    • Connect your computer
      • Linux
      • Windows WSL
      • Troubleshooting
  • 🔥App development
    • Basics
      • Create app from any py-script
      • Configuration file
        • config.json
        • Example 1. Headless
        • Example 2. App with GUI
        • v1 - Legacy
          • Example 1. v1 Modal Window
          • Example 2. v1 app with GUI
      • Add private app
      • Add public app
      • App Compatibility
    • Apps with GUI
      • Hello World!
      • App in the Image Labeling Tool
      • App in the Video Labeling Tool
      • In-browser app in the Labeling Tool
    • Custom import app
      • Overview
      • From template - simple
      • From scratch - simple
      • From scratch GUI - advanced
      • Finding directories with specific markers
    • Custom export app
      • Overview
      • From template - simple
      • From scratch - advanced
    • Neural Network integration
      • Overview
      • Serving App
        • Introduction
        • Instance segmentation
        • Object detection
        • Semantic segmentation
        • Pose estimation
        • Point tracking
        • Object tracking
        • Mask tracking
        • Image matting
        • How to customize model inference
        • Example: Custom model inference with probability maps
      • Serving App with GUI
        • Introduction
        • How to use default GUI template
        • Default GUI template customization
        • How to create custom user interface
      • Inference API
      • Training App
        • Overview
        • Tensorboard template
        • Object detection
      • High level scheme
      • Custom inference pipeline
      • Train and predict automation model pipeline
    • Advanced
      • Advanced debugging
      • How to make your own widget
      • Tutorial - App Engine v1
        • Chapter 1 Headless
          • Part 1 — Hello world! [From your Python script to Supervisely APP]
          • Part 2 — Errors handling [Catching all bugs]
          • Part 3 — Site Packages [Customize your app]
          • Part 4 — SDK Preview [Lemons counter app]
          • Part 5 — Integrate custom tracker into Videos Annotator tool [OpenCV Tracker]
        • Chapter 2 Modal Window
          • Part 1 — Modal window [What is it?]
          • Part 2 — States and Widgets [Customize modal window]
        • Chapter 3 UI
          • Part 1 — While True Script [It's all what you need]
          • Part 2 — UI Rendering [Simplest UI Application]
          • Part 3 — APP Handlers [Handle Events and Errors]
          • Part 4 — State and Data [Mutable Fields]
          • Part 5 — Styling your app [Customizing the UI]
        • Chapter 4 Additionals
          • Part 1 — Remote Developing with PyCharm [Docker SSH Server]
      • Custom Configuration
        • Fixing SSL Certificate Errors in Supervisely
        • Fixing 400 HTTP errors when using HTTP instead of HTTPS
      • Autostart
      • Coordinate System
      • MLOps Workflow integration
    • Widgets
      • Input
        • Input
        • InputNumber
        • InputTag
        • BindedInputNumber
        • DatePicker
        • DateTimePicker
        • ColorPicker
        • TimePicker
        • ClassesMapping
        • ClassesColorMapping
      • Controls
        • Button
        • Checkbox
        • RadioGroup
        • Switch
        • Slider
        • TrainValSplits
        • FileStorageUpload
        • Timeline
        • Pagination
      • Text Elements
        • Text
        • TextArea
        • Editor
        • Copy to Clipboard
        • Markdown
        • Tooltip
        • ElementTag
        • ElementTagsList
      • Media
        • Image
        • LabeledImage
        • GridGallery
        • Video
        • VideoPlayer
        • ImagePairSequence
        • Icons
        • ObjectClassView
        • ObjectClassesList
        • ImageSlider
        • Carousel
        • TagMetaView
        • TagMetasList
        • ImageAnnotationPreview
        • ClassesMappingPreview
        • ClassesListPreview
        • TagsListPreview
        • MembersListPreview
      • Selection
        • Select
        • SelectTeam
        • SelectWorkspace
        • SelectProject
        • SelectDataset
        • SelectItem
        • SelectTagMeta
        • SelectAppSession
        • SelectString
        • Transfer
        • DestinationProject
        • TeamFilesSelector
        • FileViewer
        • Dropdown
        • Cascader
        • ClassesListSelector
        • TagsListSelector
        • MembersListSelector
        • TreeSelect
        • SelectCudaDevice
      • Thumbnails
        • ProjectThumbnail
        • DatasetThumbnail
        • VideoThumbnail
        • FolderThumbnail
        • FileThumbnail
      • Status Elements
        • Progress
        • NotificationBox
        • DoneLabel
        • DialogMessage
        • TaskLogs
        • Badge
        • ModelInfo
        • Rate
        • CircleProgress
      • Layouts and Containers
        • Card
        • Container
        • Empty
        • Field
        • Flexbox
        • Grid
        • Menu
        • OneOf
        • Sidebar
        • Stepper
        • RadioTabs
        • Tabs
        • TabsDynamic
        • ReloadableArea
        • Collapse
        • Dialog
        • IFrame
      • Tables
        • Table
        • ClassicTable
        • RadioTable
        • ClassesTable
        • RandomSplitsTable
        • FastTable
      • Charts and Plots
        • LineChart
        • GridChart
        • HeatmapChart
        • ApexChart
        • ConfusionMatrix
        • LinePlot
        • GridPlot
        • ScatterChart
        • TreemapChart
        • PieChart
      • Compare Data
        • MatchDatasets
        • MatchTagMetas
        • MatchObjClasses
        • ClassBalance
        • CompareAnnotations
      • Widgets demos on github
  • 😎Advanced user guide
    • Objects binding
    • Automate with Python SDK & API
      • Start and stop app
      • User management
      • Labeling Jobs
  • 🖥️UI widgets
    • Element UI library
    • Supervisely UI widgets
    • Apexcharts - modern & interactive charts
    • Plotly graphing library
  • 📚API References
    • REST API Reference
    • Python SDK Reference
Powered by GitBook
On this page
  • Introduction
  • Prerequisites
  • Interact with Projects using CLI
  • Download a Project
  • Get project name
  • Upload a Project
  • Interact with Team files using CLI
  • Download directory from Team files
  • Upload directory to Team files
  • Remove directory from Team files
  • Remove file from Team files
  • Interact with Workspace tasks using CLI
  • Set link to a Team files directory
  • Release your Private Apps using CLI
  • Advanced
  • Create file requirements.txt
  • Make shell script create_venv.sh
  • Activate virtual environment

Was this helpful?

Edit on GitHub
  1. Getting Started
  2. Command Line Interface (CLI)

Supervisely SDK CLI

Use Command Line Interface for easy and convenient usage of supervisely functional right inside your console locally and with shell scripts on instance!

PreviousWorkflow automationNextConnect your computer

Last updated 6 months ago

Was this helpful?

Introduction

In this tutorial, you will discover how to simplify certain basic functions of Supervisely by automating them with easy-to-use Command Line Interface (CLI) commands.

The list of commands currently available is not the final list and new commands may be added in the future. If you find that a certain functionality you need is not currently available, you can contact the developers and request that it be added.

Prerequisites

To use CLI you first need to install latest Supervisely package on your preferred Linux system:

pip3 install --upgrade supervisely

After that, you will be able to use CLI. Learn more about SDK installation

Interact with Projects using CLI

Download a Project

supervisely project download -id <project-id> -d <local-destination>

In the following required arguments, replace:

  • <project-id> with the ID of the Supervisely project you want to download. Prefixes: -id, --id

  • <local-destination> with the local directory where you want to save the project data. Prefixes: -d, --dst

Get project name

supervisely project get-name -id <project-id>

Replace: <project-id> with the ID of the Supervisely project you want to get name. Prefixes: -id, --id

To export project name right in environmental variable, use the following trick in your shell script:

PROJECT_NAME=$(supervisely project get-name -id $PROJECT_ID)

Upload a Project

supervisely project upload -s <source-local> -id <workspace-id> -n <project-name>

In the following required arguments, replace:

  • <local-source> with the local directory where your project is stored. Prefixes: -s, --src

  • <workspace-id> with the ID of the target Supervisely workspace. Prefixes: -id, --id

In the following optional arguments, replace:

  • <project-name> with the name of the project. By default, it takes the name of the source directory. Prefixes: -n, --name

Interact with Team files using CLI

Download directory from Team files

supervisely teamfiles download -id <team-id> -s <remote-source> -d <local-destination> -f "<filter-text>" -i

In the following required arguments, replace:

  • <team-id> with the ID of the actual team. Prefixes: -id, --id

  • <remote-source> with the local directory where the files are located. Prefixes: -s, --src

  • <local-destination> with the remote directory in Team files where you want to upload the files. Prefixes: -d, --dst

In the following optional arguments, replace:

  • "<filter-text>" with the regular expression (f.e. ".jpg$") which will filter files in directory. Then, only filtered files will be downloaded. Prefixes: -f, --filter

  • Add the -i flag to ignore and skip if source directory not exists.

Upload directory to Team files

supervisely teamfiles upload -id <team-id> -s <local-source> -d <remote-destination>

In the following required arguments, replace:

  • <team-id> with the ID of the actual team. Prefixes: -id, --id

  • <local-source> with the local directory where the files are located. Prefixes: -s, --src

  • <remote-destination> with the remote directory in Team files where you want to upload the files. Prefixes: -d, --dst

Remove directory from Team files

supervisely teamfiles remove-directory -id <team-id> -p <remote-path>

In the following required arguments, replace:

  • <team-id> with the ID of the team. Prefixes: -id, --id

  • <remote-path> with the path to the folder in Team files. Prefixes: -p, --path

Remove file from Team files

supervisely teamfiles remove-file -id <team-id> -p <remote-path>

In the following required arguments, replace:

  • <team-id> with the ID of the team. Prefixes: -id, --id

  • <remote-path> with the path to the file in Team files. Prefixes: -p, --path

Interact with Workspace tasks using CLI

Set link to a Team files directory

supervisely task set-output-dir -d <output-path>

Replace <output-path> with the path to the output directory. Prefixes: -d, --dir

Release your Private Apps using CLI

Here, we will describe components of following command which releases a private app:

supervisely release -p <app-directory> -a <sub-app-directory> --release-version <version> --release-description <description> -s <slug> -y

In the following optional arguments, replace:

  • <app-directory> with the path to the directory containing the application. By default, it's a current working directory. Prefixes: -p, --path

  • <sub-app-directory> with the path to the sub-app relative to the application directory. By default, it's a current working directory. Prefixes: -a, --sub-app

  • <version> with the version number in the format "vX.X.X". By default, there will be a small increment "0.0.1". Prefix: --release-version

  • <description> with the release description (max length is 64 symbols). You will be asked to enter description. Prefix: --release-description

  • <slug> with the slug for internal use. A term "slug" stands for a short label or ID that is used to identify a specific item or resource (ann app in our case). Prefixes: -s, --slug

  • Add the -y flag to auto-confirm the release.

Advanced

To install your own modification or specific version of Supervisely, follow these steps:

Create file requirements.txt

Create file requirements.txt with necessary dependency:

supervisely==<version in format X.X.X> # specific version
# path/to/sdk/supervisely  # alternative (only local debug)
# git+https://github.com/<your_name>/<your_supervisely_fork>.git@<your_branch> # alternative

Make shell script create_venv.sh

Make shell script create_venv.sh with instructions on virtual environment installation.

create_venv.sh
#!/bin/bash

# learn more in documentation
# Official python docs: https://docs.python.org/3/library/venv.html
# Superviely developer portal: https://developer.supervisely.com/getting-started/installation#venv

if [ -d ".venv" ]; then
    echo "VENV already exists, will be removed"
    rm -rf .venv
fi

echo "VENV will be created" && \
python3 -m venv .venv && \
source .venv/bin/activate && \

echo "Install requirements..." && \
pip3 install -r requirements.txt && \
echo "Requirements have been successfully installed" && \
echo "Testing imports, please wait a minute ..." && \
python -c "import supervisely as sly" && \
echo "Success!" && \
deactivate

Activate virtual environment

Run script and choose directory with virtual environment. Then, activate your environment (you will see (.venv) appeared in your console):

cd your/directory/with/script/
./create_venv.sh
source .venv/bin/activate

To use CLI on instance (for example, in your personal shell script), you need to include requirements.txt with Supervisely in your Private App repository

Note: to set link to Team files directory at workspace tasks interface, use

See the full on how to add Private Apps using CLI.

🎉
here
tutorial
following command