Skip to main content

Headless & CI

Run the toolkit in automated environments — CI pipelines, cron jobs, or background agents — without an interactive browser login.

Authenticate with a User Access Token​

Interactive OAuth needs a browser. For headless runs, use a User Access Token (UAT) instead:

shell
shoplazza auth login --uat <your-token> --store-domain my-store.myshoplaza.com

Or pass the token through the SHOPLAZZA_UAT environment variable, which auth login reads when --uat is not given:

shell
export SHOPLAZZA_UAT=your-token
shoplazza auth login --store-domain my-store.myshoplaza.com
shoplazza products +search --keyword "shirt"

Get a UAT by running shoplazza auth login once on a machine with a browser (the login output includes it), and store it as an encrypted secret in your CI system — never in the prompt, a committed file, or the agent's context.

Install in CI​

shell
npm install -g shoplazza-cli
npx skills add Shoplazza/shoplazza-cli -g

For agents that only run API/shortcut commands, the standalone binary works without Node.js — see Install Shoplazza CLI.

Structured output for pipelines​

In CI, or whenever stdout is piped, every command returns JSON by default, so a headless agent can parse and chain results. If your runner gives the CLI a terminal (pty) and CI is not set, add --no-input (or set SHOPLAZZA_CLI_NO_INTERACTIVE=1): it turns off every prompt and keeps the default output JSON. Narrow the output with --jq:

shell
shoplazza orders +count --jq '.data.count'

Keep writes safe in automation​

In an unattended run there is no human to confirm a write, and the CLI's own confirmation prompts for destructive commands only appear at an interactive terminal. Reduce blast radius:

  • Grant read-only scopes when the job only needs to read: --scope read_order,read_product.
  • Keep --dry-run in the pipeline for any write step you want to inspect in logs before enabling it for real.
  • Point automation at a development store first.

See Safety & permissions for the full model.

See also​