The Gradient CLI is available on PyPI and works on Windows, MacOS, and Linux.
The CLI requires Python 3.4+ (or Python 2.7). Be sure to use a compatible version of pip (or pip3) depending on your Python version.
Pro Tip! We highly recommend installing and using the CLI within a Python virtual environment. This will minimize conflicts with existing libraries on your computer. We recommend virtualenv. See below for more instructions.
Install the CLI
Using pip to install the latest stable release
pip install -U gradient
The -U option upgrades all specified packages to the newest available version.
You can verify that it is working by running
which will output a version like v1.8.6.
Connecting your account
You can either stash your API key on your computer or include your API key on each command. The latter can be useful if you are working on several teams at the same time, as each team has its own API key.
Alternatively, you can set the environment variable PAPERSPACE_API_KEY temporarily to override your configured api key.
gradient workflows run ...
Note: You can reveal your current API key with cat ~/.paperspace/config.json
Obtaining an API key
Obtain an API key from the settings page. 1m27s.
Sign in to your Paperspace account and create a new API key. You'll use the API keys you generate here to authenticate your requests.
Using a virtual environment
For Python 3.4+
First, install virtualenv:
pip install virtualenv
Create a new virtual environment:
python3 -m virtualenv <virtual_env_dir_path>
Activate the virtual environment:
Virtualenvs can also be run in other ways, e.g., using conda.
Add the following to your .bashrc (or .zshrc) to enable autocomplete anytime you activate your shell. If Gradient was installed in a virtual environment, the following has to be added to the activate script:
eval "$(_GRADIENT_COMPLETE=source gradient)"
Alternatively, you can create an activation script by: