Install and sign in to the EcomWeb CLI

The EcomWeb CLI is a command-line tool for working with your store, for example listing products, updating orders, managing custom data and getting theme code. AI assistants such as Claude Code and Codex also use the CLI to work on your store.

You sign in by approving in your browser, with no API key. The CLI uses your own role in each store.

Install the CLI

The CLI needs Node.js 24 or later. The install command uses npm, which comes with Node.js.

  1. Install Node.js from nodejs.org if your computer does not have it.
  2. Open a terminal.
  3. Run the install command below.
Terminal
# Install the EcomWeb CLI for your whole computer
npm install -g @ecomweb/cli
# Check that the CLI is installed
ecomweb --help

If you prefer not to install it, run each command through npx, for example npx @ecomweb/cli auth login.

Sign in

  1. Run the sign-in command below. The terminal shows an 8-letter code and opens your browser.
  2. Sign in to the dashboard if the browser asks you to.
  3. On the Sign in to ecomweb CLI? page, compare the Code with the code in your terminal.
  4. If the two codes match, click Approve.
  5. When the page says Done, go back to the terminal.
  6. If you have several stores, choose the store you want to work in from the list.
Terminal
ecomweb auth login
# Or sign in and pick a store at the same time
ecomweb auth login --store-ref <store ref>

The Sign in to ecomweb CLI? page also shows which Device is asking to sign in and the address the request came from. If you did not just run the sign-in command, click Deny.

If the browser does not open on its own, open the link the terminal printed. If the page shows an Enter your sign-in code box, enter the code and click Continue. A code can only be used once and expires after 10 minutes. When the page says This code is no longer valid, run the sign-in command again.

Choose the store to work in

Every command works on the selected store. The store ref is the part after /store/ in the address bar when you open your store in the dashboard.

Terminal
# See your stores
ecomweb stores list
# Switch to another store
ecomweb stores switch <store ref>
# See the selected store
ecomweb stores current

To run one command on another store without changing the selected store, add –store-ref to that command.

Run your first commands

The default output is JSON, which scripts and AI assistants read easily. Add –output table to see a table.

Terminal
ecomweb products list --output table
ecomweb orders list --output table
# See all command groups
ecomweb --help
# See the commands and options of one group
ecomweb products --help

Many commands that change data accept –dry-run to preview without changing anything. Check ecomweb <command> --help to be sure a command supports it.

Check and sign out

Terminal
# Which account you are signed in with
ecomweb auth status
# Sign out and end this CLI's session
ecomweb auth logout

To run the CLI in CI or on a server, create an API key with only the scopes it needs. See Create and manage API keys.

Frequently asked questions

What can the CLI do in my store?

Exactly what your role in that store allows. For example, if you are staff, the CLI cannot change settings that staff cannot change in the dashboard.

How do I sign in when I run the CLI on a server or in CI?

No one is there to approve, so use the store's API key. Put the key in the ECOMWEB_API_KEY variable. The key takes priority over a sign-in session.

The code on the page does not match the code in my terminal?

Click Deny. Someone may be trying to sign in with your account. Then run ecomweb auth login again if you need to.

Where is my sign-in session stored?

In your operating system's credential store, for example Keychain on macOS. If your computer has no such store, the CLI saves it in your config folder, readable only by your account.

What did you think about this content?

Your answer is used to improve the help center, per our Privacy Policy.