@creative-locator/shopify-cli
v0.2.0
Published
Command-line client for the Creative Locator Shopify app's external REST API — the WP-CLI `wp crloc` equivalent for non-Shopify callers.
Readme
@creative-locator/shopify-cli
Command-line client for the Creative Locator Shopify app's external REST API — the npm-published equivalent of the WordPress plugin's wp crloc commands, for non-Shopify callers (your own backend, scripts, CI, a mobile app).
It talks to the app's bearer-authenticated external endpoints using an app-issued API key (minted in the app's admin → API keys, Enterprise tier).
Install
npm i -g @creative-locator/shopify-cli
# or run ad-hoc:
npx @creative-locator/shopify-cli status --url https://your-app.example.comConfiguration
Every command needs the app's base URL; dealer/taxonomy commands also need an API key. Pass them as flags or environment variables:
| Flag | Environment variable |
| ----------------- | ----------------------- |
| --url <url> | CRLOC_SHOPIFY_URL |
| --api-key <key> | CRLOC_SHOPIFY_API_KEY |
Commands
crloc-shopify status # check the app is reachable (public; no key)
crloc-shopify dealers list # list mappable dealers (requires dealers:read)
crloc-shopify dealers count # dealer count only
crloc-shopify taxonomies list # taxonomy facet counts (requires taxonomies:read)Add --json to any command to emit the raw API response instead of a summary.
export CRLOC_SHOPIFY_URL=https://your-app.example.com
export CRLOC_SHOPIFY_API_KEY=crloc_xxxxxxxx
crloc-shopify dealers count
crloc-shopify taxonomies list --jsonScopes
A key only reaches the endpoints its scopes allow:
dealers:read→dealers list/dealers counttaxonomies:read→taxonomies list
A call with a key lacking the required scope returns 403.
Programmatic use
The HTTP client is exported for use in scripts:
import { CreativeLocatorShopifyClient } from '@creative-locator/shopify-cli';
const client = new CreativeLocatorShopifyClient({
baseUrl: process.env.CRLOC_SHOPIFY_URL!,
apiKey: process.env.CRLOC_SHOPIFY_API_KEY,
});
const { total } = (await client.dealers({ countOnly: true })) as { total: number };License
GPL-2.0-or-later
