Command Line Interface (CLI)

The CLI provides a command-line interface to interact with the API. It’s most useful for retrieving and managing job status and results. See the installation guide to install the CLI.

Account Management

Authentication

To authenticate you’ll need an API key. We’re currently in beta, please contact us to get signed up on our web app, where you’ll create and manage your API keys. Once you have an API key, you can authenticate with the CLI using:
sutro login

Viewing quotas

To get your current quotas, use:
sutro quotas

Job Commands

Listing current and historical jobs

To list jobs associated with your API key, use:
sutro jobs list --all
By default this will only list the most recent 25 jobs. To see all jobs, use the --all flag:

Getting job status by job_id

To get the status of a job by its ID, use:
sutro jobs status <job_id>

Getting job results by job_id

To get the results of a job by its ID, use:
sutro jobs results <job_id>
There are several optional flags you can use to customize the results:
  • You can also include the inputs in the results by using the --include-inputs flag.
  • You can also include the cumulative logprobs by using the --include-cumulative-logprobs flag.
  • You can also save the results to a file by using the --save flag.
  • If using the --save flag, you can also specify the format of the output file by using the --format flag. Options are parquet and csv, default is parquet.
sutro jobs results <job_id> --include-inputs --include-cumulative-logprobs
You can also save the results to a file by using the --save flag:
sutro jobs results <job_id> --save

Cancelling a running job by job_id

To cancel a running priority 1 job by its ID, use:
sutro jobs cancel <job_id>

Attaching to a running job by job_id

To attach to a running job by its ID, use:
sutro jobs attach <job_id>
If the job is in progress, this will display a progress bar and live metrics around the job’s completion. If the job is in a terminal state, the command will exit. You can also attach to the latest job by using the --latest flag:
sutro jobs attach --latest

Dataset Commands

Creating a new dataset

To create a dataset, use:
sutro datasets create <dataset_id>

Uploading files to dataset via CLI

To upload a file to a dataset, use:
sutro datasets upload <dataset_id> <file_path>
If a dataset_id is not provided, a new dataset will be created. The file_path parameter can be a single file path or a directory path. If a directory path is provided, all files in the directory will be uploaded to the dataset.

Downloading files from dataset via CLI

To download a file from a dataset, use:
sutro datasets download <dataset_id> <file_name> <output_path>
If no file_name is provided, all files in the dataset will be downloaded. If no output_path is provided, the file will be saved to the current working directory.

Listing files in a dataset by dataset_id

To list files in a dataset by dataset_id, use:
sutro datasets files <dataset_id>

Listing user datasets

To list all datasets associated with your API key, use:
sutro datasets list

Other commands

To open the Sutro documentation in your browser, use:
sutro docs
To view commands, simply run:
sutro 
or
sutro --help