Skip to main content

CLI Overview

Saleor provides a convenient command-line tool to speed the development around Saleor. Using our CLI you can interact with the Saleor platform using a terminal or through an automated system to quickly create and manage Saleor environments, test storefront installation and deploy to cloud providers such as Vercel or Netlify, and more.

Installing the CLI

with pnpm

pnpm i @saleor/cli -g

or

with npm

npm i @saleor/cli -g

From now on, you can interact with the Saleor CLI using the saleor name. If run with no parameters, it will show all available commands

saleor

Quickstart

Login with you Saleor Could account:

saleor login

The saleor login command allows you to establish the current user session in CLI. This will initiate an OAuth process. A browser window will open with the Saleor Cloud login page. Once authenticated, the CLI will receive an authentication token that will be stored locally for the CLI to access.

If your environment doesn't support the browser use the --headless flag. The CLI will prompt for an Access Token skipping the need of browser operations. Create the Access Token at https://cloud.saleor.io/tokens.

Video introduction to Saleor CLI

Common options

The following options can be used with all available commands

--help

Show help

Alias: -h

saleor environment --help

--json

Output the data as JSON

saleor environment list --json

--short

Output data as text

saleor environment --short

Default: false

--instance

Saleor instance to work with

Alias: -u, --url

saleor app install --instance="https://vercel.saleor.cloud/graphql/"

--version

Show version number

Alias: -V

saleor --version

Available commands