Skip to main content
The code studio edits a storefront’s files in the browser. The CLI lets you edit the same files on your own computer, in your own editor, with your own tools around them. Each file you save is sent to the storefront’s draft, and buyers see nothing until you publish. It works on storefronts that can be edited as code. A storefront from before its theme could be, is copied first: see Storefronts.

Installing it

It needs Node.js 20 or newer, and nothing else.

Signing in

The CLI shows a code and opens the dashboard, which asks whether the code on the page is the one in your terminal. Check that it is, pick the store, and press Yes, Approve. You are asked to confirm it is you, as for any new API key. The CLI is given an API key for that store that can read, change and publish its storefronts, and nothing else. It is listed under Developers, then API Keys, named after your computer, where you can revoke it like any other key. On your computer it is kept in your system’s keychain (on macOS, and on Linux with secret-tool), or else in a file only you can read. If you did not run shoply login yourself, press No, Deny. A sign-in you did not answer ends after ten minutes. To work on more than one store, sign in to each. shoply use <store> picks which one commands work on, by the store’s address name.

Working on a storefront

shoply clone lists the store’s storefronts and copies the one you pick into a new folder. A storefront that has never been opened as code is given files of its own first, copied from its theme. Nothing buyers see changes. shoply dev watches the folder. A moment after you save a file, it is sent to the storefront’s draft, and a mistake in a template is said at once with its file and line. It prints a link to preview the draft on your store’s own address; refresh it after a save to see the change. The link lasts an hour, and dev prints a fresh one before it runs out. When the draft is ready:
It sends anything not yet sent, then puts the draft live, its files and its design together, and makes the storefront the one buyers see. A mistake in a template stops it, and says where.

The folder

Anything else in the folder (a README, your own notes) is yours and is never sent. A file name is small letters, digits, hyphens and underscores. A file that came with the theme can be changed, but not deleted or renamed: delete one and the CLI puts it back.

If the code studio changed it too

The CLI never saves over a change made somewhere else since you last pulled. It says which file, and you choose:
shoply status says what you have changed, and which files changed on Shoply.

Every command

What it uses

The CLI talks to Shoply through the API, with the key it was given: the storefront code routes, under Storefront code. A script of your own can do the same with a key that has the storefront permissions.