Robocorp CLI user manual

Here we look in detail at each command that the Robocorp CLI tool provides.

Overview

You can get a list of all available commands by calling the rcc command with no arguments:

$ rcc

rcc               rcc is environment manager for Robocorp Developer Tools
|
| cloud           Group of commands related to `Robocorp Cloud`.
| | authorize     Convert an API key to a valid authorization JWT token.
| | download      Fetch an existing robot from Robocorp Cloud.
| | new           Create a new robot into Robocorp Cloud.
| | pull          Pull a robot from Robocorp Cloud and unwrap it into local directory.
| | push          Wrap the local directory and push it into Robocorp Cloud as a specific robot.
| | upload        Push an existing robot to Robocorp Cloud.
| | userinfo      Query user information from Robocorp Cloud.
| | workspace     List the available workspaces and their tasks.
|
| conda           Group of commands related to `conda installation`.
| | check         Check if conda is installed in managed location.
| | download      Download the miniconda3 installer.
| | install       Install miniconda into the managed location.
|
| configure       Group of commands related to `rcc configuration`.
| | credentials   Manage Robocorp Cloud API credentials.
|
| env             Group of commands related to `environment management`.
| | cleanup       Cleanup old managed virtual environments.
| | delete        Delete one managed virtual environment.
| | list          Listing currently managed virtual environments.
| | new           Creates a new managed virtual environment.
| | variables     Export environment specific variables as a JSON structure.
|
| help            Help about any command
|
| man             Group of commands related to `rcc documentation`.
| | eula          Show the Robocorp End User License Agreement.
|
| robot           Group of commands related to `robot`.
| | fix           Automatically fix known issues inside robots.
| | initialize    Create a directory structure for a robot.
| | libs          Manage library dependencies in an action oriented way.
| | list          List or update tracked robot directories.
| | unwrap        Unpack a robot back into a directory structure.
| | wrap          Build a robot out of directory content.
|
| task            Group of commands related to `task`.
| | run           Run task in place, to debug current setup.
| | shell         Run the given command inside the given environment
| | testrun       Run a task in a clean environment and clean directory.
|
| version         Show rcc version number.

You can get more information about the usage of each command by using the -h or --help optional argument. For example, calling:

rcc robot initialize --help

would show details about the usage and supported arguments for the rcc robot initialize command.

cloud commands

Group of commands related to Robocorp Cloud.

authorize

Convert an API key to a valid authorization JWT token.

Usage:
  rcc cloud authorize [flags]

Flags:
  -g, --granularity string   Authorization granularity (user/workspace) used in.
  -h, --help                 help for authorize
  -m, --minutes int          How many minutes the authorization should be valid for.
  -w, --workspace string     Workspace id to use with this command.

Global Flags:
  -a, --account string   Account used for Robocorp Cloud operations.
      --config string    config file (default is $ROBOCORP/rcc.yaml)
      --debug            to get debug output where available
      --separator        write one line separator '--' before JSON output
      --silent           be less verbose on output

download

Fetch an existing robot from Robocorp Cloud.

Usage:
  rcc cloud download [flags]

Flags:
  -h, --help               help for download
  -r, --robot string       The robot id to use as the download source.
  -w, --workspace string   The workspace id to use as the download source.
  -z, --zipfile string     The filename for the downloaded robot.

Global Flags:
  -a, --account string   Account used for Robocorp Cloud operations.
      --config string    config file (default is $ROBOCORP/rcc.yaml)
      --debug            to get debug output where available
      --separator        write one line separator '--' before JSON output
      --silent           be less verbose on output

new

Create a new robot into Robocorp Cloud.

Usage:
  rcc cloud new [flags]

Flags:
  -h, --help               help for new
  -r, --robot string       Name for new robot to create.
  -w, --workspace string   Workspace id to use as creation target.

Global Flags:
  -a, --account string   Account used for Robocorp Cloud operations.
      --config string    config file (default is $ROBOCORP/rcc.yaml)
      --debug            to get debug output where available
      --separator        write one line separator '--' before JSON output
      --silent           be less verbose on output

pull

Pull a robot from Robocorp Cloud and unwrap it into local directory.

Usage:
  rcc cloud pull [flags]

Flags:
  -d, --directory string   The root directory to extract the robot into.
  -f, --force              Remove safety nets around the unwrapping of the robot.
  -h, --help               help for pull
  -r, --robot string       The robot id to use as the download source.
  -w, --workspace string   The workspace id to use as the download source.

Global Flags:
  -a, --account string   Account used for Robocorp Cloud operations.
      --config string    config file (default is $ROBOCORP/rcc.yaml)
      --debug            to get debug output where available
      --separator        write one line separator '--' before JSON output
      --silent           be less verbose on output

push

Wrap the local directory and push it into Robocorp Cloud as a specific robot.

Usage:
  rcc cloud push [flags]

Flags:
  -d, --directory string     The root directory to create the robot from. (default ".")
  -h, --help                 help for push
  -i, --ignore stringArray   Files containing ignore patterns.
  -r, --robot string         The robot id to use as the upload target.
  -w, --workspace string     The workspace id to use as the upload target.

Global Flags:
  -a, --account string   Account used for Robocorp Cloud operations.
      --config string    config file (default is $ROBOCORP/rcc.yaml)
      --debug            to get debug output where available
      --separator        write one line separator '--' before JSON output
      --silent           be less verbose on output

upload

Push an existing robot to Robocorp Cloud.

Usage:
  rcc cloud upload [flags]

Flags:
  -h, --help               help for upload
  -r, --robot string       The robot id to use as the upload target.
  -w, --workspace string   The workspace id to use as the upload target.
  -z, --zipfile string     The filename for the robot. (default "robot.zip")

Global Flags:
  -a, --account string   Account used for Robocorp Cloud operations.
      --config string    config file (default is $ROBOCORP/rcc.yaml)
      --debug            to get debug output where available
      --separator        write one line separator '--' before JSON output
      --silent           be less verbose on output

userinfo

Query user information from Robocorp Cloud.

Usage:
  rcc cloud userinfo [flags]

Aliases:
  userinfo, user

Flags:
  -h, --help   help for userinfo

Global Flags:
  -a, --account string   Account used for Robocorp Cloud operations.
      --config string    config file (default is $ROBOCORP/rcc.yaml)
      --debug            to get debug output where available
      --separator        write one line separator '--' before JSON output
      --silent           be less verbose on output

workspace

List the available workspaces and their tasks.

Usage:
  rcc cloud workspace [flags]

Flags:
  -h, --help               help for workspace
  -w, --workspace string   The id of the workspace to use with this command.

Global Flags:
  -a, --account string   Account used for Robocorp Cloud operations.
      --config string    config file (default is $ROBOCORP/rcc.yaml)
      --debug            to get debug output where available
      --separator        write one line separator '--' before JSON output
      --silent           be less verbose on output

conda commands

Group of commands related to conda installation.

check

Check if conda is installed in managed location.

Usage:
  rcc conda check [flags]

Flags:
  -h, --help      help for check
  -i, --install   If conda is missing, download and install it automatically.

Global Flags:
      --config string   config file (default is $ROBOCORP/rcc.yaml)
      --debug           to get debug output where available
      --separator       write one line separator '--' before JSON output
      --silent          be less verbose on output

download

Download the miniconda3 installer.

Usage:
  rcc conda download [flags]

Flags:
  -h, --help   help for download

Global Flags:
      --config string   config file (default is $ROBOCORP/rcc.yaml)
      --debug           to get debug output where available
      --separator       write one line separator '--' before JSON output
      --silent          be less verbose on output

install

Install miniconda into the rcc managed location. Before executing this command, you must successfully run the "download" command and verify that the miniconda SHA256 matches the one on the conda site.

Usage:
  rcc conda install [flags]

Flags:
  -h, --help   help for install

Global Flags:
      --config string   config file (default is $ROBOCORP/rcc.yaml)
      --debug           to get debug output where available
      --separator       write one line separator '--' before JSON output
      --silent          be less verbose on output

configure commands

Group of commands to configure rcc with your settings.

credentials

Manage Robocorp Cloud API credentials for later use.

Usage:
  rcc configure credentials [credentials] [flags]

Flags:
  -d, --default           Set this as the default account.
  -e, --endpoint string   Robocorp Cloud endpoint used with the given account (or default).
  -h, --help              help for credentials
  -j, --json              Output in JSON format.
  -v, --verified          Updates the verified timestamp, if the credentials are still active.

Global Flags:
  -a, --account string   Account used for Robocorp Cloud task.
      --config string    config file (default is $ROBOCORP/rcc.yaml)
      --debug            to get debug output where available
      --separator        write one line separator '--' before JSON output
      --silent           be less verbose on output

env commands

Group of commands related to environment management.

cleanup

Cleanup removes old virtual environments from existence. After cleanup, they will not be available anymore.

Usage:
  rcc env cleanup [flags]

Flags:
  -a, --all        Cleanup all enviroments.
      --days int   What is the limit in days to keep environments for (deletes environments older than this). (default 30)
  -d, --dryrun     Don't delete environments, just show what would happen.
  -h, --help       help for cleanup

Global Flags:
      --config string   config file (default is $ROBOCORP/rcc.yaml)
      --debug           to get debug output where available
      --separator       write one line separator '--' before JSON output
      --silent          be less verbose on output

delete

Delete the given virtual environment from existence. After deletion, it will not be available anymore.

Usage:
  rcc env delete [flags]

Flags:
  -h, --help   help for delete

Global Flags:
      --config string   config file (default is $ROBOCORP/rcc.yaml)
      --debug           to get debug output where available
      --separator       write one line separator '--' before JSON output
      --silent          be less verbose on output

list

Listing currently managed virtual environments.

Usage:
  rcc env list [flags]

Flags:
  -h, --help   help for list

Global Flags:
      --config string   config file (default is $ROBOCORP/rcc.yaml)
      --debug           to get debug output where available
      --separator       write one line separator '--' before JSON output
      --silent          be less verbose on output
➜  ~

new

The new command can be used to create a new managed virtual environment. When given multiple conda.yaml files, they will be merged together and the end result will be a composite environment.

Usage:
  rcc env new <conda.yaml+> [flags]

Flags:
  -f, --force   Force conda cache update. (only for new environments)
  -h, --help    help for new

Global Flags:
      --config string   config file (default is $ROBOCORP/rcc.yaml)
      --debug           to get debug output where available
      --separator       write one line separator '--' before JSON output
      --silent          be less verbose on output

variables

Export environment specific variables as a JSON structure.

Usage:
  rcc env variables <conda.yaml*> [flags]

Aliases:
  variables, vars

Flags:
      --account string       Account used for workspace. <optional>
  -e, --environment string   Full path to 'env.json' development environment data file. <optional>
  -f, --force                Force conda cache update. (only for new environments)
  -h, --help                 help for variables
  -j, --json                 Output in JSON format
  -m, --minutes int          How many minutes the authorization should be valid for. <optional>
  -r, --robot string         Full path to 'robot.yaml' configuration file. (Backward compatibility with 'package.yaml')  <optional>
  -t, --task string          Task to run from configuration file. <optional>
  -w, --workspace string     Optional workspace id to get authorization tokens for. <optional>

Global Flags:
      --config string   config file (default is $ROBOCORP/rcc.yaml)
      --debug           to get debug output where available
      --separator       write one line separator '--' before JSON output
      --silent          be less verbose on output

man commands

Group of commands related to rcc documentation.

eula

Show the Robocorp End User License Agreement.

Usage:
  rcc man eula [flags]

Flags:
  -h, --help   help for eula

Global Flags:
      --config string   config file (default is $ROBOCORP/rcc.yaml)
      --debug           to get debug output where available
      --separator       write one line separator '--' before JSON output
      --silent          be less verbose on output

robot commands

This set of commands relate to Robocorp Cloud related tasks. They are executed either locally, or in connection to Robocorp Cloud and Robocorp App.

fix

Automatically fix known issues inside robots. Current fixes are:

  • make files in PATH folder executable
  • convert .sh newlines to unix form
Usage:
  rcc robot fix [flags]

Flags:
  -h, --help           help for fix
  -r, --robot string   Full path to 'robot.yaml' configuration file.

Global Flags:
      --config string   config file (default is $ROBOCORP/rcc.yaml)
      --debug           to get debug output where available
      --separator       write one line separator '--' before JSON output
      --silent          be less verbose on output

initialize

Create a directory structure for a robot.

Usage:
  rcc robot initialize [flags]

Aliases:
  initialize, init

Flags:
  -d, --directory string   Root directory to create the new robot in.
  -f, --force              Force the creation of the robot and possibly overwrite data.
  -h, --help               help for initialize
  -l, --list               List available templates.
  -t, --template string    Template to use to generate the robot content. (default "standard")

Global Flags:
      --config string   config file (default is $ROBOCORP/rcc.yaml)
      --debug           to get debug output where available
      --separator       write one line separator '--' before JSON output
      --silent          be less verbose on output

libs

Manage library dependencies in an action oriented way.

Usage:
  rcc robot libs [flags]

Aliases:
  libs, library, libraries

Flags:
  -a, --add stringArray      Add new libraries as requirements.
  -c, --channel              Operate on channels (default is packages).
      --conda string         Full path to the conda environment configuration file (conda.yaml).
  -d, --dryrun               Do not save the end result, just show what would happen.
  -h, --help                 help for libs
  -n, --name string          Change the name of the configuration.
  -p, --pip                  Operate on pip packages (the default is to operate on conda packages).
  -r, --remove stringArray   Remove existing libraries from requirements.

Global Flags:
      --config string   config file (default is $ROBOCORP/rcc.yaml)
      --debug           to get debug output where available
      --separator       write one line separator '--' before JSON output
      --silent          be less verbose on output

list

List or update tracked robot directories.

Usage:
  rcc robot list [flags]

Flags:
  -a, --add string   The root directory to add as robot.
  -h, --help         help for list
  -j, --json         Output in JSON format.

Global Flags:
      --config string   config file (default is $ROBOCORP/rcc.yaml)
      --debug           to get debug output where available
      --separator       write one line separator '--' before JSON output
      --silent          be less verbose on output

unwrap

Unpack a robot back into a directory structure. This command expects to get robot filename, and target directory. And using --force option, files will be overwritten.

Usage:
  rcc robot unwrap [flags]

Flags:
  -d, --directory string   The root directory to extract robot into.
  -f, --force              Remove the safety nets around the unwrapping of the robot.
  -h, --help               help for unwrap
  -z, --zipfile string     The filename for the robot to extract.

Global Flags:
      --config string   config file (default is $ROBOCORP/rcc.yaml)
      --debug           to get debug output where available
      --separator       write one line separator '--' before JSON output
      --silent          be less verbose on output

wrap

Build a robot out of directory content.

Build a robot out of directory content. This command expects to get robot
filename, source directory and optional ignore files. When wrap is run again
existing robot file will silently be overwritten..

Usage:
  rcc robot wrap [flags]

Flags:
  -d, --directory string     The root directory create the robot from. (default ".")
  -h, --help                 help for wrap
  -i, --ignore stringArray   File with ignore patterns.
  -z, --zipfile string       The filename for the robot. (default "robot.zip")

Global Flags:
      --config string   config file (default is $ROBOCORP/rcc.yaml)
      --debug           to get debug output where available
      --separator       write one line separator '--' before JSON output
      --silent          be less verbose on output

task commands

This set of commands relate to Robocorp Cloud related tasks. They are executed either locally, or in connection to Robocorp Cloud and Robocorp App.

run

Run task in place, to debug current setup.

Usage:
  rcc task run [flags]

Flags:
      --account string       Account used for workspace. OPTIONAL
  -e, --environment string   Full path to the 'env.json' development environment data file.
  -f, --force                Force conda cache update (only for new environments).
  -h, --help                 help for run
  -m, --minutes int          How many minutes the authorization should be valid for. OPTIONAL
  -r, --robot string         Full path to the 'robot.yaml' configuration file. (Backward compatibility with 'package.yaml')
  -t, --task string          Task to run from the configuration file.
  -w, --workspace string     Optional workspace id to get authorization tokens for. OPTIONAL

Global Flags:
      --config string   config file (default is $ROBOCORP/rcc.yaml)
      --debug           to get debug output where available
      --separator       write one line separator '--' before JSON output
      --silent          be less verbose on output

shell

Shell command executes the given command inside a managed virtual environment. It can be used to get inside a managed environment and execute your own command within that environment.

Usage:
  rcc task shell [flags]

Flags:
  -e, --environment string   Full path to the 'env.json' development environment data file.
  -h, --help                 help for shell
  -r, --robot string         Full path to the 'robot.yaml' configuration file. (With backward compatibility with 'package.yaml')
  -t, --task string          Task to configure shell from configuration file.

Global Flags:
      --config string   config file (default is $ROBOCORP/rcc.yaml)
      --debug           to get debug output where available
      --separator       write one line separator '--' before JSON output
      --silent          be less verbose on output

testrun

Run a task in a clean environment and clean directory.

Usage:
  rcc task testrun [flags]

Flags:
      --account string       Account used for workspace. OPTIONAL
  -e, --environment string   Full path to the 'env.json' development environment data file.
  -f, --force                Force conda cache update. (only for new environments)
  -h, --help                 help for testrun
  -i, --ignore stringArray   File with ignore patterns.
  -m, --minutes int          How many minutes the authorization should be valid for. OPTIONAL
  -r, --robot string         Full path to the 'robot.yaml' configuration file. (Backward compatibility with 'package.yaml')
  -t, --task string          Task to run from configuration file.
  -w, --workspace string     Optional workspace id to get authorization tokens for. OPTIONAL

Global Flags:
      --config string   config file (default is $ROBOCORP/rcc.yaml)
      --debug           to get debug output where available
      --separator       write one line separator '--' before JSON output
      --silent          be less verbose on output