mercemur products list, because
GET /api/v1/products already exists and a second spelling of it would only drift.
What the CLI adds is the local half:
Your storefront as files
Templates on disk, in your editor, in your own git history alongside the rest of
your work.
A live edit loop
Save a file, see the change in a preview link, without publishing anything to
shoppers.
Install
/usr/local/bin; set MERCEMUR_INSTALL_DIR to put it somewhere else.
On Windows, add $env:LOCALAPPDATA\Mercemur to your PATH afterwards. The archive contains a
single mercemur.exe.
Versioned URLs are immutable, so
/v0.1.6/... always serves the same bytes. /latest/ moves
with each release, which is why the installer resolves the version first and then downloads from
the versioned path: a download and its checksum fetched either side of a release would otherwise
disagree and look like tampering.Log in
The CLI authenticates with the same API key everything else does. Create one in Settings, API keys with theread_storefront and
write_storefront scopes, then:
MERCEMUR_TOKEN in the
environment instead of running login.
Point it at a store
Every command needs to know which store it is talking to. Four places are checked, and the first one that names a value wins, per setting:
Per setting rather than per layer: a project file naming the API base is still used when
you pass
--store on the command line.
Run mercemur theme info to see which layer won for each setting.
.mercemur.json
Never put an API key in
.mercemur.json. It is a file people commit. Keys live in the
keychain, which is why the CLI has no config field for one.When things go wrong
Transient failures are retried for you. A429, a 5xx or an unreachable API is tried up to
three times, honouring Retry-After when the server sends one.
Retries reuse the same idempotency key, which is what makes them safe. If the first attempt
actually reached the server before the connection dropped, the second is recognised as the same
write rather than applied twice. So a slow command is often a retry in progress, not a hang.
409 means somebody changed the resource under you and sending the
same request again cannot succeed; a 401 means the key was rejected and hammering it is how an
account gets locked.
Ctrl-C stops cleanly. theme dev and webhook tail finish what they are doing and exit rather
than being killed mid-upload, and the same applies to SIGTERM so a container or CI runner
stopping the process does not have to escalate.
Shortcuts
th and wh are aliases for theme and webhook.
Shell completion is built in:
Scripting it
Every command accepts--json and emits a single machine-readable document with no
human-readable lines mixed in, so it composes:
A retry loop that treats every failure alike will spin forever on a revoked key. That is
why
3 and 4 are separate from 1.
Next
Theme workflow
Pull your storefront to disk, edit with live preview, and publish.
Webhook workflow
Send test events, watch deliveries arrive, and replay failures.