# Build a store from the CLI

> Create sites, edit themes, pages, and sections, write Liquid theme code, publish, set up payments and shipping, and run an online store with the repzo CLI.

The `repzo` CLI can do everything the [store builder](https://workstation.repzo.com/docs/online-store/store-builder) does: create sites, restyle themes, add and change sections, fill in SEO, write custom [theme code](https://workstation.repzo.com/docs/developers/online-store/theme-code), preview, and publish. It is the main tool for agencies and developers, especially when an AI coding tool does the editing.

Install the CLI and sign in first. See [Developer API and CLI](https://workstation.repzo.com/docs/configuration/developer-api).

> **Note**
>
> The `repzo sites`, `repzo store`, `repzo order-returns`, and `repzo orders edit | fulfillments | cancel` commands on this page require the next CLI release.

## Before you start

The store commands use the **Online Stores** scope (`commerce:read` to read, `commerce:write` to change) and need the Commerce module on the workspace. Signed-in users also need the `commerce.view` permission to read and `commerce.manage` to change anything.

A login made before the CLI knew this scope gets `403 Missing required scope`. Run `repzo auth login` again and grant it.

Like every CLI write, store changes need `--dry-run` (preview the request without sending it) or `--yes` (send it). Pass request bodies with `--data`, as inline JSON, `@file.json`, or `@-` for standard input.

## How a store is stored

- A **site** is one online store or set of landing pages, with its own address, languages, and currency.
- A site has one or more **themes**. Each theme holds a **draft**: its settings, header, footer, and pages. The live theme is the one last published.
- Every edit changes a draft only. Shoppers see nothing until you publish, and each publish saves a **version** you can roll back to.
- Without `--theme THEME_ID`, commands work on the site's live theme. Pass `--theme` to work on a copy or an unpublished theme.
- The draft has a **revision** that goes up on every save. See [Revisions and conflicts](#revisions-and-conflicts).

## Sites

```bash
repzo sites list
repzo sites get SITE_ID
repzo sites create --data '{"name":"Nour Boutique","locales":["en","ar"],"defaultLocale":"en"}' --dry-run
repzo sites update SITE_ID --data '{"stockLocationIds":["LOCATION_ID"]}' --dry-run
```

`sites create` accepts `name`, `slug`, `commerceEnabled` (`false` for landing pages only), `defaultLocale` (`en` or `ar`), `locales`, `currencyCode`, and `template`. The `slug` becomes the free address `<slug>.myrepzo.com`; leave it out to derive one from the name. A new site starts as a draft.

`sites update` also changes `status` (`draft`, `live`, or `password` with a `storePassword`), `title`, and `stockLocationIds`: the locations the store sells stock from, in priority order. Get location ids from `repzo metadata locations`. See [Sites](https://workstation.repzo.com/docs/online-store/sites).

## Starter templates

```bash
repzo store templates list
repzo sites create --data '{"name":"Corner Bakery","template":"hearth"}' --dry-run
repzo store templates apply SITE_ID --data '{"template":"hearth"}' --dry-run
```

The five templates are Atelier (fashion and modest wear), Amber (fragrance and beauty), Hearth (bakery and café), Volt (electronics), and Dar (home and furniture). `templates apply` adds one to an existing site as a new, unpublished theme, so the live store doesn't change. Template texts keep business facts as `[placeholders]` in square brackets; fill them in before you publish.

## Themes

```bash
repzo store themes list SITE_ID
repzo store themes create SITE_ID --data '{"name":"Minimal","style":"minimal"}' --dry-run
repzo store themes duplicate SITE_ID THEME_ID --data '{"name":"Autumn refresh"}' --yes
repzo store themes rename SITE_ID THEME_ID --data '{"name":"Autumn 2026"}' --yes
repzo store themes delete SITE_ID THEME_ID --dry-run
repzo store themes publish SITE_ID THEME_ID --data '{"revision":12}' --dry-run
```

Duplicate the live theme to change a live store safely, edit the copy with `--theme NEW_THEME_ID`, then publish it. The live theme can't be deleted, and a site keeps up to 20 themes.

Read and change a theme's look with `store theme`:

```bash
repzo store theme get SITE_ID --theme THEME_ID
repzo store theme set SITE_ID --theme THEME_ID --data '{"style":"minimal","settings":{"heading_font":"playfair"},"colorSchemes":[{"id":"scheme-1","background":"#faf7f2","text":"#1f2933","button":"#0f766e","button_text":"#ffffff"}]}' --dry-run
```

`theme set` takes `style`, `settings`, `colorSchemes`, and `customCss` (`""` removes it). A style changes the look and keeps every page and section.

### Schedule a theme

Make a theme go live at a set time, for example for a sale launch:

```bash
repzo store themes schedule SITE_ID THEME_ID --data '{"publishAt":"2026-11-01T06:00:00Z"}' --dry-run
repzo store themes unschedule SITE_ID --dry-run
```

`publishAt` must be between 1 minute and 1 year ahead. At that time the theme's latest saved draft is published as the person who scheduled it, so later edits go live too. A site has one schedule; a new one replaces it. Publishing or deleting the theme cancels it, and the live theme can't be scheduled.

### Export and import

```bash
repzo store themes export SITE_ID THEME_ID --quiet > theme.json
jq '{file: .}' theme.json | repzo store themes import OTHER_SITE_ID --data @- --dry-run
```

Import adds a new, unpublished theme named after the file (send `"name"` to rename it). The file is cleaned like any save, so a file from an older version still imports. Images keep their URL but drop a media id that isn't in this workspace.

## Pages and sections

Read a page and the section catalog before adding anything:

```bash
repzo store pages list SITE_ID
repzo store pages get SITE_ID PAGE_ID
repzo store sections types SITE_ID
repzo store sections types SITE_ID --query types=hero,faq
repzo store sections types SITE_ID --query types=@theme
```

Without `types`, you get one line per section type, grouped by category. With `types`, you get those types' settings and block types. `types=@theme` lists the universal blocks.

Add, change, move, and remove sections and blocks:

```bash
repzo store sections add SITE_ID --data '{"type":"faq","pageId":"PAGE_ID","position":2,"settings":{"heading":{"en":"Questions","ar":"أسئلة"}}}' --dry-run
repzo store sections get SITE_ID NODE_ID
repzo store sections update SITE_ID NODE_ID --data '{"settings":{"heading":{"en":"FAQ","ar":"الأسئلة الشائعة"}}}' --dry-run
repzo store sections add-block SITE_ID NODE_ID --data '{"type":"faq_item","settings":{"question":{"en":"Returns?","ar":"الإرجاع؟"}}}' --dry-run
repzo store sections move SITE_ID NODE_ID --data '{"position":0}' --dry-run
repzo store sections move SITE_ID BLOCK_ID --data '{"parentId":"GROUP_OR_SECTION_ID","position":0}' --dry-run
repzo store sections remove SITE_ID NODE_ID --dry-run
```

- `sections add` puts a section on a page (default: home), or in the shared header or footer with `"group":"header"` or `"group":"footer"`.
- `sections update` merges the settings you send. Its `blocks` is the complete new child list, so keep existing blocks by passing their `id`. It also takes `hidden`, `label`, `customCss`, and `layout` (spacing, width, background); `"layout": null` resets it.
- `sections move` with `parentId` moves a block into or out of a group.
- Text settings take one value per site language: `{"en":"New arrivals","ar":"وصل حديثاً"}`.

Change a page's title, address, or search listing:

```bash
repzo store pages update SITE_ID PAGE_ID --data '{"seo":{"title":{"en":"Nour Boutique – Handmade gifts","ar":"بوتيك نور – هدايا يدوية"}}}' --dry-run
```

## Preview, publish, and roll back

```bash
repzo store preview SITE_ID --theme THEME_ID --yes
repzo store publish SITE_ID --theme THEME_ID --data '{"revision":12,"note":"Autumn refresh"}' --dry-run
repzo store versions SITE_ID
repzo store rollback SITE_ID VERSION_ID --dry-run
repzo store rollback SITE_ID VERSION_ID --publish --yes
```

- `preview` makes a 7-day share link to the draft that opens without signing in.
- `publish` needs the draft's current `revision`. With `--theme`, that theme becomes the live theme. Publishing is refused while the theme's code files have errors.
- `rollback` copies a published version back into the draft. With `--publish`, it publishes right away with the restored revision, so nothing else slips in between.

## Edit many files at once: pull, push, dev

`pull` downloads a theme as a folder you edit in your own editor:

```bash
repzo store pull SITE_ID --dir store-nour
repzo store push --dir store-nour --dry-run
repzo store push --dir store-nour --yes
```

| Path | Holds |
|---|---|
| `AGENTS.md` | The theme code guide. Read it (or give it to your AI tool) before writing `.liquid` files. |
| `config/settings.json` | Theme settings: fonts, colors, color schemes. |
| `config/theme.json` | Custom CSS and app embeds. |
| `locales/<lang>.json` | The store's built-in words per language. |
| `sections/header-group.json`, `sections/footer-group.json` | The shared header and footer. |
| `sections/*.liquid`, `blocks/*.liquid`, `snippets/*.liquid` | Custom [theme code](https://workstation.repzo.com/docs/developers/online-store/theme-code). |
| `templates/<page>.json` | One file per page: `index.json`, `product.json`, `page.about.json`… |
| `.repzo-store.json` | The site, theme, revision, and the files the last pull wrote. |

`pull` writes to `./store-<slug>` unless you pass `--dir`, and `--theme THEME_ID` pulls a theme that isn't live. Pulling again into the same folder replaces its files; a folder that holds other files needs `--force`.

When you edit the JSON:

- Keep the ids of existing sections and blocks. New ones can leave `id` out.
- A new file in `templates/` adds a page. Deleting a template file removes one of your own pages; built-in pages (home, product, collection, cart, search…) always exist.

`push --dry-run` sends the folder to the server for checking, without saving. It prints what the server's cleaner would drop or change, any code problems as `file:line:col message`, and a diff of pages, sections, settings, words, and code files. `push --yes` saves the whole draft and refreshes the folder. It refuses while the code has errors (warnings don't stop it). Pushing never publishes.

To check a whole draft without a pulled folder, use `repzo store draft validate SITE_ID --data @draft.json`. `repzo store draft get SITE_ID` reads the whole draft with its revision.

### Live development

```bash
repzo store dev --dir store-nour
```

`dev` prints a share-preview link once, then watches the folder. Each saved change is checked and pushed to the draft, never to the live store; reload the preview to see it. A change with code errors is not pushed: `dev` prints the problem and waits for the next save. It stops if someone else saves the draft in the meantime, so pull again. Press Ctrl+C to stop.

### One file at a time

```bash
repzo store code list SITE_ID
repzo store code get SITE_ID sections/hero-banner.liquid
jq -Rs '{source: .}' hero-banner.liquid | repzo store code put SITE_ID sections/hero-banner.liquid --data @- --dry-run
repzo store code delete SITE_ID sections/hero-banner.liquid --dry-run
repzo store code guide SITE_ID
```

`code list` shows each file's kind, the type it makes (`custom:<name>`), its size, its problem counts, and the pages that use it. `code put` saves a file even when it has errors, because it is only a draft. Deleting a section file keeps its sections on the pages with their settings; they draw nothing until the file comes back. `code guide` prints the same guide `pull` saves as `AGENTS.md`.

## Revisions and conflicts

Every save raises the draft's `revision`:

- Single edits (`sections`, `pages update`, `theme set`, `code put`) accept an optional `revision`. If someone saved since you read it, you get `409 conflict`.
- `push` always sends the revision you pulled. If the store changed since, it refuses: pull again, re-apply your edits, and push.
- `publish` requires the revision. Take it from the last edit's result or from `repzo store draft get`.

## Store from a link

Build a new store's products, photos, and pages from an existing website, Shopify store, or WooCommerce store:

```bash
repzo store import SITE_ID --url https://nour-boutique.example --yes --wait
repzo store import-status SITE_ID
```

It runs in the background and uses AI credit; an empty AI balance returns `402`. One run per site can go at a time. `--wait` follows it for up to 15 minutes. Products arrive as inactive drafts for you to check, and pages and copy go into the live theme's draft only. See [Fox in the builder](https://workstation.repzo.com/docs/online-store/fox-in-the-builder).

## Store content

Collections, menus, content types, discounts, and reviews have their own commands. Menus aren't part of a theme, so menu changes are live at once.

```bash
repzo store collections list
repzo store collections create --data '{"name":"New arrivals","kind":"manual","productIds":["PRODUCT_ID"]}' --dry-run
repzo store menus list SITE_ID
repzo store menus update SITE_ID MENU_ID --data @menu.json --dry-run
repzo store content-types list
repzo store entries create TYPE_ID --data '{"values":{"question":{"en":"Do you deliver?","ar":"هل توصلون؟"}},"status":"published"}' --dry-run
repzo store discounts create --data @discount.json --dry-run
repzo store discounts deactivate DISCOUNT_ID --yes
repzo store reviews list --query status=pending
repzo store reviews update REVIEW_ID --data '{"status":"published"}' --dry-run
repzo store domains list SITE_ID
repzo store domains add SITE_ID --data '{"hostname":"shop.example.com"}' --dry-run
```

| Command group | Subcommands |
|---|---|
| `store collections` | `list`, `get`, `create`, `update`, `delete` |
| `store menus` | `list`, `get`, `create`, `update`, `delete` |
| `store content-types` | `list`, `get`, `create`, `update`, `delete` |
| `store entries` | `list`, `get`, `create`, `update`, `delete` |
| `store discounts` | `list`, `get`, `create`, `update`, `delete`, `deactivate` |
| `store reviews` | `list`, `update`, `delete` |
| `store domains` | `list`, `add`, `remove` |

A menu `update` with `items` replaces the whole tree. The main and footer menus can't be deleted. Adding a domain returns the DNS records the owner must add. See [Navigation and content](https://workstation.repzo.com/docs/online-store/navigation-and-content), [Products and collections](https://workstation.repzo.com/docs/online-store/products-and-collections), and [Discounts](https://workstation.repzo.com/docs/online-store/discounts).

## Set up the store to sell

These commands do what **Commerce → Settings** does in the app. Everything is checked the same way as the settings screens.

Two things can only be done in the app: connecting Aramex, and a standalone **Refund order**. The CLI shows whether Aramex is connected, but never takes or prints its secrets.

### Payments

```bash
repzo store payments list
repzo store payments set cash_on_delivery --data '{"isEnabled":true,"config":{"cities":["Amman","Zarqa"],"maxOrderAmount":300}}' --dry-run
repzo store payments set bank_transfer --data '{"isEnabled":true,"config":{"accountName":"Nour Boutique LLC","bankName":"Arab Bank","iban":"JO94CBJO0010000000000131000302"}}' --dry-run
```

`config` replaces the method's whole settings, so start from `payments list`. See [Checkout & Payments](https://workstation.repzo.com/docs/online-store/checkout-and-payments).

### Shipping

```bash
repzo store shipping get
repzo store shipping zones create --data '{"name":"Jordan","countries":["JO"]}' --dry-run
repzo store shipping rates create --data '{"type":"shipping","zoneId":"ZONE_ID","name":"Standard","price":3,"freeOverAmount":50}' --dry-run
repzo store shipping rates create --data '{"type":"pickup","locationId":"LOCATION_ID","name":"Pick up in store","price":0}' --dry-run
repzo store shipping quote --data '{"country":"JO","city":"Amman","subtotal":40}'
repzo store shipping carriers
```

A zone is a list of countries, narrowed to cities when it has one country. Rates are `shipping` or `local_delivery` in a zone, or `pickup` at a location. Amounts are in the workspace's base currency. Once any delivery option exists, an address no zone covers can't check out, so test addresses with `shipping quote`. `zones update|delete` and `rates update|delete` take the id. See [Shipping & Delivery](https://workstation.repzo.com/docs/online-store/shipping-and-delivery).

### Markets

```bash
repzo store markets get SITE_ID
repzo store markets set SITE_ID --data @markets.json --dry-run
```

`markets set` saves the whole list: a market you leave out is removed. Start from `markets get` and keep each market's `id`. See [Markets](https://workstation.repzo.com/docs/online-store/markets).

### Store settings

| Command | What it reads or changes |
|---|---|
| `store returns get\|set` | Return rules for every store |
| `store messages get\|set` | Which order emails shoppers get |
| `store abandoned-checkouts get\|set` | The abandoned-checkout recovery email |
| `store back-in-stock settings\|set` | Whether back-in-stock emails go out |
| `store review-requests get\|set` | The review request email (on or off, days after, delivered or shipped) |
| `store sign-in get\|set SITE_ID`, `store sign-in templates` | WhatsApp or SMS sign-in codes for a store, and the WhatsApp templates that can carry them |
| `store pixels get\|set SITE_ID` | Pixels and the cookie banner |
| `store ai get\|set SITE_ID` | Agent-ready store (llms.txt and MCP) and the store assistant |

`set` changes only the keys you send:

```bash
repzo store returns set --data '{"selfServe":true,"windowDays":14,"returnShipping":"customer_pays"}' --dry-run
repzo store messages set --data '{"customerMessages":{"order_out_for_delivery":false}}' --dry-run
repzo store abandoned-checkouts set --data '{"email":true,"abandonAfterMinutes":60,"emailDelayMinutes":360}' --dry-run
repzo store review-requests set --data '{"enabled":true,"delayDays":7}' --dry-run
repzo store pixels set SITE_ID --data '{"cookieBanner":true,"pixels":{"meta":{"enabled":true,"id":"123456789012345"}}}' --dry-run
repzo store ai set SITE_ID --data '{"agentReady":true,"assistant":{"enabled":true,"channelAccountId":"CHANNEL_ID","agentId":"AGENT_ID"}}' --dry-run
```

Turning the store assistant on deploys an AI agent on a web chat channel and needs permission to manage and deploy AI agents. If the result says `assistant.requiresPublish`, publish the agent.

### Store doctor

```bash
repzo store doctor get SITE_ID
repzo store doctor run SITE_ID
```

`doctor run` checks again at most once every 30 seconds per site. See [Store doctor](https://workstation.repzo.com/docs/online-store#store-doctor).

## Run the store

```bash
repzo orders fulfillments list ORDER_ID
repzo orders fulfillments create ORDER_ID --data '{"idempotencyKey":"ship-ORDER_ID-1","trackingNumber":"TRK123"}' --dry-run
repzo orders fulfillments update ORDER_ID FULFILLMENT_ID --data '{"status":"delivered"}' --dry-run
repzo orders cancel ORDER_ID --data '{"reason":"Customer asked","refund":"none"}' --dry-run
repzo orders edit --data '{"orderId":"ORDER_ID","lines":[{"lineItemId":"LINE_ID","quantity":1}],"dryRun":true}' --yes
repzo order-returns list --query status=requested
repzo order-returns approve RETURN_ID --data '{"shippingMethod":"instructions","shippingInstructions":"Drop it at our shop."}' --dry-run
repzo store feeds get SITE_ID
repzo store feeds set SITE_ID --data '{"channels":{"google":true,"meta":true},"brand":"Nour"}' --dry-run
repzo store back-in-stock summary
repzo store back-in-stock products --query status=waiting
```

| Command group | Subcommands |
|---|---|
| `orders fulfillments` | `list`, `create` (manual tracking, or `"shippingDriver":"aramex"` to book a waybill), `update` (in transit, out for delivery, delivered, failed attempt, returned, canceled) |
| `orders cancel` | Cancel with `refund` `none` or `credit_note` (refused while items have shipped) |
| `orders edit` | Change quantities, add or remove items, discount a line, change shipping. Send `"dryRun": true` first to see the new totals. |
| `order-returns` | `list`, `get`, `create`, `approve`, `decline`, `cancel`, `receive`, `process` |
| `store feeds` | `get`, `set`, `rotate-links`, `preview` |
| `store back-in-stock` | `products`, `requests`, `summary` (plus `settings` and `set`, above) |

See [Shipping & Delivery](https://workstation.repzo.com/docs/online-store/shipping-and-delivery), [Returns & Order Edits](https://workstation.repzo.com/docs/online-store/returns-and-order-edits), and [Back in Stock, Feeds & Reviews](https://workstation.repzo.com/docs/online-store/marketing).

## Example: an agency workflow

A typical flow for a developer building custom sections for a live store:

```bash
# 1. Work on a copy of the live theme
repzo store themes list SITE_ID
repzo store themes duplicate SITE_ID LIVE_THEME_ID --data '{"name":"Redesign"}' --yes

# 2. Pull the copy and let your AI tool read AGENTS.md
repzo store pull SITE_ID --theme NEW_THEME_ID --dir redesign

# 3. Write sections/*.liquid and edit templates/*.json, with a live preview
repzo store dev --dir redesign

# 4. Check and save
repzo store push --dir redesign --dry-run
repzo store push --dir redesign --yes

# 5. Share the preview with the store owner, then make the copy live
repzo store preview SITE_ID --theme NEW_THEME_ID --yes
repzo store themes publish SITE_ID NEW_THEME_ID --data '{"revision":REVISION}' --yes
```

The store owner can also open the new theme in the builder, change the settings your schemas expose, and publish it themselves.

## Related pages

- [Theme code (Liquid sections)](https://workstation.repzo.com/docs/developers/online-store/theme-code)
- [Theme code reference](https://workstation.repzo.com/docs/developers/online-store/theme-code-reference)
- [Online store API](https://workstation.repzo.com/docs/developers/online-store/commerce-api)
- [Developer API and CLI](https://workstation.repzo.com/docs/configuration/developer-api)
- [Themes](https://workstation.repzo.com/docs/online-store/themes)
- [The store builder](https://workstation.repzo.com/docs/online-store/store-builder)
