# Headless & CI

> Run the Shoplazza AI Toolkit without a browser: authenticate with a User Access Token, install in CI, parse JSON output, and keep unattended writes safe.

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 it through environment variables so nothing is stored on disk:

```shell
export SHOPLAZZA_UAT=your-token
export SHOPLAZZA_STORE=my-store.myshoplaza.com
shoplazza products +search --keyword "shirt"
```

Generate a UAT from the Shoplazza partner dashboard, 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](/docs/app/developer-tools/shoplazza-cli/install).

## Structured output for pipelines

Every command returns JSON by default, so a headless agent can parse and chain results. 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. 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](./safety-and-permissions) for the full model.

## See also

* [Authentication → Non-interactive login](/docs/app/developer-tools/shoplazza-cli/authentication#non-interactive-login-cicd)
* [CI/CD integration](/docs/app/developer-tools/shoplazza-cli/guides/ci-cd)
