Install pks-agent-woocommerce-cli, connect a store, and pull your first catalogue.
curl -fsSL https://agentics.dk/install/agent-woocommerce.sh | bash
Windows (PowerShell):
irm https://agentics.dk/install/agent-woocommerce.ps1 | iex
The script downloads the binary for your platform, verifies it against the
release's SHA-256 checksums, and installs it as pks-agent-woocommerce-cli in
~/.local/bin (override with INSTALL_DIR). Pin a version with VERSION=1.2.3.
Check it:
pks-agent-woocommerce-cli version
pks-agent-woocommerce-cli init
init is a conversation, not a flag wall. It asks for the store URL and the
WooCommerce REST key and secret — both typed hidden, neither echoed
back — then detects how the site routes its REST API and verifies the key
against the store before it saves anything. It tells you where the credential
went: the OS keyring where there is one, otherwise a 0600 file inside a 0700
directory, so nothing implies encryption that is not there.
It also refuses to run without a terminal: credentials never arrive from a pipe
or a flag. Where there is no terminal — a container, a nightly job — skip init
and set PKS_WOO_SITE, PKS_WOO_KEY and PKS_WOO_SECRET instead. That path
stores nothing at all, which is the point of it; see
In a container.
The key needs Read permission only: WooCommerce → Settings → Advanced → REST API → Add key. Creating it is a write on a production site, so get the shop owner's authorization first and revoke the key when the work is done.
Verify at any time, including re-checking the credential against the store:
pks-agent-woocommerce-cli auth status
pks-agent-woocommerce-cli product sync --with-variations
That leaves a ./woo directory: the unedited API responses under
raw/products/, a Markdown file per product, an index.json, and a
sync-state.json recording what was pulled and when. Point it somewhere else
with --dir.
Useful on the first run of a large shop:
| Flag | What it does |
|---|---|
--limit N | Stop after N products — a quick look before committing to the whole catalogue |
--status STATUS | Only one product status (default: any) |
--modified-after TIME | Incremental: only products changed since an ISO 8601 timestamp |
--no-prune | Keep local files for products that have left the store |
--per-page N | Page size, 1–100 (the WooCommerce REST API caps it at 100) |
pks-agent-woocommerce-cli product list
pks-agent-woocommerce-cli product show 1234 # or a SKU
pks-agent-woocommerce-cli pim report
pim report is usually the interesting one: it reads only the local pull and
says, field by field, what product information actually exists — which is the
question behind most catalogue work.
pks-agent-woocommerce-cli export all
ontology.json describes the catalogue's own data model — object types, every
field with its fill rate and owner, the links between them, and the data-quality
findings — for an application to read. ontology.md says the same thing to a
person, and catalogue.xlsx is the spreadsheet version for whoever is going to
fix the gaps.