Install the Gradient CLI
How to install the Gradient Command Line Interface
Last updated
How to install the Gradient Command Line Interface
Last updated
The Gradient CLI is available on 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.
You can either stash your API key on your computer or include your API key on each command.
Alternatively, you can include your API key with each command:
Note: You can reveal your current API key with cat ~/.paperspace/config.json
For Python 3.4+
First, install virtualenv
:
Create a new virtual environment:
Activate the virtual environment:
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 activation script by:
(_GRADIENT_COMPLETE=source gradient) > ~/paperspace_complete.sh
and then add . ~/paperspace_complete.sh
to your .bashrc
, .zshrc
or activate
script.
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. for more instructions.
First, , and then:
Sign in to your and create a new API key. You'll use the API keys you generate here to authenticate your requests.
More: