Gradient Docs
Gradient HomeHelp DeskCommunitySign up free
Gradient Next
Gradient Next
  • About Gradient
  • Get Started
    • Quick Start
      • Install the Gradient CLI
    • Core Concepts
    • Organizing Projects
      • Secrets
      • Storing an API key as a Secret
    • Tutorials
      • Gradient Notebooks Tutorial
      • Gradient Workflows Tutorial
      • Gradient Deployments Tutorial
    • FAQ
    • Common Errors
  • Gradient Platform
    • Gradient Notebooks
      • Runtimes
      • Files and storage
      • Machines
      • Terminal
      • Shortcuts
      • Sharing
      • TensorBoard
      • Run on Gradient
    • Gradient Workflows
      • Basic operations
      • Understanding Inputs & Outputs
      • Workflow Spec
      • Gradient Actions
      • Environment Variables
      • Using YAML for Data Science
    • Gradient Deployments
      • Basic operations
      • Deployment Spec
  • Artifacts
    • Container Management
      • Custom Containers
    • Data
      • Versioned Data
        • Public Datasets Repository
        • Storage Providers
      • Persistent Storage
    • Models
      • Managing Models
        • Model Types & Metadata
        • Public Models
    • Code
    • Metrics
      • Push Metrics
      • View & Query Metrics
  • Gradient Cluster
    • Overview
      • Setup
        • Managed Private Clusters
        • Self-Hosted Clusters
          • Pre-installation steps
          • Gradient Installer CLI
          • Terraform
            • Pre-installation steps
            • Install on AWS
            • Install on bare metal / VMs
            • Install on NVIDIA DGX
          • Let's Encrypt DNS Providers
          • Updating your cluster
      • Usage
  • More
    • SDK
      • Projects Client
      • Models Client
      • Deployments Client
      • Workflows Client
      • SDK Examples
      • Full SDK Reference
    • Machine Types
      • Machine Tiers
      • Free Machines (Free Tier)
    • Your Account
      • Teams
        • Creating a Team
        • Upgrading to a Team Plan
      • Hotkeys
      • Billing & Subscriptions
        • Storage Billing
      • Public Profiles
    • Release notes
    • Roadmap
Powered by GitBook
On this page
  • Installation
  • Install the CLI
  • Connecting your account
  • Set your active API key
  • Obtaining an API key
  • Using a virtual environment
  • Enable autocomplete
  • Install the latest pre-release version
  1. Get Started
  2. Quick Start

Install the Gradient CLI

How to install the Gradient Command Line Interface

PreviousQuick StartNextCore Concepts

Last updated 3 years ago

This is an optional procedure for those who wish to interact with Gradient via the command line interface (CLI), in addition to the GUI or SDK.

For a full reference on all CLI commands, check out the

Installation

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.

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

gradient version

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.

Set your active API key

gradient apiKey XXXXXXXXXXXXXXXXXXX

Alternatively, you can set the environment variable PAPERSPACE_API_KEY temporarily to override your configured api key.

export PAPERSPACE_API_KEY=XXXX
gradient workflows run ...

Note: You can reveal your current API key with cat ~/.paperspace/config.json

Obtaining an API key

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:

source <virtual_env_dir_path>/bin/activate

Virtualenvs can also be run in other ways, e.g., using conda.

Enable autocomplete

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:

(_GRADIENT_COMPLETE=source gradient) > ~/paperspace_complete.sh

and then add . ~/paperspace_complete.sh to your .bashrc, .zshrc or activate script.

Install the latest pre-release version

If you need a pre-release version of the CLI use the following command to install it:

pip install -U --pre gradient

The Gradient CLI is available on and works on Windows, MacOS, and Linux.

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.

For more, see .

PyPI
Paperspace account
https://click.palletsprojects.com/en/7.x/bashcomplete/
See below
obtain an API Key
command reference
Learn how to install the Gradient CLI. 1m35s.
Obtain an API key from the settings page. 1m27s.